> ## 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 Audio 1.0 Multilingual を使用する

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

`byteplus/seed-audio-1.0-multilingual` の API リファレンスです。Comfy Router が BytePlus から提供します。

## クイックスタート

[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-audio-1.0-multilingual`

**エンドポイント:** `POST https://api.comfy.org/v2/models/byteplus/seed-audio-1.0-multilingual`

<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-audio-1.0-multilingual",
              {
                  "audio_config": {
                      "format": "wav",
                      "sample_rate": 24000,
                  },
                  "text_prompt": "Hello from Comfy Router.",
              },
          )

      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-audio-1.0-multilingual", {
        audio_config: {
          format: "wav",
          sample_rate: 24000,
        },
        text_prompt: "Hello from Comfy Router.",
      });

      console.log(data);
      ```

      ```bash cURL theme={null}
      curl https://api.comfy.org/v2/models/byteplus/seed-audio-1.0-multilingual \
        -H "X-API-Key: $COMFY_API_KEY" \
        -H "Idempotency-Key: $(uuidgen)" \
        -H "Content-Type: application/json" \
        -d "{\"audio_config\": {\"format\":\"wav\",\"sample_rate\":24000}, \"text_prompt\": \"Hello from Comfy Router.\"}"
      ```
    </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-audio-1.0-multilingual",
              {
                  "audio_config": {
                      "format": "wav",
                      "sample_rate": 24000,
                  },
                  "text_prompt": "Hello from Comfy Router.",
              },
          )
          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-audio-1.0-multilingual", {
        audio_config: {
          format: "wav",
          sample_rate: 24000,
        },
        text_prompt: "Hello from Comfy Router.",
      });
      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-audio-1.0-multilingual/requests \
        -H "X-API-Key: $COMFY_API_KEY" \
        -H "Idempotency-Key: $(uuidgen)" \
        -H "Content-Type: application/json" \
        -d "{\"audio_config\": {\"format\":\"wav\",\"sample_rate\":24000}, \"text_prompt\": \"Hello from Comfy Router.\"}"

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

## スキーマ

### 入力

<ParamField body="audio_config" type="object">
  出力オーディオの設定。
</ParamField>

<ParamField body="audio_config.enable_subtitle" type="boolean">
  字幕サービスを有効にするかどうか。有効にすると、レスポンスに発話単位および単語単位のタイムスタンプが含まれます（デフォルト: false）。
</ParamField>

<ParamField body="audio_config.format" type="string">
  出力オーディオ形式: wav（デフォルト）、mp3、pcm、または ogg\_opus。

  指定可能な値: `wav`、`mp3`、`pcm`、`ogg_opus`
</ParamField>

<ParamField body="audio_config.loudness_rate" type="integer">
  -50 から 100。100 は 2.0 倍の音量、-50 は 0.5 倍の音量を意味します（デフォルト: 0）。

  範囲: `-50` から `100`
</ParamField>

<ParamField body="audio_config.pitch_rate" type="integer">
  -12 から 12（デフォルト: 0）。

  範囲: `-12` から `12`
</ParamField>

<ParamField body="audio_config.sample_rate" type="integer">
  出力サンプルレート: 8000、16000、24000（デフォルト）、32000、44100、または 48000。

  指定可能な値: `8000`、`16000`、`24000`、`32000`、`44100`、`48000`
</ParamField>

<ParamField body="audio_config.speech_rate" type="integer">
  -50 から 100。100 は 2.0 倍の速度、-50 は 0.5 倍の速度を意味します（デフォルト: 0）。

  範囲: `-50` から `100`
</ParamField>

<ParamField body="model" type="string">
  モデル識別子。対応モデル: seed-audio-1.0 および seed-audio-1.0-multilingual。POST /proxy/byteplus/api/v3/tts/create への直接の v1 呼び出しでは必ずこれを指定する必要があります。プロキシはそれ以外の値や省略された値を 400 で拒否します。これがこのスキーマの `required` リストに含まれていないのは、Comfy Router が /v2/models/byteplus/\{model} の `{model}` パスセグメントからこれを設定するためであり、Router の呼び出し元は省略します。
</ParamField>

<ParamField body="references" type="object[]">
  参照リソース。テキストのみの生成では省略します。最大 3 つのオーディオ参照（それぞれ最大 30 秒、デコード後 10 MB。wav、mp3、pcm、または ogg\_opus）、または正確に 1 つの画像参照（デコード後最大 10 MB。jpeg、png、または webp）。画像参照とオーディオ参照は混在できません。これらの上限は BytePlus によるもので、デコード後のバイト数で示されています。base64 はアセットを約 4/3 に膨張させ、Comfy Router の呼び出しは JSON ドキュメント全体で 10 MiB に制限されるため、/v2/models/byteplus/\{model} に送信するインラインの `audio_data`/`image_data` 参照は、デコード後でおよそ 7.5 MB 未満に抑える必要があります。それより大きいものには `audio_url`/`image_url` を使用してください。インライン化された場合、BytePlus 自身の 10 MB 上限に達する参照は、検証が実行される前に 413 で拒否されます。
</ParamField>

<ParamField body="references[].audio_data" type="string">
  Base64 エンコードされた参照オーディオ。
</ParamField>

<ParamField body="references[].audio_url" type="string">
  リモート参照オーディオファイルの URL。
</ParamField>

<ParamField body="references[].image_data" type="string">
  Base64 エンコードされた参照画像。
</ParamField>

<ParamField body="references[].image_url" type="string">
  リモート参照画像の URL。
</ParamField>

<ParamField body="references[].speaker" type="string">
  ボイス ID。対応する Doubao TTS ボイス、またはボイスクローン ID を指定できます。
</ParamField>

<ParamField body="text_prompt" type="string" required>
  合成するプロンプトまたはテキスト（1 ～ 3,000 文字。空文字列は拒否されます）。オーディオ参照を指定した場合は、@Audio1、@Audio2、@Audio3 を使って順番に参照します。
</ParamField>

<ParamField body="watermark" type="object">
  ウォーターマーク設定オブジェクト。空のオブジェクトも受け付けられます。
</ParamField>

<ParamField body="watermark.aigc_metadata" type="object">
  暗黙的なウォーターマーク。合成されたオーディオのヘッダーにメタデータを追加します。
</ParamField>

<ParamField body="watermark.aigc_metadata.content_producer" type="string">
  合成サービスプロバイダーの名前またはコード。
</ParamField>

<ParamField body="watermark.aigc_metadata.content_propagator" type="string">
  コンテンツ配信サービスプロバイダーの名前またはコード。
</ParamField>

<ParamField body="watermark.aigc_metadata.enable" type="boolean">
  暗黙的なウォーターマークを有効にするかどうか（デフォルト: false）。
</ParamField>

<ParamField body="watermark.aigc_metadata.produce_id" type="string">
  コンテンツ制作 ID。
</ParamField>

<ParamField body="watermark.aigc_metadata.propagate_id" type="string">
  コンテンツ配信 ID。
</ParamField>

<ParamField body="watermark.aigc_watermark" type="boolean">
  明示的なウォーターマークの切り替え。合成されたオーディオの末尾にオーディオリズムマーカーを追加します（デフォルト: false）。
</ParamField>

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

### 出力

<ResponseField name="audio" type="string">
  生成済みのオーディオデータ。Base64 でエンコードされています。
</ResponseField>

<ResponseField name="code" type="integer">
  ステータスコード。詳細は公式のエラーコードドキュメントを参照してください。
</ResponseField>

<ResponseField name="duration" type="number">
  速度変更または後処理後の再生時間（秒）。

  フォーマット: `double`
</ResponseField>

<ResponseField name="message" type="string">
  ステータスの詳細。
</ResponseField>

<ResponseField name="original_duration" type="number">
  モデルが元々出力した再生時間（秒）。課金に使用され、上限は 120 秒です。

  フォーマット: `double`
</ResponseField>

<ResponseField name="subtitle" type="object">
  オーディオの字幕情報。リクエストで audio\_config.enable\_subtitle が true に設定されている場合にのみ含まれます。
</ResponseField>

<ResponseField name="subtitle.sentences" type="object[]">
  発話単位の字幕情報。
</ResponseField>

<ResponseField name="subtitle.sentences[].end_time" type="integer">
  セグメントの終了時間。オーディオの先頭からのミリ秒単位。
</ResponseField>

<ResponseField name="subtitle.sentences[].start_time" type="integer">
  セグメントの開始時間。オーディオの先頭からのミリ秒単位。
</ResponseField>

<ResponseField name="subtitle.sentences[].text" type="string">
  セグメントの完全なテキスト。
</ResponseField>

<ResponseField name="subtitle.text" type="string">
  オーディオに対応する字幕テキスト。
</ResponseField>

<ResponseField name="subtitle.words" type="object[]">
  単語単位の字幕情報。
</ResponseField>

<ResponseField name="subtitle.words[].end_time" type="integer">
  セグメントの終了時間。オーディオの先頭からのミリ秒単位。
</ResponseField>

<ResponseField name="subtitle.words[].start_time" type="integer">
  セグメントの開始時間。オーディオの先頭からのミリ秒単位。
</ResponseField>

<ResponseField name="subtitle.words[].text" type="string">
  セグメントの完全なテキスト。
</ResponseField>

<ResponseField name="url" type="string">
  一時的なオーディオ URL。2 時間有効です。
</ResponseField>

## 例

### 入力

```json theme={null}
{
  "audio_config": {
    "format": "wav",
    "sample_rate": 24000
  },
  "text_prompt": "Hello from Comfy Router."
}
```

### 出力

```json theme={null}
{
  "audio": "PGJhc2U2ND4=",
  "duration": 1.2,
  "original_duration": 1.2,
  "url": "https://example.invalid/byteplus/seed-audio/generated.wav"
}
```

## 出荷前の確認

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>
