Hy4 Preview overview
Hy4 Preview by Tencent
Meet Hy4 Preview, Tencent's next-generation open-source flagship model, built for long-horizon coding and agentic tool-use.
Hy4 Preview specs
- Model ID
tencent/hy4-preview- Developer
- Tencent
- Context window
- 1,048,576 tokens
- Max output
- 64,000 tokens
- Input
- Text
- Output
- Text
- API
- OpenAI-compatible, base URL
https://api.aimlapi.com/v1
What Is Hy4 Preview API?
Hy4 Preview is Tencent's new-generation flagship model, part of the Hunyuan Hy4 family. It is a 770-billion-parameter Mixture-of-Experts model with 49 billion active parameters, trained alongside Tencent's internal software engineering, game development, finance, and security teams around the tasks those teams actually ship, with a native 10-billion-parameter MTP layer built in for speculative decoding.
Technical Reference
| Developer | Tencent |
|---|---|
| Model ID | tencent/hy4-preview |
| Release Date | August 28, 2026 |
| Context Window | 1,048,576 tokens (~1M) |
| Max Output Tokens | 64,000 |
| Parameters | 770B total / 49B active (MoE) |
| Modalities | Text (input) → Text (output) |
| Capabilities | Reasoning, Streaming, Structured output, Tool calling |
What Hy4 Preview Brings to the Table
Large-scale MoE with efficient activation
78 layers, one dense FFN layer plus 77 MoE layers, each with 256 routed experts and 1 shared expert, top-8 routing per token. A native 10B-parameter MTP layer (0.7B activated) handles speculative decoding for faster inference.
Built around real engineering work
Trained with Tencent's internal software engineering, game development, finance, and security teams on the tasks those teams actually ship, including front-end visual and interaction quality, not just benchmark scores.
Open weights, Apache 2.0 license
Both Hy4 Preview and an FP8 variant are available for self-hosted deployment, with dedicated tool-calling and reasoning parsers for agent frameworks.
Where Hy4 Preview Makes the Most Sense
Long-horizon software engineering
Understanding, planning, debugging, and verifying extended development tasks across a 1M-token context window large enough to hold full codebases or long agent sessions.
Tool-calling agent pipelines
Dedicated tool-call and reasoning parsers make it a practical backbone for agent frameworks that need reliable, structured tool use.
Self-hosted deployments
Open weights under Apache 2.0, including an FP8 variant, for teams that need to run the model on their own infrastructure.
Use cases
Software engineering: Hy4 preview is documented as suited for understanding, planning, debugging, and verifying long-horizon development tasks, with improved front-end visual taste and interaction quality.
Office and analysis: It is documented as suited for turning messy information spread across many files into documents, spreadsheets, and presentations, including data analysis, equations, and financial models.
Game development: It is documented as suited for turning a single prompt into a playable prototype and working fluently with game engines across multiple turns.
Scientific research: It is documented as suited for harder research questions, with strengths noted in AI research, molecular dynamics, condensed matter physics, and pure mathematics.
Capabilities
- Reasoning
- Streaming
- Structured outputs
- Function calling
Hy4 Preview API pricing
| Usage | Price | Unit |
|---|---|---|
| Input | $0.8824 | 1M tokens |
| Output | $2.65 | 1M tokens |
| Cached input | $0.0444 | 1M tokens |
Prices from the AI/ML API price list, checked on Nov 4, 2026.
Hy4 Preview vs other models: token prices
AI/ML API input and output rates for 5 models, per million tokens.
| Model | Input | Output |
|---|---|---|
| $0.8824 | $2.65 | |
| $0.0466 | $0.1873 | |
| $0.0783 | $0.3121 | |
| $0.0783 | $0.3121 | |
| $0.2116 | $0.8464 |
How to use the Hy4 Preview API
View docsBuild with your agent
Give your agent the model details, code and documentation.
1Get your API key
Create API keyexport AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"2Make your first request
curl 'https://api.aimlapi.com/v1/chat/completions' \
-H "Authorization: Bearer $AIMLAPI_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "tencent/hy4-preview",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}'import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['AIMLAPI_KEY']}",
"Content-Type": "application/json",
}
payload = {
"model": "tencent/hy4-preview",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}
response = requests.post("https://api.aimlapi.com/v1/chat/completions", headers=headers, json=payload, timeout=120)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.aimlapi.com/v1/chat/completions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "tencent/hy4-preview",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());Hy4 Preview FAQ
What is the context window of Hy4 Preview?
Hy4 Preview has a 1,048,576 tokens context window and can return up to 64,000 tokens.
What inputs and outputs does Hy4 Preview support?
Hy4 Preview takes text as input and returns text.
What is the model ID for Hy4 Preview?
Use tencent/hy4-preview as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.
When was Hy4 Preview released?
Hy4 Preview became available on August 28, 2026.
How much does Hy4 Preview cost?
Hy4 Preview costs $0.8824 input and $2.65 output per 1M tokens on AI/ML API, billed as you go with no subscription.
Does Hy4 Preview support streaming?
Yes, Hy4 Preview can stream responses as they are generated.
Who created Hy4 Preview?
Hy4 Preview was built by Tencent.
Does Hy4 Preview support calling external tools or functions?
Yes, Hy4 Preview supports function calling, allowing it to invoke external tools during a conversation.
What architecture does Hy4 Preview use and how many parameters does it have?
Hy4 Preview is a mixture-of-experts model with 49B active parameters out of 770B total.