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.
Context
1M tokens
Input
$1.1470836 / 1M tokens
Output
$3.4398754 / 1M tokens
Released
Aug 28, 2026

How to use Hy4 Preview API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to tencent/hy4-preview.
import requests

r = requests.post(
    "https://api.aimlapi.com/v1/chat/completions",
    headers={"Authorization": "Bearer " + AIMLAPI_KEY},
    json={
      "model": "tencent/hy4-preview",
      "messages": [
        {
          "role": "user",
          "content": "Hello!"
        }
      ]
    },
)
print(r.json())
const r = 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": "Hello!"
      }
    ]
  }),
});
console.log(await r.json());
curl -X POST 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":"Hello!"}]}'

OpenAI-compatible — swap the base URL and it works with your existing SDK.

Hy4 Preview API Pricing

TypePrice
Input
$1.1470836 / 1M tokens
Output
$3.4398754 / 1M tokens
Cached input
$0.0577668 / 1M tokens

Hy4 Preview vs other models

ModelInputOutputContextBest for
Hy4 Preview
This page
$1.1470836 / 1M tokens
$3.4398754 / 1M tokens
1M tokens
Long-horizon coding + agentic works
$1.82 / 1M tokens
$5.72 / 1M tokens
1M tokens
Reasoning + agents
$3.9 / 1M tokens
$19.5 / 1M tokens
1M tokens
Long-context, multimodal & agentic workflows
$0.5655 / 1M tokens
$1.131 / 1M tokens
1M tokens
Reasoning + agents

Start building with Hy4 Preview

Get API Key
1000+ models, one API.