> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.beatapi.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.beatapi.io/_mcp/server.

# Hunyuan API

> 1 つの BeatAPI キーで Tencent の Hunyuan HY4 と HY3 を呼び出せます。HY3 には公開条件どおりの毎日のピーク時間帯料金が適用されます。

# Hunyuan API

Tencent のモデル 2 種を、標準の Text API パススルーで利用できます。どちらも Text API が対応する 4 つすべてのリクエスト形式で呼び出せます。

| モデル           | 適した用途                                  |
| ------------- | -------------------------------------- |
| `hy4-preview` | 現在のオープンウェイトの主力モデル。推論量が多いため、出力料金を考慮して計画 |
| `hy3`         | 料金が数分の一となる前世代モデル                       |

## OpenAI Chat Completions

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

```typescript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.BEATAPI_API_KEY,
  baseURL: "https://api.beatapi.io/v1"
});

const completion = await client.chat.completions.create({
  model: "hy4-preview",
  max_tokens: 2000,
  messages: [
    { role: "user", content: "Compare write-through and write-behind caching for a ledger that must never lose a write." }
  ]
});

console.log(completion.choices[0].message.content);
```

```bash
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."
    }
  ]
}'
```

## HY3 のピーク時間帯料金

`hy3` には毎日のピーク時間帯があります。**北京時間（GMT+8）の 08:00–24:00 は、すべての料金が 1.6 倍**になります。入力、キャッシュ入力、出力のすべてが対象です。00:00–08:00 は通常料金が適用されます。この条件は週末を含む毎日に適用されます。BeatAPI で他に時間帯別料金を持つのは、平日だけにピーク時間帯がある [DeepSeek HC モデル](/text-api/deepseek) 2 種のみです。

> **Note**
>
> 料金ページにはオフピーク料金が表示されています。`hy4-preview` にピーク時間帯はなく、終日同じ料金が適用されます。

## その他の SDK 形式

同じモデルを `/v1/responses`、`/v1/messages`、Gemini 互換エンドポイントでも利用できます。各形式のリクエストとレスポンスの構造はテキストモデル間で共通のため、[Text API](/text-api) ページでまとめて説明しています。

## 認証と利用可能なモデル

このページの全モデルを 1 つの BeatAPI キーで利用できます。ベンダーごとのキー、ベース URL、個別の登録は不要です。`https://api.beatapi.io` へのリクエストに `Authorization: Bearer <BEATAPI_API_KEY>` を付けてください。