Quick Start: Three Things You Need
| Item | Value |
|---|---|
| Model ID | tencent/hy4-preview |
| Endpoint (OpenAI-compatible) | https://tokenra.io/v1/chat/completions |
| API key | Generate free at tokenra.io/register |
Hy4 Preview is served as a hosted API and is OpenAI-compatible. If you have existing OpenAI SDK code, you only need to change the base_url and model fields.
Code Examples
cURL
curl https://tokenra.io/v1/chat/completions \
-H "Authorization: Bearer $TOKENRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tencent/hy4-preview",
"messages": [
{"role": "user", "content": "Explain the difference between MoE and dense models."}
]
}'
Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
base_url="https://tokenra.io/v1",
api_key="YOUR_TOKENRA_API_KEY",
)
response = client.chat.completions.create(
model="tencent/hy4-preview",
messages=[
{"role": "user", "content": "Explain the difference between MoE and dense models."}
],
)
print(response.choices[0].message.content)
Node.js (OpenAI SDK)
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://tokenra.io/v1',
apiKey: 'YOUR_TOKENRA_API_KEY',
});
const completion = await client.chat.completions.create({
model: 'tencent/hy4-preview',
messages: [{ role: 'user', content: 'Hello, Hy4!' }],
});
console.log(completion.choices[0].message.content);
Hy4 API Pricing (per 1M tokens)
| Price | Billing | |
|---|---|---|
| Input tokens | $0.834 | Flat rate — no peak/off-peak |
| Output tokens | $2.501 |
Hy4 Preview uses a single flat rate, unlike DeepSeek's peak/off-peak model. For a full price breakdown against other flagship models, see our Hy4 vs DeepSeek comparison.
Model Specifications
| Specification | Value |
|---|---|
| Context window | 1,048,576 tokens |
| Maximum output | 64,000 tokens |
| Architecture | MoE — 770B total / 49B active |
| Backbone | 78 layers (1 dense FFN + 77 MoE) |
| Experts per MoE layer | 256 routed + 1 shared |
| MTP layer | 1 native (10B / 0.7B active), speculative decoding |
Full architecture details are available on the Hy4 Preview home page.
Frequently Asked Questions
How do I access the Hy4 API?
Hy4 Preview is available through OpenAI-compatible API gateways. Create a free account at tokenra.io/register, generate an API key, and call the model ID tencent/hy4-preview against https://tokenra.io/v1/chat/completions.
How much does the Hy4 API cost?
Hy4 Preview is priced at $0.834 per 1M input tokens and $2.501 per 1M output tokens on OpenRouter, with a flat rate and no peak/off-peak pricing.
What is the Hy4 API model ID?
The model ID is tencent/hy4-preview on OpenRouter and OpenAI-compatible gateways.
Is the Hy4 API OpenAI-compatible?
Yes. Hy4 Preview is served through OpenAI-compatible endpoints, so existing OpenAI SDK code works by changing only the base URL and model ID.
What is the Hy4 API context window?
Hy4 Preview supports a 1,048,576 token context window with a maximum output of 64,000 tokens.