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

# Comfy Router で Seed 2.0 Mini 260215 を使用する

> Comfy Router 経由で byteplus/seed-2-0-mini-260215 を呼び出します。endpoint、リクエスト形状、Router が返すレスポンスについて説明します。

`byteplus/seed-2-0-mini-260215` の API リファレンス。BytePlus から Comfy Router が提供しています。

## クイックスタート

[Comfy ワークスペース](https://platform.comfy.org/profile/api-keys)でキーを作成し、`COMFY_API_KEY` としてエクスポートします。Python と TypeScript のスニペットは Comfy SDK（`pip install comfy-sdk`、`npm install @comfyorg/sdk`）を使用しています。cURL のスニペットは、同じ呼び出しを生の HTTP で実行するものです。

**モデル ID:** `byteplus/seed-2-0-mini-260215`

**エンドポイント:** `POST https://api.comfy.org/v2/models/byteplus/seed-2-0-mini-260215`

<Tabs>
  <Tab title="Wait for the result">
    <CodeGroup>
      ```python Python theme={null}
      from comfy_sdk import Comfy

      # Reads COMFY_API_KEY from the environment.
      # The SDK automatically creates an idempotency key and reuses it for automatic retries.
      with Comfy() as client:
          result = client.models.run(
              "byteplus/seed-2-0-mini-260215",
              {
                  "input": "Reply with the single word: ok",
              },
          )

      print(result)
      ```

      ```typescript TypeScript theme={null}
      import { comfy } from "@comfyorg/sdk";

      // Reads COMFY_API_KEY from the environment.
      // The SDK automatically creates an idempotency key and reuses it for automatic retries.
      const { data } = await comfy.models.run("byteplus/seed-2-0-mini-260215", {
        input: "Reply with the single word: ok",
      });

      console.log(data);
      ```

      ```bash cURL theme={null}
      curl https://api.comfy.org/v2/models/byteplus/seed-2-0-mini-260215 \
        -H "X-API-Key: $COMFY_API_KEY" \
        -H "Idempotency-Key: $(uuidgen)" \
        -H "Content-Type: application/json" \
        -d "{\"input\": \"Reply with the single word: ok\"}"
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Queue and collect later">
    <CodeGroup>
      ```python Python theme={null}
      from comfy_sdk import Comfy

      # Reads COMFY_API_KEY from the environment.
      # Each submit() call mints its own Idempotency-Key and reuses it for automatic retries.
      with Comfy() as client:
          handle = client.models.submit(
              "byteplus/seed-2-0-mini-260215",
              {
                  "input": "Reply with the single word: ok",
              },
          )
          print("request_id:", handle.request_id)  # with the model ID, all another process needs

          # Poll until the request completes, waiting the Retry-After the server names.
          for update in handle.iter_events():
              print(update.status, update.queue_position)

          # The provider's own payload, the same value models.run() returns.
          # A request that failed or was cancelled raises the typed Router error here.
          result = handle.get()

      print(result)
      ```

      ```typescript TypeScript theme={null}
      import { comfy } from "@comfyorg/sdk";

      // Reads COMFY_API_KEY from the environment.
      // Each submit() call mints its own Idempotency-Key and reuses it for automatic retries.
      const handle = await comfy.models.submit("byteplus/seed-2-0-mini-260215", {
        input: "Reply with the single word: ok",
      });
      console.log("requestId:", handle.requestId); // with the model ID, all another process needs

      // Poll until the request completes, waiting the Retry-After the server names.
      for await (const update of handle.events()) {
        console.log(update.status, update.queuePosition);
      }

      // The same result models.run() returns. A request that failed or was cancelled rejects here.
      const result = await handle.get();

      console.log(result.data);
      ```

      ```bash cURL theme={null}
      # 1. Submit. Router answers 201 with request_id, status_url, response_url and cancel_url.
      curl https://api.comfy.org/v2/models/byteplus/seed-2-0-mini-260215/requests \
        -H "X-API-Key: $COMFY_API_KEY" \
        -H "Idempotency-Key: $(uuidgen)" \
        -H "Content-Type: application/json" \
        -d "{\"input\": \"Reply with the single word: ok\"}"

      # 2. Poll until status is COMPLETED, waiting the Retry-After seconds each response names.
      REQUEST_ID="<request_id from the 201 body>"
      curl -i https://api.comfy.org/v2/models/byteplus/seed-2-0-mini-260215/requests/$REQUEST_ID/status \
        -H "X-API-Key: $COMFY_API_KEY"

      # 3. Collect. 200 with the model's native output, 202 with the status body while it is still running.
      curl https://api.comfy.org/v2/models/byteplus/seed-2-0-mini-260215/requests/$REQUEST_ID \
        -H "X-API-Key: $COMFY_API_KEY"
      ```
    </CodeGroup>
  </Tab>
</Tabs>

## スキーマ

### 入力

<ParamField body="caching" type="object">
  コンテキストキャッシュの設定。
</ParamField>

<ParamField body="caching.prefix" type="boolean" default="false">
  true の場合、公開プレフィックスキャッシュのみを作成し、モデルは応答しません。
</ParamField>

<ParamField body="caching.type" type="string">
  指定可能な値: `enabled`、`disabled`
</ParamField>

<ParamField body="context_management" type="object">
  コンテキストウィンドウを管理しやすい状態に保つために適用されるコンテキスト管理戦略（`clear_thinking`、`clear_tool_uses`）。
</ParamField>

<ParamField body="context_management.edits" type="object[]">
  `type` で判別される単一のコンテキスト編集戦略。
</ParamField>

<ParamField body="expire_at" type="integer">
  保存されたレスポンスとキャッシュが失効する Unix タイムスタンプ（秒、UTC）。範囲は (creation\_time, creation\_time + 604800]。デフォルト: creation\_time + 259200（3日）。
</ParamField>

<ParamField body="include" type="string[]">
  含める追加の出力フィールド。現在サポートされているのは `reasoning.encrypted_content`（手動でのマルチターン再利用のための暗号化および圧縮された reasoning）。
</ParamField>

<ParamField body="input" type="string | object[]" required>
  モデルに提供されるテキストコンテンツ、または入力項目のリスト。
</ParamField>

<ParamField body="instructions" type="string">
  最初の指示として先頭に付加されるシステム/開発者メッセージ。`caching` とは互換性がありません。`caching.type` が `enabled` の場合に `instructions` を設定するとエラーが返されます。
</ParamField>

<ParamField body="max_output_tokens" type="integer">
  出力トークンの最大数（レスポンス + 思考の連鎖）。
</ParamField>

<ParamField body="max_tool_calls" type="integer">
  範囲: `1` から `10`
</ParamField>

<ParamField body="model" type="string">
  モデル ID またはエンドポイント ID。モデル一覧は [https://docs.byteplus.com/en/docs/ModelArk/1330310、エンドポイント](https://docs.byteplus.com/en/docs/ModelArk/1330310、エンドポイント) ID は [https://docs.byteplus.com/en/docs/ModelArk/1099522](https://docs.byteplus.com/en/docs/ModelArk/1099522) を参照してください。POST /proxy/byteplus/api/v3/responses への直接の v1 呼び出しでは、これを必ず指定する必要があります。プロキシは自身の許可リストにない値、および省略された値を 400 で拒否します。Comfy Router の入力スキーマの `required` リストには含まれていません。これは Router が /v2/models/byteplus/\{model} の `{model}` パスセグメントから設定するため、Router の呼び出し元は省略します。
</ParamField>

<ParamField body="previous_response_id" type="string">
  前のレスポンスの ID。マルチターン会話を続けるために使用します。失敗を避けるため、リクエスト間に約100ms を挿入してください。
</ParamField>

<ParamField body="reasoning" type="object">
  深い思考のワークロードを制限します。
</ParamField>

<ParamField body="reasoning.effort" type="string">
  `minimal` は思考を完全に無効にします。`thinking.type =
    disabled` の場合、`minimal` のみが許可されます。

  指定可能な値: `minimal`、`low`、`medium`、`high`
</ParamField>

<ParamField body="store" type="boolean" default="true">
  true の場合、レスポンスは永続化され、マルチターンで使用するために ID で取得できます。
</ParamField>

<ParamField body="temperature" type="number" default="1">
  範囲: `0` から `2`

  形式: `float`
</ParamField>

<ParamField body="text" type="object">
  出力形式の設定。
</ParamField>

<ParamField body="text.format" type="object">
  `type` で判別されるテキスト出力形式。`text` は自然言語を返し、`json_object` は自由形式の JSON オブジェクトを返し、`json_schema` は出力を呼び出し元が提供する JSON Schema に制約します。
</ParamField>

<ParamField body="thinking" type="object">
  深い思考モードを制御します。
</ParamField>

<ParamField body="thinking.type" type="string">
  `enabled`: 応答する前に常に推論します。
  `disabled`: 追加の推論を行わずに応答します。
  `auto`: モデルがクエリごとに判断します。

  指定可能な値: `enabled`、`disabled`、`auto`
</ParamField>

<ParamField body="tool_choice" type="`none`, `auto`, `required` | object">
  ツール選択モード。このフィールドをサポートするのは seed-1-6 モデルのみです。
</ParamField>

<ParamField body="tools" type="object[]">
  モデルが呼び出せるツール。現在サポートされているのは `function` のみです。
</ParamField>

<ParamField body="tools[].description" type="string" />

<ParamField body="tools[].name" type="string" required />

<ParamField body="tools[].parameters" type="object" required>
  関数のパラメータを記述する JSON Schema。
</ParamField>

<ParamField body="tools[].type" type="string" required default="&#x22;function&#x22;">
  指定可能な値: `function`
</ParamField>

<ParamField body="top_p" type="number" default="0.7">
  範囲: `0` から `1`

  形式: `float`
</ParamField>

`GET /v2/models/byteplus/seed-2-0-mini-260215/openapi.json` で Router が提供するスキーマから生成されています。これはリクエストがプロバイダーに到達する前に、Router が呼び出しを検証するのと同じドキュメントです。

### 出力

<ResponseField name="caching" type="object" />

<ResponseField name="caching.prefix" type="boolean" />

<ResponseField name="caching.type" type="string">
  指定可能な値: `enabled`、`disabled`
</ResponseField>

<ResponseField name="context_management" type="object">
  このレスポンス中に実際に適用されたコンテキスト管理戦略。戦略を構成するリクエスト側の `BytePlusResponseContextManagement` とは異なり、こちらはサーバーが呼び出した戦略と、クリアされた内容の件数をそのまま返します。
</ResponseField>

<ResponseField name="context_management.applied_edits" type="object[]">
  適用された 1 件のコンテキスト編集。`type` によって判別されます。
</ResponseField>

<ResponseField name="created_at" type="integer" required>
  レスポンスが作成された Unix タイムスタンプ（秒）。
</ResponseField>

<ResponseField name="error" type="object">
  エラーの詳細。レスポンスが成功した場合は null。
</ResponseField>

<ResponseField name="error.code" type="string" required />

<ResponseField name="error.message" type="string" required />

<ResponseField name="expire_at" type="integer">
  保存されたレスポンスが失効する Unix タイムスタンプ（秒）。
</ResponseField>

<ResponseField name="id" type="string" required>
  レスポンスの一意な ID。会話を続けるには `previous_response_id` として使用します。
</ResponseField>

<ResponseField name="incomplete_details" type="object">
  `status` が `incomplete` の場合に設定されます。
</ResponseField>

<ResponseField name="incomplete_details.reason" type="string">
  例: `max_output_tokens`、`content_filter`。
</ResponseField>

<ResponseField name="instructions" type="string">
  リクエストの `instructions` フィールドのエコー。
</ResponseField>

<ResponseField name="max_output_tokens" type="integer" />

<ResponseField name="max_tool_calls" type="integer" />

<ResponseField name="metadata" type="object" />

<ResponseField name="model" type="string" required>
  レスポンスを生成したモデル ID。
</ResponseField>

<ResponseField name="object" type="string" required default="&#x22;response&#x22;">
  指定可能な値: `response`
</ResponseField>

<ResponseField name="output" type="object[]" required>
  モデルが生成した順序付きの出力項目。
</ResponseField>

<ResponseField name="previous_response_id" type="string" />

<ResponseField name="reasoning" type="object" />

<ResponseField name="reasoning.effort" type="string">
  指定可能な値: `minimal`、`low`、`medium`、`high`
</ResponseField>

<ResponseField name="service_tier" type="string">
  TPM 保証パッケージの使用状況。`default` は使用なしを意味します。

  指定可能な値: `default`
</ResponseField>

<ResponseField name="status" type="string" required>
  指定可能な値: `in_progress`、`completed`、`incomplete`、`failed`、`cancelled`
</ResponseField>

<ResponseField name="store" type="boolean" />

<ResponseField name="stream" type="boolean" />

<ResponseField name="temperature" type="number">
  形式: `float`
</ResponseField>

<ResponseField name="text" type="object">
  リクエストの `text` フィールドのエコー。
</ResponseField>

<ResponseField name="text.format" type="object">
  `type` によって判別されるテキスト出力形式。`text` は自然言語を返し、`json_object` は自由形式の JSON オブジェクトを返し、`json_schema` は呼び出し元が指定した JSON Schema に出力を制約します。
</ResponseField>

<ResponseField name="thinking" type="object" />

<ResponseField name="thinking.type" type="string">
  指定可能な値: `enabled`、`disabled`、`auto`
</ResponseField>

<ResponseField name="tool_choice" type="`none`, `auto`, `required` | object" />

<ResponseField name="tools" type="object[]">
  モデルが呼び出せるツール。現在は `function` のみがサポートされています。
</ResponseField>

<ResponseField name="tools[].description" type="string" />

<ResponseField name="tools[].name" type="string" required />

<ResponseField name="tools[].parameters" type="object" required>
  関数のパラメータを記述する JSON Schema。
</ResponseField>

<ResponseField name="tools[].type" type="string" required default="&#x22;function&#x22;">
  指定可能な値: `function`
</ResponseField>

<ResponseField name="top_p" type="number">
  形式: `float`
</ResponseField>

<ResponseField name="usage" type="object">
  課金と可観測性のためのトークン使用量の内訳。
</ResponseField>

<ResponseField name="usage.input_tokens" type="integer" required>
  リクエスト内の合計トークン数。
</ResponseField>

<ResponseField name="usage.input_tokens_details" type="object">
  入力トークンの内訳（キャッシュヒットなど）。
</ResponseField>

<ResponseField name="usage.input_tokens_details.cached_tokens" type="integer">
  コンテキストキャッシュから提供されたトークン数。
</ResponseField>

<ResponseField name="usage.output_tokens" type="integer" required>
  モデルが生成した合計トークン数。
</ResponseField>

<ResponseField name="usage.output_tokens_details" type="object">
  出力トークンの内訳（推論など）。
</ResponseField>

<ResponseField name="usage.output_tokens_details.reasoning_tokens" type="integer">
  チェーンオブソートで消費されたトークン数。
</ResponseField>

<ResponseField name="usage.tool_usage" type="object">
  ツールごとの呼び出し回数。
</ResponseField>

<ResponseField name="usage.tool_usage.image_process" type="integer">
  画像処理ツールの呼び出し回数。
</ResponseField>

<ResponseField name="usage.tool_usage.mcp" type="integer">
  MCP ツールの呼び出し回数。
</ResponseField>

<ResponseField name="usage.tool_usage.web_search" type="integer">
  Web 検索ツールの呼び出し回数。
</ResponseField>

<ResponseField name="usage.tool_usage_details" type="object">
  サブツール呼び出し回数のツール別内訳。
</ResponseField>

<ResponseField name="usage.tool_usage_details.image_process" type="object">
  例: `{"zoom":1,"point":1,"grounding":1}`。
</ResponseField>

<ResponseField name="usage.tool_usage_details.mcp" type="object">
  例: `{"mcp_server_tos":1,"mcp_server_tls":1}`。
</ResponseField>

<ResponseField name="usage.tool_usage_details.web_search" type="object">
  例: `{"toutiao":1,"moji":1,"search_engine":1}`。
</ResponseField>

<ResponseField name="usage.total_tokens" type="integer" required>
  input\_tokens + output\_tokens。
</ResponseField>

## 例

### 入力

```json theme={null}
{
  "input": "Reply with the single word: ok"
}
```

### 出力

```json theme={null}
{
  "created_at": 1767225600,
  "id": "resp_0a1b2c3d4e5f6a7b8c9d0e1f",
  "model": "seed-2-0-mini-260215",
  "object": "response",
  "output": [
    {
      "content": [
        {
          "annotations": [],
          "text": "ok",
          "type": "output_text"
        }
      ],
      "id": "msg_0a1b2c3d4e5f6a7b8c9d0e1f",
      "role": "assistant",
      "status": "completed",
      "type": "message"
    }
  ],
  "status": "completed",
  "usage": {
    "input_tokens": 14,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens": 2,
    "total_tokens": 16
  }
}
```

## 出荷前の確認

SDK は `Idempotency-Key` を生成し、自動リトライで再利用します。手動リトライでは元のキーを再利用してください。Router は最大 10 分間接続を保持できます。

リクエストが失敗すると、Router は理由を示す `X-Comfy-Error-Type` レスポンスヘッダーを送信します。`422` は、プロバイダーを呼び出す前に Router が入力を拒否したことを意味します。生成されたアセットは [結果 URL の有効期限](/ja/development/comfy-router/reference#結果アセット) があるため、早めにダウンロードしてください。

<CardGroup cols={3}>
  <Card title="ヘッダー" icon="list" href="/ja/development/comfy-router/quickstart">
    認証、冪等性、リクエスト ID、エラー分類、リトライ間隔、支出上限。
  </Card>

  <Card title="Router API の利用" icon="code" href="/ja/development/comfy-router/quickstart">
    モデルの検出、バリデーションエラー、リトライ、課金。
  </Card>

  <Card title="制限事項" icon="triangle-exclamation" href="/ja/development/comfy-router/limitations">
    Router が現在対応していないことと、代替手段。
  </Card>
</CardGroup>
