> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apiyi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Kimi K2.5 テキスト生成

> Moonshot AIのネイティブなマルチモーダル・フラッグシップで、256KコンテキストウィンドウとThinkingモードを備えています。APIYIはAlibaba Cloudの公式リレーを通じて接続し、0.88倍のグループ価格にチャージボーナスを加えることで、実質コストを公式の80%未満に抑えます。

Kimi K2.5は、Moonshot AIのネイティブなマルチモーダル旗艦モデルで、2026年1月27日にリリースされました。これはビジュアルコーディングと自律的なAgent Swarmオーケストレーションに重点を置いており、追加料金なしで提供される256Kのコンテキストウィンドウを備えています。APIYIは、これを本番環境向けの安定性のために**Alibaba Cloudの公式リレーチャネル**経由で統合しています。ベースのグループレート倍率は**公式課金の0.88倍**で、入金ボーナス（\$100入金→\$10無料分以上）を重ねると、**実質コストは公式課金の80%未満**になります。

<Info>
  **Kimi K2.5はAPIYIで利用できます**: Alibaba Cloudの公式リレーチャネル、OpenAI互換エンドポイント、モデルID `kimi-k2.5`。Kimiの公式サイトとは異なり、**Thinkingモードはリクエストボディ内の `enable_thinking: true` によって明示的に有効化する必要があります**。デフォルトではモデルはInstantモードで実行されます。
</Info>

## 主な利点

<CardGroup cols={2}>
  <Card title="256K コンテキスト" icon="scroll">
    追加料金なしで 256K token を利用できます。中規模のコードベース全体や長文ドキュメントを 1 回の呼び出しで収められます。
  </Card>

  <Card title="推論モード" icon="brain">
    `enable_thinking: true` による高度な推論を有効化できます。複雑な計画立案、根本原因分析、エージェント向けに設計されています。
  </Card>

  <Card title="ネイティブなマルチモーダル + ビジュアルコーディング" icon="eye">
    画像とコードをネイティブに理解します。UI モックアップ、スクリーンショット、図表を実行可能なコードに変換するのが得意です。
  </Card>

  <Card title="安定した Alibaba Cloud 公式転送" icon="server">
    Alibaba Cloud の公式転送チャネル経由でルーティングされます。高い同時実行数でもエンタープライズグレードの SLA を提供します。
  </Card>
</CardGroup>

## モデル情報

| パラメータ                           | 値                                               |
| ------------------------------- | ----------------------------------------------- |
| **モデル ID**                      | `kimi-k2.5`                                     |
| **コンテキストウィンドウ**                 | 256,000 tokens                                  |
| **モード**                         | Instant / Thinking / Agent / Agent Swarm        |
| **Thinking トグル**                | リクエストボディ内の `enable_thinking: true`（既定値 `false`） |
| **入力**                          | テキスト + 画像（ネイティブなマルチモーダル）                        |
| **出力**                          | テキスト                                            |
| **ストリーミング**                     | ✅ サポート済み                                        |
| **Function Calling / Tool Use** | ✅ サポート済み                                        |
| **チャネル**                        | Alibaba Cloud 公式リレー                             |

<Warning>
  Kimi の組み込みの `$web_search` ツールは、現在 Thinking モードと互換性がありません。Moonshot のガイダンスに従い、web\_search ツールが必要な場合は `enable_thinking` を無効にしてください。この制限は公式プラットフォームと一致しています。
</Warning>

## 料金

| Item         | Official           | APIYI グループ (0.88×)  | チャージ特典あり（概算）         |
| ------------ | ------------------ | ------------------- | -------------------- |
| 入力           | \$0.60 / 1M tokens | \$0.528 / 1M tokens | \~\$0.48 / 1M tokens |
| 出力           | \$2.50 / 1M tokens | \$2.20 / 1M tokens  | \~\$2.00 / 1M tokens |
| キャッシュヒット（入力） | \$0.10 / 1M tokens | \$0.088 / 1M tokens | —                    |

<Info>
  **料金に関する注意**: APIYI は、基本のグループ料金として **0.88×のレート倍率**（公式の定価の88%）を採用しています。オンボーディング / 大口チャージ特典（例: \$100 チャージで \$10 以上の無料分）を重ねると、**実質コストは公式の80%未満**になります。詳細は [チャージ特典](/ja/faq/recharge-promotions) をご覧ください。
</Info>

## Thinkingモードを有効にする方法

Kimiの公式サイトとの最大の違いは、APIYIではデフォルトがInstantモードである点です。リクエストボディ内で`enable_thinking`を明示的に有効にする必要があります。

| ユースケース                | `enable_thinking` | 備考                                   |
| --------------------- | ----------------- | ------------------------------------ |
| 日常的なチャット / 高速応答       | `false`（デフォルト）    | Instantモード、最も低いレイテンシ                 |
| 複雑な推論 / コード計画 / RCA   | `true`            | Thinkingモード、推論トレースを出力                |
| web\_search を使う Agent | `false`           | 公式の制限: web\_search と thinking は排他的です |

### cURLの例（Thinking有効）

```bash theme={null}
curl --location 'https://api.apiyi.com/v1/chat/completions' \
  --header "Authorization: Bearer sk-xxxx" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "kimi-k2.5",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant."
      },
      {
        "role": "user",
        "content": "What is 1+1?"
      }
    ],
    "enable_thinking": true
  }'
```

## 呼び出し方法

### エンドポイント

```
https://api.apiyi.com/v1/chat/completions
```

### 基本的な使い方（即時モード）

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.apiyi.com/v1/chat/completions" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "kimi-k2.5",
      "messages": [
        {"role": "user", "content": "Introduce yourself in one sentence."}
      ]
    }'
  ```

  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(
      api_key="YOUR_API_KEY",
      base_url="https://api.apiyi.com/v1"
  )

  response = client.chat.completions.create(
      model="kimi-k2.5",
      messages=[
          {"role": "user", "content": "Introduce yourself in one sentence."}
      ]
  )

  print(response.choices[0].message.content)
  ```

  ```javascript Node.js theme={null}
  import OpenAI from 'openai';

  const client = new OpenAI({
    apiKey: 'YOUR_API_KEY',
    baseURL: 'https://api.apiyi.com/v1'
  });

  const response = await client.chat.completions.create({
    model: 'kimi-k2.5',
    messages: [
      { role: 'user', content: 'Introduce yourself in one sentence.' }
    ]
  });

  console.log(response.choices[0].message.content);
  ```
</CodeGroup>

### 詳細な使い方（推論モード）

<CodeGroup>
  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(
      api_key="YOUR_API_KEY",
      base_url="https://api.apiyi.com/v1"
  )

  response = client.chat.completions.create(
      model="kimi-k2.5",
      messages=[
          {"role": "system", "content": "You are a helpful assistant."},
          {"role": "user", "content": "Analyze the time complexity of this code and suggest optimizations."}
      ],
      extra_body={
          "enable_thinking": True
      }
  )

  print(response.choices[0].message.content)
  ```

  ```javascript Node.js theme={null}
  import OpenAI from 'openai';

  const client = new OpenAI({
    apiKey: 'YOUR_API_KEY',
    baseURL: 'https://api.apiyi.com/v1'
  });

  const response = await client.chat.completions.create({
    model: 'kimi-k2.5',
    messages: [
      { role: 'system', content: 'You are a helpful assistant.' },
      { role: 'user', content: 'Analyze the time complexity of this code and suggest optimizations.' }
    ],
    // @ts-ignore - custom field
    enable_thinking: true
  });

  console.log(response.choices[0].message.content);
  ```
</CodeGroup>

### ストリーミング

```python theme={null}
response = client.chat.completions.create(
    model="kimi-k2.5",
    messages=[{"role": "user", "content": "Write a short poem about spring."}],
    stream=True,
    extra_body={"enable_thinking": True}
)

for chunk in response:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)
```

## リクエストパラメータ

| 名前                | 型       | 必須  | 備考                                |
| ----------------- | ------- | --- | --------------------------------- |
| `model`           | string  | Yes | `kimi-k2.5`である必要があります             |
| `messages`        | array   | Yes | 会話メッセージ                           |
| `enable_thinking` | boolean | No  | Thinkingモードを有効にします; デフォルトは`false` |
| `stream`          | boolean | No  | 出力をストリーミングします                     |
| `temperature`     | number  | No  | サンプリングtemperature、0–2             |
| `max_tokens`      | integer | No  | 最大出力token数                        |
| `tools`           | array   | No  | 関数 / tool一覧                       |

## レスポンス形式

```json theme={null}
{
  "id": "chatcmpl-xxxxxxxx",
  "object": "chat.completion",
  "created": 1706300000,
  "model": "kimi-k2.5",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "1+1 equals 2."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 24,
    "completion_tokens": 12,
    "total_tokens": 36
  }
}
```

## ベストプラクティス

1. **タスクごとにモードを切り替える**: 日常のチャットや短い生成では Instant mode をオンのままにし、複雑な推論、コードレビュー、エージェントのプランニングでは `enable_thinking: true` に設定します。
2. **256K のコンテキストを活用する**: 中規模の repo、製品ドキュメント一式、長い会議の文字起こしを 1 回の呼び出しに収められます — 追加料金なしです。
3. **マルチモーダルなビジュアルコーディング**: UI のスクリーンショット / デザインモックアップを送って、K2.5 に「読み取り → 計画 → コーディング」を一気に任せます。
4. **節約効果をさらに伸ばす**: \$100以上の入金ボーナスと 0.88× のグループレートを組み合わせると、実質コストは公式の80%未満に下がります。
5. **web\_search の注意点に留意する**: Moonshot の内蔵 `$web_search` ツールが必要な場合は `enable_thinking` を無効にしてください。

## よくある質問

<AccordionGroup>
  <Accordion title="なぜ私のリクエストはThinking modeを使っていないのですか？">
    Thinking modeはデフォルトではオフです。リクエスト本文に`"enable_thinking": true`が含まれていることを確認してください。OpenAI Python SDKでは`extra_body`内に指定し、Node.js SDKではトップレベルのフィールドとして指定できます。
  </Accordion>

  <Accordion title="APIYI の Kimi K2.5 は Moonshot のものと同じモデルですか？">
    はい — 同じ上流モデルで、Alibaba Cloud の official-transfer チャネル経由でルーティングされています。唯一の違いは、Thinking mode がデフォルトでオフであり、`enable_thinking`を通じて有効化する必要があることです。
  </Accordion>

  <Accordion title="0.88×のグループレートはどのように機能しますか？">
    APIYI コンソールで API token を作成する際、Kimi K2.5 を含むグループに割り当てると、課金に 0.88× の倍率が自動的に適用されます。チャージ特典と組み合わせると、合計コストはさらに下がります。[チャージ特典](/ja/faq/recharge-promotions)をご覧ください。
  </Accordion>

  <Accordion title="function calling / tool use に対応していますか？">
    はい。標準的な OpenAI スタイルの `tools` 定義を渡してください。なお、公式の `$web_search` 組み込みツールは Thinking mode と排他的です。別々の呼び出しで使用してください。
  </Accordion>

  <Accordion title="Thinking mode は追加料金がかかりますか？">
    Thinking トレースは出力 token としてカウントされ、通常どおり課金されます。複雑なタスクでは出力 token が大幅に増える場合があるため、より深い推論が必要な場合にのみ有効化してください。
  </Accordion>
</AccordionGroup>

## 関連リソース

<CardGroup cols={2}>
  <Card title="API マニュアル" icon="book" href="/ja/api-manual">
    API の完全な利用ガイド
  </Card>

  <Card title="チャージ特典" icon="gift" href="/ja/faq/recharge-promotions">
    ボーナスを積み重ねて、価格をさらに下げます
  </Card>

  <Card title="モデル情報" icon="list" href="/ja/api-capabilities/model-info">
    利用可能なすべてのモデルとグループを閲覧します
  </Card>

  <Card title="ユースケース" icon="layers" href="/ja/scenarios">
    クライアント統合の手順
  </Card>
</CardGroup>
