Hy4 Preview API

Hy4 Preview is Tencent Hunyuan's new-generation flagship MoE model -- 770B total / 49B active parameters, with a 1M-token context window and native speculative decoding.

Modalities
TextText
In / Out price
$0.8824/$2.65per 1M
Context window
1.05M tokens
Released
Aug 28, 2026

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

DeveloperTencent
Model IDtencent/hy4-preview
Release DateAugust 28, 2026
Context Window1,048,576 tokens (~1M)
Max Output Tokens64,000
Parameters770B total / 49B active (MoE)
ModalitiesText (input) → Text (output)
CapabilitiesReasoning, 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

Hy4 Preview pricing in US dollars
UsagePriceUnit
Input$0.88241M tokens
Output$2.651M tokens
Cached input$0.04441M 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.

AI/ML API model prices in USD per million tokens
ModelInputOutput
Hy4 Preview$0.8824$2.65
Hy-MT2-1.8B$0.0466$0.1873
Hy-MT2-30B-A3B$0.0783$0.3121
Hy-MT2-7B$0.0783$0.3121
Hy3$0.2116$0.8464

How to use the Hy4 Preview API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export 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."
    }
  ]
}'

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.

Start building with Hy4 Preview

Hy4 Preview API

tencent/hy4-preview

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export 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."
    }
  ]
}'