> ## 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 で Eleven V3 を使用する

> Comfy Router 経由で elevenlabs/eleven_v3 を呼び出します: エンドポイント、リクエスト形状、Router が返すレスポンスについて説明します。

`elevenlabs/eleven_v3` の API リファレンス。Elevenlabs から 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 で行うものです。

**Model ID:** `elevenlabs/eleven_v3`

**Endpoint:** `POST https://api.comfy.org/v2/models/elevenlabs/eleven_v3`

<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(
              "elevenlabs/eleven_v3",
              {
                  "inputs": [
                      {
                          "text": "Hello from Comfy Router.",
                          "voice_id": "21m00Tcm4TlvDq8ikWAM",
                      },
                  ],
              },
          )

      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("elevenlabs/eleven_v3", {
        inputs: [
          {
            text: "Hello from Comfy Router.",
            voice_id: "21m00Tcm4TlvDq8ikWAM",
          },
        ],
      });

      console.log(data);
      ```

      ```bash cURL theme={null}
      curl https://api.comfy.org/v2/models/elevenlabs/eleven_v3 \
        -H "X-API-Key: $COMFY_API_KEY" \
        -H "Idempotency-Key: $(uuidgen)" \
        -H "Content-Type: application/json" \
        -d "{\"inputs\": [{\"text\":\"Hello from Comfy Router.\",\"voice_id\":\"21m00Tcm4TlvDq8ikWAM\"}]}"
      ```
    </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(
              "elevenlabs/eleven_v3",
              {
                  "inputs": [
                      {
                          "text": "Hello from Comfy Router.",
                          "voice_id": "21m00Tcm4TlvDq8ikWAM",
                      },
                  ],
              },
          )
          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("elevenlabs/eleven_v3", {
        inputs: [
          {
            text: "Hello from Comfy Router.",
            voice_id: "21m00Tcm4TlvDq8ikWAM",
          },
        ],
      });
      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/elevenlabs/eleven_v3/requests \
        -H "X-API-Key: $COMFY_API_KEY" \
        -H "Idempotency-Key: $(uuidgen)" \
        -H "Content-Type: application/json" \
        -d "{\"inputs\": [{\"text\":\"Hello from Comfy Router.\",\"voice_id\":\"21m00Tcm4TlvDq8ikWAM\"}]}"

      # 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/elevenlabs/eleven_v3/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/elevenlabs/eleven_v3/requests/$REQUEST_ID \
        -H "X-API-Key: $COMFY_API_KEY"
      ```
    </CodeGroup>
  </Tab>
</Tabs>

## スキーマ

### 入力

<ParamField body="apply_text_normalization" type="string" default="&#x22;auto&#x22;">
  テキスト正規化を 3 つのモードで制御します:
  'auto' - システムがテキスト正規化を適用するかどうかを自動的に判断します
  'on' - テキスト正規化は常に適用されます
  'off' - テキスト正規化はスキップされます

  指定可能な値: `auto`, `on`, `off`
</ParamField>

<ParamField body="inputs" type="object[]" required>
  対話入力のリスト。各入力にはテキストと音声 ID が含まれ、音声に変換されます。
  一意の音声 ID の最大数は 10 です。
</ParamField>

<ParamField body="inputs[].text" type="string" required>
  音声に変換するテキスト。
</ParamField>

<ParamField body="inputs[].voice_id" type="string" required>
  生成に使用する音声の ID。
</ParamField>

<ParamField body="language_code" type="string">
  モデルと言語正規化に対して言語を強制するために使用される言語コード (ISO 639-1)。
  指定された言語コードがモデルでサポートされていない場合、エラーが返されます。
</ParamField>

<ParamField body="model_id" type="string">
  使用されるモデルの識別子。このルートは
  'eleven\_v3' のみを受け付け、それ以外の値はリクエストが ElevenLabs に到達する前に
  400 で拒否されます。
  利用可能なセットを取得するために GET /v1/models を照会するという
  ElevenLabs の上流の推奨は、1 つのモデルを提供するこのルートには
  当てはまりません。
  これはこのスキーマの `required` リストに含まれていません。Comfy Router が
  /v2/models/elevenlabs/\{model} の `{model}` パスセグメントから
  これを埋めるため、Router の呼び出し元は省略します。
</ParamField>

<ParamField body="pronunciation_dictionary_locators" type="object[]">
  テキストに適用する発音辞書ロケーター (id, version\_id) のリスト。
  順番に適用されます。1 リクエストあたり最大 3 つのロケーターを使用できます。
</ParamField>

<ParamField body="pronunciation_dictionary_locators[].pronunciation_dictionary_id" type="string" required>
  発音辞書の ID
</ParamField>

<ParamField body="pronunciation_dictionary_locators[].version_id" type="string" required>
  発音辞書のバージョン ID
</ParamField>

<ParamField body="seed" type="integer">
  指定された場合、システムは決定論的にサンプリングするよう最善を尽くします。
  同じシードとパラメータでリクエストを繰り返すと、同じ結果が返されるはずです。
  0 以上 4294967295 以下の整数である必要があります。

  範囲: `0` から `4294967295`
</ParamField>

<ParamField body="settings" type="object">
  対話生成を制御する設定
</ParamField>

<ParamField body="settings.stability" type="number" default="0.5">
  音声の安定性と、各生成間のランダム性を決定します。
  低い値では音声の感情の幅が広がります。
  高い値では、感情が限られた単調な音声になることがあります。

  形式: `double`
</ParamField>

これは Router が `GET /v2/models/elevenlabs/eleven_v3/openapi.json` で提供するスキーマから生成されたもので、リクエストがプロバイダーに到達する前に呼び出しを検証する対象となる同一のドキュメントです。

### 出力

<ResponseField name="*/*" type="string (binary)">
  生のオーディオバイト列。Content-Type とエンコーディングは要求された output\_format に従い、ElevenLabs からそのまま転送されます。例はバイナリ本文のプレースホルダーであり、JSON や base64 ではありません。
</ResponseField>

### 出力

Router はこのモデルの出力スキーマを公開していません。

## 例

### 入力

```json theme={null}
{
  "inputs": [
    {
      "text": "Hello from Comfy Router.",
      "voice_id": "21m00Tcm4TlvDq8ikWAM"
    }
  ]
}
```

## 出荷前の確認

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>
