Hunyuan API

Hunyuan API

Two Tencent models on the standard Text API passthrough. Every model here answers on all four request formats the Text API supports.

ModelChoose it for
hy4-previewThe current open-weight flagship — a heavy reasoner, so plan around the output rate
hy3The previous generation, several times cheaper

OpenAI Chat Completions

POST https://api.beatapi.io/v1/chat/completions

1import OpenAI from "openai";
2
3const client = new OpenAI({
4 apiKey: process.env.BEATAPI_API_KEY,
5 baseURL: "https://api.beatapi.io/v1"
6});
7
8const completion = await client.chat.completions.create({
9 model: "hy4-preview",
10 max_tokens: 2000,
11 messages: [
12 { role: "user", content: "Compare write-through and write-behind caching for a ledger that must never lose a write." }
13 ]
14});
15
16console.log(completion.choices[0].message.content);
$curl --request POST \
> --url https://api.beatapi.io/v1/chat/completions \
> --header 'Authorization: Bearer <BEATAPI_API_KEY>' \
> --header 'Content-Type: application/json' \
> --data '{
> "model": "hy4-preview",
> "messages": [
> {
> "role": "user",
> "content": "Compare write-through and write-behind caching for a ledger that must never lose a write."
> }
> ]
>}'

Peak-hour pricing on HY3

hy3 carries a daily peak window: 08:00–24:00 Beijing time (GMT+8), every rate is 1.6x — input, cached input and output alike. Between 00:00 and 08:00 the standard rate applies. Unlike DeepSeek’s window, this one runs every day, weekends included.

The prices on the pricing page are the off-peak rates. hy4-preview has no peak window; it bills one rate around the clock.

Other SDK formats

The same models answer on /v1/responses, /v1/messages and the Gemini-compatible endpoint. The request and response shapes are identical for every text model, so they are documented once on the Text API page rather than repeated here.

Authentication and availability

One BeatAPI key reaches every model on this page — there is no per-vendor key, no per-vendor base URL, and no separate signup. Send Authorization: Bearer <BEATAPI_API_KEY> against https://api.beatapi.io.