Tencent Hunyuan API
The Tencent Hunyuan API on OceanToken gives you 4 Hunyuan (Hy) models on one OpenAI-compatible endpoint: Hy4 and three Hy-MT2 translation models. Prices start at $0.044 per million input tokens for Hy-MT2-1.8B, and Hy4 costs $0.834 per million input tokens and $2.501 per million output tokens. Every model is billed per token from one prepaid balance, with no subscription and no Tencent Cloud account.
Tencent Hunyuan API prices: Text 3
| Model | Kind | Context | Price |
|---|---|---|---|
| Hy-MT2-1.8Btencent/hy-mt2-1.8b | Text | 8K | $0.044 / $0.177 per 1M tokens |
| Hy-MT2-30B-A3Btencent/hy-mt2-30b-a3b | Text | 8K | $0.074 / $0.295 per 1M tokens |
| Hy-MT2-7Btencent/hy-mt2-7b | Text | 8K | $0.074 / $0.295 per 1M tokens |
Tencent Hunyuan API prices: Text & vision 1
| Model | Kind | Context | Price |
|---|---|---|---|
| Hy4tencent/hy4 | Text & vision | 1.05M | $0.834 / $2.501 per 1M tokens Tier 3 10% off |
What is Tencent Hunyuan?
Tencent Hunyuan is the family of large language models built by the Tencent Hy team, the AI group of Tencent, the Chinese technology company behind WeChat and QQ. Its releases carry the short name Hy (Hy4, Hy-MT2), so "Hunyuan" and "Hy" mean the same family.
The general-purpose models are mixture-of-experts (MoE) models. A MoE model splits its weights into many experts and sends each token through only a few of them: the total parameters set how much the model can store, and the active parameters set how much compute, and so how much latency, each token costs. Hy4 is the full release of Hy4 preview, which Tencent described with 770B total and 49B active parameters.
Tencent publishes model weights on Hugging Face: Hy4 preview came out under Apache 2.0, and the Hy-MT2 translation models are open source. The context window runs from 8K tokens on the translation models to 1.05M on Hy4.
Which Tencent Hunyuan model should you use?
Pick by the job. Use Hy4 for coding, agent and chat work, including requests that hold a whole repository or include images, and Hy-MT2 when the job is translation.
Hy4: the model for coding and agent workloads
Hy4 (tencent/hy4) is the model to start with. It is the full release that followed Hy4 preview (28 August 2026), and Tencent reports its largest gains in agentic, long-horizon work. It reads up to 1.05M tokens of text and images, writes up to 66K, supports tool calling, structured outputs and a reasoning effort setting, and costs $0.834 input and $2.501 output per million tokens. Use it when one request has to hold a whole repository, a long document set or a long agent transcript. Tencent's notes on the preview said it could reason longer than it needed to and over-verify its own work, which shows up as extra output tokens: at $2.501 per million output tokens, set max_tokens and watch the cost of each request in your logs.
Hy-MT2: translation models in three sizes
Hy-MT2 is Tencent's translation family, open-sourced on 21 May 2026 in three sizes: Hy-MT2-1.8B, Hy-MT2-7B and Hy-MT2-30B-A3B, a MoE model with about 3B active parameters. All three translate among 33 languages and follow translation instructions, including glossary terms and style guides. The 1.8B model costs $0.044 input and $0.177 output per million tokens, the 7B model $0.074 and $0.295, and the 30B-A3B model $0.074 and $0.295. Each request holds 8K tokens with up to 4K output tokens, so send long documents a few paragraphs at a time. Put the instruction and the text in one user message, as in Tencent's template: "Translate the following text into French. Note that you should only output the translated result without any additional explanation:" followed by the text.
How to call the Tencent Hunyuan API outside China
You call every Tencent Hunyuan model on OceanToken through an OpenAI-compatible API from anywhere: set the base URL to https://api.oceantoken.ai/v1, use your OceanToken API key, and put the model ID, such as tencent/hy4, in the model field. You do not need a Tencent Cloud account.from openai import OpenAI
# Your API Key from the OceanToken console
client = OpenAI(base_url="https://api.oceantoken.ai/v1",
api_key="YOUR_API_KEY")
reply = client.chat.completions.create(
model="tencent/hy4",
messages=[{"role": "user", "content": "Hello"}])
print(reply.choices[0].message.content)
The same API key works for every other model in the catalog, so moving from Hy4 to a Hy-MT2 model for translation, or to a DeepSeek or Qwen model, changes one string. Requests are billed per token from your prepaid balance, and your logs show the cost and latency of each request, which is how you catch a Hy4 call that reasoned for longer than you expected. In a coding agent such as Claude Code, Codex, Cline or Kilo Code, point its OpenAI-compatible provider at the same base URL and key, and set the model ID there. The OpenAI SDK for Node works the same way as the Python sample: pass the base URL and the key to the client, and keep the key in an environment variable rather than in your source code.
Hy4 vs DeepSeek and Qwen for coding agents
On price per token, compare the three directly: on OceanToken, Hy4 costs $0.834 input and $2.501 output per million tokens, DeepSeek V4.1 Flash costs $0.21 and $0.84, and Qwen3.8 Max (0902) costs $1.80 and $5.40.
Price per token is not price per task. Hy4 reads 1.05M tokens, DeepSeek V4.1 Flash 1.05M and Qwen3.8 Max 984K, so a large repository fits in one request on any of the three. A model that needs more retries or longer reasoning spends more tokens per finished change, so treat any ranking of the three as provisional.
Decide with your own work: run the same 50 to 100 real tasks from your repository through each model, and compare the pass rate, the tokens per finished task and the cost per finished task from your request logs. All three use the same key and base URL, so the test changes the model ID, not your code.
Hunyuan API parameters: reasoning, tools and structured outputs
All 4 models take the standard chat completions parameters, such as temperature and max_tokens, but they differ in what else they accept, and that decides what each one can do inside an agent. The list below is read from the catalog, so it matches what the API accepts today.
- Hy4 (
tencent/hy4): tool calling, structured outputs, reasoning with a reasoning effort setting and log probabilities, up to 66K output tokens. - Hy-MT2-1.8B (
tencent/hy-mt2-1.8b): the basic chat parameters only, up to 4K output tokens. - Hy-MT2-30B-A3B (
tencent/hy-mt2-30b-a3b): structured outputs, up to 4K output tokens. - Hy-MT2-7B (
tencent/hy-mt2-7b): structured outputs, up to 4K output tokens.
For an agent that calls functions, use Hy4: it takes tool calling, structured outputs and a reasoning effort setting in the same request. The Hy-MT2 models are for translation and take no tools, so send text and expect text back, and keep output tokens within their limit.
Tencent Hunyuan release history
Hy3 preview came out on 23 April 2026, the first model from Tencent's rebuilt training infrastructure. On 21 May 2026 Tencent open-sourced the three Hy-MT2 translation models. Hy3, the full release built from the preview, followed in early July 2026, and Hy4 preview, the 770B flagship, arrived on 28 August 2026. The full Hy4, with visual understanding, came after it.
On OceanToken, Hy4 now takes the place of the earlier general-purpose releases: Hy3, Hy3 preview and Hy4 preview have left the catalog, and their pages lead to Hy4. If your code still names one of them, change the model ID to tencent/hy4, which is the only change your code needs, and rerun your tests, since reasoning length and output can differ between releases.
The pattern matters for planning: Tencent ships a preview first and replaces it within a few months. Keep the model ID in one place in your code, and rerun your tests when a full release lands rather than switching on the announcement.
Frequently asked questions
Is the Tencent Hunyuan API OpenAI-compatible?
Yes. On OceanToken every Tencent Hunyuan model answers on the OpenAI chat completions endpoint at https://api.oceantoken.ai/v1, so the official OpenAI SDKs for Python and Node work once you change the base URL and the API key. The model ID goes in the model field, for example tencent/hy4 or tencent/hy-mt2-7b.
How much does the Hy4 API cost per million tokens?
Hy4 costs $0.834 per million input tokens and $2.501 per million output tokens on OceanToken, and $0.042 per million cached input tokens. A request with 20,000 input tokens and 2,000 output tokens costs about $0.0217, paid from your prepaid balance with no subscription.
What happened to Hy3 and Hy4 preview?
They have left the OceanToken catalog, together with Hy3 preview. Hy4 is the full release that followed Hy4 preview, and it takes their place: change the model ID to tencent/hy4 and rerun your tests before you switch production traffic.
Which Hunyuan model has the longest context window?
Hy4, with 1.05M tokens per request and up to 66K output tokens. The Hy-MT2 translation models read 8K, which is enough for a few paragraphs at a time.
Which Tencent model is best for translation?
Use Hy-MT2, which Tencent built only for translation among 33 languages, with support for glossary and style instructions. Start with Hy-MT2-7B for production text, try Hy-MT2-30B-A3B when terminology quality matters most, and use Hy-MT2-1.8B, at $0.044 per million input tokens, for high-volume text such as user comments.
Is there a free Tencent Hunyuan API?
Not on OceanToken today: every Tencent model here is paid per token from a prepaid balance, with no subscription. To try the API at no cost first, use one of the free models with the same key and base URL, then change the model ID to a Tencent model when you are ready.
Other publishers
OpenAI · Qwen · Google · Mistral · Anthropic · ByteDance · Z.ai · Recraft · NVIDIA · SpaceXAI · ByteDance Seed · DeepSeek