> ## 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 で Google Gemini を使用する

> Comfy Router 経由で HTTP を使って Google Gemini のテキストモデルを呼び出すための Python、TypeScript、cURL スニペット、およびリクエストフィールドと結果の形状

Google Gemini の API リファレンス。Google Gemini は Google のマルチモーダルテキストモデル群で、Flash および Pro の各ティアにわたり、高速なドラフト作成から深い推論までをカバーします。

## クイックスタート

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

呼び出したいモデルを選択してください。モデルは 1 つのリクエストとレスポンスの形状を共有しており、以下で一度だけ説明します。

<Tabs>
  <Tab title="Gemini 3.1 Pro">
    **モデル ID:** `vertexai/gemini-3.1-pro-preview`

    **エンドポイント:** `POST https://api.comfy.org/v2/models/vertexai/gemini-3.1-pro-preview`

    <Tabs>
      <Tab title="結果を待つ">
        <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(
                  "vertexai/gemini-3.1-pro-preview",
                  {
                      "contents": [
                          {
                              "role": "user",
                              "parts": [
                                  {
                                      "text": "Describe a single red maple leaf on a white background in one sentence.",
                                  },
                              ],
                          },
                      ],
                      "generationConfig": {
                          "temperature": 0.7,
                          "maxOutputTokens": 256,
                      },
                  },
              )

          print("text:", result["candidates"][0]["content"]["parts"][0]["text"])
          ```

          ```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.
          type Result = { candidates: { content: { parts: { text: string }[] } }[] };
          const { data } = await comfy.models.run<Result>("vertexai/gemini-3.1-pro-preview", {
            contents: [
              {
                role: "user",
                parts: [
                  {
                    text: "Describe a single red maple leaf on a white background in one sentence.",
                  },
                ],
              },
            ],
            generationConfig: {
              temperature: 0.7,
              maxOutputTokens: 256,
            },
          });

          console.log("text:", data.candidates[0].content.parts[0].text);
          ```

          ```bash cURL theme={null}
          curl https://api.comfy.org/v2/models/vertexai/gemini-3.1-pro-preview \
            -H "X-API-Key: $COMFY_API_KEY" \
            -H "Idempotency-Key: $(uuidgen)" \
            -H "Content-Type: application/json" \
            -d "{\"contents\": [{\"role\":\"user\",\"parts\":[{\"text\":\"Describe a single red maple leaf on a white background in one sentence.\"}]}], \"generationConfig\": {\"temperature\":0.7,\"maxOutputTokens\":256}}"
          ```
        </CodeGroup>
      </Tab>

      <Tab title="キューに送信して後で収集する">
        同じ本文を `POST https://api.comfy.org/v2/models/vertexai/gemini-3.1-pro-preview/requests` に送信します。Router は実行が受け付けられるとすぐに `201` と `request_id` を返し、結果は準備が整い次第、このプロセスからでも別のプロセスからでも収集できます。[キュー配信](/ja/development/comfy-router/queue)では、ステータス、キャンセル、収集について順を追って説明します。

        <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(
                  "vertexai/gemini-3.1-pro-preview",
                  {
                      "contents": [
                          {
                              "role": "user",
                              "parts": [
                                  {
                                      "text": "Describe a single red maple leaf on a white background in one sentence.",
                                  },
                              ],
                          },
                      ],
                      "generationConfig": {
                          "temperature": 0.7,
                          "maxOutputTokens": 256,
                      },
                  },
              )
              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("text:", result["candidates"][0]["content"]["parts"][0]["text"])
          ```

          ```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.
          type Result = { candidates: { content: { parts: { text: string }[] } }[] };
          const handle = await comfy.models.submit<Result>("vertexai/gemini-3.1-pro-preview", {
            contents: [
              {
                role: "user",
                parts: [
                  {
                    text: "Describe a single red maple leaf on a white background in one sentence.",
                  },
                ],
              },
            ],
            generationConfig: {
              temperature: 0.7,
              maxOutputTokens: 256,
            },
          });
          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();
          if (result.kind !== "json") throw new Error("expected a JSON result");

          console.log("text:", result.data.candidates[0].content.parts[0].text);
          ```

          ```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/vertexai/gemini-3.1-pro-preview/requests \
            -H "X-API-Key: $COMFY_API_KEY" \
            -H "Idempotency-Key: $(uuidgen)" \
            -H "Content-Type: application/json" \
            -d "{\"contents\": [{\"role\":\"user\",\"parts\":[{\"text\":\"Describe a single red maple leaf on a white background in one sentence.\"}]}], \"generationConfig\": {\"temperature\":0.7,\"maxOutputTokens\":256}}"

          # 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/vertexai/gemini-3.1-pro-preview/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/vertexai/gemini-3.1-pro-preview/requests/$REQUEST_ID \
            -H "X-API-Key: $COMFY_API_KEY"
          ```
        </CodeGroup>
      </Tab>
    </Tabs>
  </Tab>

  <Tab title="Gemini 3.5 Flash">
    **モデル ID:** `vertexai/gemini-3.5-flash`

    **エンドポイント:** `POST https://api.comfy.org/v2/models/vertexai/gemini-3.5-flash`

    <Tabs>
      <Tab title="結果を待つ">
        <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(
                  "vertexai/gemini-3.5-flash",
                  {
                      "contents": [
                          {
                              "role": "user",
                              "parts": [
                                  {
                                      "text": "Describe a single red maple leaf on a white background in one sentence.",
                                  },
                              ],
                          },
                      ],
                      "generationConfig": {
                          "temperature": 0.7,
                          "maxOutputTokens": 256,
                      },
                  },
              )

          print("text:", result["candidates"][0]["content"]["parts"][0]["text"])
          ```

          ```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.
          type Result = { candidates: { content: { parts: { text: string }[] } }[] };
          const { data } = await comfy.models.run<Result>("vertexai/gemini-3.5-flash", {
            contents: [
              {
                role: "user",
                parts: [
                  {
                    text: "Describe a single red maple leaf on a white background in one sentence.",
                  },
                ],
              },
            ],
            generationConfig: {
              temperature: 0.7,
              maxOutputTokens: 256,
            },
          });

          console.log("text:", data.candidates[0].content.parts[0].text);
          ```

          ```bash cURL theme={null}
          curl https://api.comfy.org/v2/models/vertexai/gemini-3.5-flash \
            -H "X-API-Key: $COMFY_API_KEY" \
            -H "Idempotency-Key: $(uuidgen)" \
            -H "Content-Type: application/json" \
            -d "{\"contents\": [{\"role\":\"user\",\"parts\":[{\"text\":\"Describe a single red maple leaf on a white background in one sentence.\"}]}], \"generationConfig\": {\"temperature\":0.7,\"maxOutputTokens\":256}}"
          ```
        </CodeGroup>
      </Tab>

      <Tab title="キューに送信して後で収集する">
        同じ本文を `POST https://api.comfy.org/v2/models/vertexai/gemini-3.5-flash/requests` に送信します。Router は実行が受け付けられるとすぐに `201` と `request_id` を返し、結果は準備が整い次第、このプロセスからでも別のプロセスからでも収集できます。[キュー配信](/ja/development/comfy-router/queue)では、ステータス、キャンセル、収集について順を追って説明します。

        <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(
                  "vertexai/gemini-3.5-flash",
                  {
                      "contents": [
                          {
                              "role": "user",
                              "parts": [
                                  {
                                      "text": "Describe a single red maple leaf on a white background in one sentence.",
                                  },
                              ],
                          },
                      ],
                      "generationConfig": {
                          "temperature": 0.7,
                          "maxOutputTokens": 256,
                      },
                  },
              )
              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("text:", result["candidates"][0]["content"]["parts"][0]["text"])
          ```

          ```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.
          type Result = { candidates: { content: { parts: { text: string }[] } }[] };
          const handle = await comfy.models.submit<Result>("vertexai/gemini-3.5-flash", {
            contents: [
              {
                role: "user",
                parts: [
                  {
                    text: "Describe a single red maple leaf on a white background in one sentence.",
                  },
                ],
              },
            ],
            generationConfig: {
              temperature: 0.7,
              maxOutputTokens: 256,
            },
          });
          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();
          if (result.kind !== "json") throw new Error("expected a JSON result");

          console.log("text:", result.data.candidates[0].content.parts[0].text);
          ```

          ```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/vertexai/gemini-3.5-flash/requests \
            -H "X-API-Key: $COMFY_API_KEY" \
            -H "Idempotency-Key: $(uuidgen)" \
            -H "Content-Type: application/json" \
            -d "{\"contents\": [{\"role\":\"user\",\"parts\":[{\"text\":\"Describe a single red maple leaf on a white background in one sentence.\"}]}], \"generationConfig\": {\"temperature\":0.7,\"maxOutputTokens\":256}}"

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

  <Tab title="Gemini 2.5 Pro">
    **モデル ID:** `vertexai/gemini-2.5-pro`

    **エンドポイント:** `POST https://api.comfy.org/v2/models/vertexai/gemini-2.5-pro`

    <Tabs>
      <Tab title="結果を待つ">
        <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(
                  "vertexai/gemini-2.5-pro",
                  {
                      "contents": [
                          {
                              "role": "user",
                              "parts": [
                                  {
                                      "text": "Describe a single red maple leaf on a white background in one sentence.",
                                  },
                              ],
                          },
                      ],
                      "generationConfig": {
                          "temperature": 0.7,
                          "maxOutputTokens": 256,
                      },
                  },
              )

          print("text:", result["candidates"][0]["content"]["parts"][0]["text"])
          ```

          ```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.
          type Result = { candidates: { content: { parts: { text: string }[] } }[] };
          const { data } = await comfy.models.run<Result>("vertexai/gemini-2.5-pro", {
            contents: [
              {
                role: "user",
                parts: [
                  {
                    text: "Describe a single red maple leaf on a white background in one sentence.",
                  },
                ],
              },
            ],
            generationConfig: {
              temperature: 0.7,
              maxOutputTokens: 256,
            },
          });

          console.log("text:", data.candidates[0].content.parts[0].text);
          ```

          ```bash cURL theme={null}
          curl https://api.comfy.org/v2/models/vertexai/gemini-2.5-pro \
            -H "X-API-Key: $COMFY_API_KEY" \
            -H "Idempotency-Key: $(uuidgen)" \
            -H "Content-Type: application/json" \
            -d "{\"contents\": [{\"role\":\"user\",\"parts\":[{\"text\":\"Describe a single red maple leaf on a white background in one sentence.\"}]}], \"generationConfig\": {\"temperature\":0.7,\"maxOutputTokens\":256}}"
          ```
        </CodeGroup>
      </Tab>

      <Tab title="キューに送信して後で収集する">
        同じ本文を `POST https://api.comfy.org/v2/models/vertexai/gemini-2.5-pro/requests` に送信します。Router は実行が受け付けられるとすぐに `201` と `request_id` を返し、結果は準備が整い次第、このプロセスからでも別のプロセスからでも収集できます。[キュー配信](/ja/development/comfy-router/queue)では、ステータス、キャンセル、収集について順を追って説明します。

        <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(
                  "vertexai/gemini-2.5-pro",
                  {
                      "contents": [
                          {
                              "role": "user",
                              "parts": [
                                  {
                                      "text": "Describe a single red maple leaf on a white background in one sentence.",
                                  },
                              ],
                          },
                      ],
                      "generationConfig": {
                          "temperature": 0.7,
                          "maxOutputTokens": 256,
                      },
                  },
              )
              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("text:", result["candidates"][0]["content"]["parts"][0]["text"])
          ```

          ```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.
          type Result = { candidates: { content: { parts: { text: string }[] } }[] };
          const handle = await comfy.models.submit<Result>("vertexai/gemini-2.5-pro", {
            contents: [
              {
                role: "user",
                parts: [
                  {
                    text: "Describe a single red maple leaf on a white background in one sentence.",
                  },
                ],
              },
            ],
            generationConfig: {
              temperature: 0.7,
              maxOutputTokens: 256,
            },
          });
          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();
          if (result.kind !== "json") throw new Error("expected a JSON result");

          console.log("text:", result.data.candidates[0].content.parts[0].text);
          ```

          ```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/vertexai/gemini-2.5-pro/requests \
            -H "X-API-Key: $COMFY_API_KEY" \
            -H "Idempotency-Key: $(uuidgen)" \
            -H "Content-Type: application/json" \
            -d "{\"contents\": [{\"role\":\"user\",\"parts\":[{\"text\":\"Describe a single red maple leaf on a white background in one sentence.\"}]}], \"generationConfig\": {\"temperature\":0.7,\"maxOutputTokens\":256}}"

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

  <Tab title="Gemini 2.5 Flash">
    **モデルID:** `vertexai/gemini-2.5-flash`

    **エンドポイント:** `POST https://api.comfy.org/v2/models/vertexai/gemini-2.5-flash`

    <Tabs>
      <Tab title="結果を待つ">
        <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(
                  "vertexai/gemini-2.5-flash",
                  {
                      "contents": [
                          {
                              "role": "user",
                              "parts": [
                                  {
                                      "text": "Describe a single red maple leaf on a white background in one sentence.",
                                  },
                              ],
                          },
                      ],
                      "generationConfig": {
                          "temperature": 0.7,
                          "maxOutputTokens": 256,
                      },
                  },
              )

          print("text:", result["candidates"][0]["content"]["parts"][0]["text"])
          ```

          ```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.
          type Result = { candidates: { content: { parts: { text: string }[] } }[] };
          const { data } = await comfy.models.run<Result>("vertexai/gemini-2.5-flash", {
            contents: [
              {
                role: "user",
                parts: [
                  {
                    text: "Describe a single red maple leaf on a white background in one sentence.",
                  },
                ],
              },
            ],
            generationConfig: {
              temperature: 0.7,
              maxOutputTokens: 256,
            },
          });

          console.log("text:", data.candidates[0].content.parts[0].text);
          ```

          ```bash cURL theme={null}
          curl https://api.comfy.org/v2/models/vertexai/gemini-2.5-flash \
            -H "X-API-Key: $COMFY_API_KEY" \
            -H "Idempotency-Key: $(uuidgen)" \
            -H "Content-Type: application/json" \
            -d "{\"contents\": [{\"role\":\"user\",\"parts\":[{\"text\":\"Describe a single red maple leaf on a white background in one sentence.\"}]}], \"generationConfig\": {\"temperature\":0.7,\"maxOutputTokens\":256}}"
          ```
        </CodeGroup>
      </Tab>

      <Tab title="キューに送信して後で収集する">
        同じ本文を `POST https://api.comfy.org/v2/models/vertexai/gemini-2.5-flash/requests` に送信します。Router は実行が受け付けられるとすぐに `201` と `request_id` を返し、結果は準備が整い次第、このプロセスからでも別のプロセスからでも収集できます。[キュー配信](/ja/development/comfy-router/queue)では、ステータス、キャンセル、収集について順を追って説明します。

        <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(
                  "vertexai/gemini-2.5-flash",
                  {
                      "contents": [
                          {
                              "role": "user",
                              "parts": [
                                  {
                                      "text": "Describe a single red maple leaf on a white background in one sentence.",
                                  },
                              ],
                          },
                      ],
                      "generationConfig": {
                          "temperature": 0.7,
                          "maxOutputTokens": 256,
                      },
                  },
              )
              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("text:", result["candidates"][0]["content"]["parts"][0]["text"])
          ```

          ```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.
          type Result = { candidates: { content: { parts: { text: string }[] } }[] };
          const handle = await comfy.models.submit<Result>("vertexai/gemini-2.5-flash", {
            contents: [
              {
                role: "user",
                parts: [
                  {
                    text: "Describe a single red maple leaf on a white background in one sentence.",
                  },
                ],
              },
            ],
            generationConfig: {
              temperature: 0.7,
              maxOutputTokens: 256,
            },
          });
          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();
          if (result.kind !== "json") throw new Error("expected a JSON result");

          console.log("text:", result.data.candidates[0].content.parts[0].text);
          ```

          ```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/vertexai/gemini-2.5-flash/requests \
            -H "X-API-Key: $COMFY_API_KEY" \
            -H "Idempotency-Key: $(uuidgen)" \
            -H "Content-Type: application/json" \
            -d "{\"contents\": [{\"role\":\"user\",\"parts\":[{\"text\":\"Describe a single red maple leaf on a white background in one sentence.\"}]}], \"generationConfig\": {\"temperature\":0.7,\"maxOutputTokens\":256}}"

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

## スキーマ

### 入力

<ParamField body="contents" type="object[]" required>
  モデルとの現在の会話のコンテンツ。単一ターンのクエリでは単一のインスタンスになります。マルチターンのクエリでは、会話履歴と最新のリクエストを含む繰り返しフィールドになります。
</ParamField>

<ParamField body="contents[].parts" type="object[]" required />

<ParamField body="contents[].parts[].fileData" type="object">
  URI ベースのデータ。
</ParamField>

<ParamField body="contents[].parts[].fileData.fileUri" type="string">
  URI
</ParamField>

<ParamField body="contents[].parts[].fileData.mimeType" type="string">
  data フィールドまたは fileUri フィールドで指定されたファイルのメディアタイプ。許容される値は以下のとおりです。gemini-2.0-flash-lite および gemini-2.0-flash では、オーディオファイルの最大長は 8.4 時間、ビデオファイル（音声なし）の最大長は 1 時間です。詳細については、Gemini のオーディオとビデオの要件を参照してください。テキストファイルは UTF-8 でエンコードされている必要があります。テキストファイルのコンテンツはトークン制限にカウントされます。画像の解像度には制限がありません。

  指定可能な値: `application/pdf`、`audio/mpeg`、`audio/mp3`、`audio/wav`、`image/png`、`image/jpeg`、`image/webp`、`text/plain`、`video/mov`、`video/mpeg`、`video/mp4`、`video/mpg`、`video/avi`、`video/wmv`、`video/mpegps`、`video/flv`、`image/heic`、`image/heif`、`audio/flac`、`video/webm`
</ParamField>

<ParamField body="contents[].parts[].inlineData" type="object">
  生のバイトによるインラインデータ。gemini-2.0-flash-lite および gemini-2.0-flash では、inlineData を使用して最大 3000 枚の画像を指定できます。
</ParamField>

<ParamField body="contents[].parts[].inlineData.data" type="string (byte)">
  プロンプトにインラインで含める画像、PDF、またはビデオの base64 エンコーディング。メディアをインラインで含める場合は、データのメディアタイプ（mimeType）も指定する必要があります。サイズ制限: 20MB

  形式: `byte`
</ParamField>

<ParamField body="contents[].parts[].inlineData.mimeType" type="string">
  data フィールドまたは fileUri フィールドで指定されたファイルのメディアタイプ。許容される値は以下のとおりです。gemini-2.0-flash-lite および gemini-2.0-flash では、オーディオファイルの最大長は 8.4 時間、ビデオファイル（音声なし）の最大長は 1 時間です。詳細については、Gemini のオーディオとビデオの要件を参照してください。テキストファイルは UTF-8 でエンコードされている必要があります。テキストファイルのコンテンツはトークン制限にカウントされます。画像の解像度には制限がありません。

  指定可能な値: `application/pdf`、`audio/mpeg`、`audio/mp3`、`audio/wav`、`image/png`、`image/jpeg`、`image/webp`、`text/plain`、`video/mov`、`video/mpeg`、`video/mp4`、`video/mpg`、`video/avi`、`video/wmv`、`video/mpegps`、`video/flv`、`image/heic`、`image/heif`、`audio/flac`、`video/webm`
</ParamField>

<ParamField body="contents[].parts[].mediaProcessing" type="string">
  モデルがこのパートの動画をどのように読み取るか。"AGENTIC" を設定すると、固定レートのフレームサンプリングの代わりに、モデルが検査するセグメントを決定できるようになります。デフォルトの固定レートサンプリングでは省略します。gemini-3.7-flash 以降の Flash モデルでサポートされています。
</ParamField>

<ParamField body="contents[].parts[].text" type="string">
  テキストプロンプトまたはコードスニペット。
</ParamField>

<ParamField body="contents[].parts[].thought" type="boolean">
  このパートがモデルからの思考/推論ステップであることを示します。
</ParamField>

<ParamField body="contents[].role" type="string">
  指定可能な値: `user`、`model`
</ParamField>

<ParamField body="generationConfig" type="object">
  生成のためのサンプリング、長さ、出力の設定。すべてのフィールドは任意です。以下で `default` を宣言しているフィールドは省略時にその値が適用され、それ以外はモデル自身の動作にフォールバックします。
</ParamField>

<ParamField body="generationConfig.imageConfig" type="object">
  画像生成の設定
</ParamField>

<ParamField body="generationConfig.imageConfig.aspectRatio" type="string">
  生成画像のアスペクト比
</ParamField>

<ParamField body="generationConfig.imageConfig.imageOutputOptions" type="object">
  任意。生成画像の画像出力形式。
</ParamField>

<ParamField body="generationConfig.imageConfig.imageOutputOptions.compressionQuality" type="integer">
  任意。出力画像の圧縮品質。
</ParamField>

<ParamField body="generationConfig.imageConfig.imageOutputOptions.mimeType" type="string">
  任意。出力を保存する画像形式。
</ParamField>

<ParamField body="generationConfig.imageConfig.imageSize" type="string">
  任意。生成画像のサイズを指定します。サポートされる値は 1K、2K、4K です。指定しない場合、モデルはデフォルト値の 1K を使用します。
</ParamField>

<ParamField body="generationConfig.maxOutputTokens" type="integer">
  レスポンスで生成できるトークンの最大数。トークンは約 4 文字です。100 トークンはおよそ 60～80 語に相当します。

  範囲: `16` ～ `65536`
</ParamField>

<ParamField body="generationConfig.responseModalities" type="`TEXT`, `IMAGE`[]" />

<ParamField body="generationConfig.seed" type="integer">
  seed を特定の値に固定すると、モデルは繰り返しのリクエストに対して同じレスポンスを返すよう最善を尽くします。決定論的な出力は保証されません。また、モデルや temperature などのパラメータ設定を変更すると、同じ seed 値を使用してもレスポンスにばらつきが生じることがあります。デフォルトでは、ランダムな seed 値が使用されます。次のモデルで利用可能です: gemini-2.5-flash、gemini-2.5-pro、gemini-2.5-flash-preview-04-1、gemini-2.5-pro-preview-05-0、gemini-2.0-flash-lite-00、gemini-2.0-flash-001
</ParamField>

<ParamField body="generationConfig.stopSequences" type="string[]" />

<ParamField body="generationConfig.temperature" type="number" default="1">
  temperature はレスポンス生成中のサンプリングに使用され、これは topP と topK が適用されるときに発生します。temperature はトークン選択におけるランダム性の度合いを制御します。低い temperature は、あまり自由度の高くない回答や創造性を必要としないプロンプトに適しており、高い temperature はより多様で創造的な結果をもたらす可能性があります。temperature が 0 の場合、常に最も確率の高いトークンが選択されます。この場合、特定のプロンプトに対するレスポンスはほぼ決定的になりますが、わずかなばらつきが生じる可能性は残ります。モデルが一般的すぎる回答、短すぎる回答を返す場合、またはフォールバック応答を返す場合は、temperature を上げてみてください。

  範囲: `0` ～ `2`

  形式: `float`
</ParamField>

<ParamField body="generationConfig.thinkingConfig" type="object">
  任意。thinking 機能の設定です。thinking とは、モデルが複雑なタスクをより小さなステップに分解して、より高品質なレスポンスを生成するプロセスです。
</ParamField>

<ParamField body="generationConfig.thinkingConfig.includeThoughts" type="boolean">
  任意。true の場合、モデルはレスポンスに自身の思考を含めます。
</ParamField>

<ParamField body="generationConfig.thinkingConfig.thinkingBudget" type="integer">
  任意。モデルの thinking プロセスに割り当てるトークン予算です。モデルはこの予算内に収まるよう最善を尽くします。
</ParamField>

<ParamField body="generationConfig.thinkingConfig.thinkingLevel" type="string">
  任意。モデルの thinking レベルです。

  指定可能な値: `THINKING_LEVEL_UNSPECIFIED`、`LOW`、`MEDIUM`、`HIGH`、`MINIMAL`
</ParamField>

<ParamField body="generationConfig.topK" type="integer" default="40">
  Top-K は、モデルが出力するトークンを選択する方法を変更します。Top-K が 1 の場合、次に選択されるトークンはモデルの語彙全体の中で最も確率の高いものになります。Top-K が 3 の場合、次のトークンは最も確率の高い 3 つのトークンの中から temperature を用いて選択されます。

  範囲: `1` ～ `…`
</ParamField>

<ParamField body="generationConfig.topP" type="number" default="0.95">
  指定した場合、nucleus サンプリングが使用されます。
  Top-P は、モデルが出力するトークンを選択する方法を変更します。トークンは確率の高いもの（top-K を参照）から低いものへと、その確率の合計が top-P の値に等しくなるまで選択されます。たとえば、トークン A、B、C の確率がそれぞれ 0.3、0.2、0.1 で、top-P の値が 0.5 の場合、モデルは temperature を用いて A または B のいずれかを次のトークンとして選択し、C は候補から除外されます。
  ランダム性の低いレスポンスには低い値を、ランダム性の高いレスポンスには高い値を指定してください。

  範囲: `0` ～ `1`

  形式: `float`
</ParamField>

<ParamField body="safetySettings" type="object[]">
  安全でないコンテンツをブロックするためのリクエストごとの設定です。GenerateContentResponse.candidates に対して適用されます。
</ParamField>

<ParamField body="safetySettings[].category" type="string" required>
  指定可能な値: `HARM_CATEGORY_SEXUALLY_EXPLICIT`、`HARM_CATEGORY_HATE_SPEECH`、`HARM_CATEGORY_HARASSMENT`、`HARM_CATEGORY_DANGEROUS_CONTENT`
</ParamField>

<ParamField body="safetySettings[].threshold" type="string" required>
  指定可能な値: `OFF`、`BLOCK_NONE`、`BLOCK_LOW_AND_ABOVE`、`BLOCK_MEDIUM_AND_ABOVE`、`BLOCK_ONLY_HIGH`
</ParamField>

<ParamField body="systemInstruction" type="object">
  モデルをより良いパフォーマンスへ導くための指示です。たとえば、「できるだけ簡潔に回答してください」や「回答に専門用語を使わないでください」などです。テキスト文字列はトークン上限にカウントされます。systemInstruction の role フィールドは無視され、モデルのパフォーマンスには影響しません。注: parts にはテキストのみを使用し、各 part の content は別々の段落にしてください。
</ParamField>

<ParamField body="systemInstruction.parts" type="object[]" required>
  単一のメッセージを構成する順序付けられた part のリストです。part ごとに異なる IANA MIME タイプを持つ場合があります。トークンの最大数や画像の数など、入力の制限については、Google のモデルページにあるモデル仕様を参照してください。
</ParamField>

<ParamField body="systemInstruction.parts[].text" type="string">
  テキストプロンプトまたはコードスニペット。
</ParamField>

<ParamField body="systemInstruction.role" type="string">
  メッセージを作成するエンティティの役割です。次の値がサポートされています。user: メッセージが実在の人物によって送信されたことを示します。通常はユーザーが生成したメッセージです。model: メッセージがモデルによって生成されたことを示します。model の値は、マルチターン会話中にモデルからのメッセージを会話に挿入するために使用されます。マルチターンでない会話では、このフィールドは空欄または未設定のままにできます。

  指定可能な値: `user`、`model`
</ParamField>

<ParamField body="tools" type="object[]">
  システムが外部システムと連携して、モデルの知識や範囲外のアクションまたは一連のアクションを実行できるようにするコードです。Function calling を参照してください。
</ParamField>

<ParamField body="tools[].functionDeclarations" type="object[]" />

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

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

<ParamField body="tools[].functionDeclarations[].parameters" type="object">
  関数パラメータの JSON スキーマ
</ParamField>

<ParamField body="uploadImagesToStorage" type="boolean">
  true の場合、生成された画像はクラウドストレージにアップロードされ、インラインの base64 データではなく署名付き URL として返されます。URL は 24 時間後に有効期限が切れます。
</ParamField>

<ParamField body="videoMetadata" type="object">
  ビデオ入力の場合、ビデオの開始オフセットと終了オフセットを Duration 形式で指定します。たとえば、1:00 から始まる 10 秒のクリップを指定するには、"startOffset": \{ "seconds": 60 } および "endOffset": \{ "seconds": 70 } を設定します。メタデータは、ビデオデータが inlineData または fileData で提示されている場合にのみ指定してください。
</ParamField>

<ParamField body="videoMetadata.endOffset" type="object">
  ビデオタイムライン上の位置に対する再生時間オフセットを表します。
</ParamField>

<ParamField body="videoMetadata.endOffset.nanos" type="integer">
  ナノ秒解像度での符号付き秒の小数部。小数部を伴うネガティブな秒の値であっても、nanos の値は非ネガティブでなければなりません。

  範囲: `0` から `999999999` まで
</ParamField>

<ParamField body="videoMetadata.endOffset.seconds" type="integer">
  期間の符号付き秒数。-315,576,000,000 以上 +315,576,000,000 以下である必要があります。

  範囲: `-315576000000` から `315576000000` まで
</ParamField>

<ParamField body="videoMetadata.startOffset" type="object">
  ビデオタイムライン上の位置に対する再生時間オフセットを表します。
</ParamField>

<ParamField body="videoMetadata.startOffset.nanos" type="integer">
  ナノ秒解像度での符号付き秒の小数部。小数部を伴うネガティブな秒の値であっても、nanos の値は非ネガティブでなければなりません。

  範囲: `0` から `999999999` まで
</ParamField>

<ParamField body="videoMetadata.startOffset.seconds" type="integer">
  期間の符号付き秒数。-315,576,000,000 以上 +315,576,000,000 以下である必要があります。

  範囲: `-315576000000` から `315576000000` まで
</ParamField>

`GET /v2/models/vertexai/gemini-3.1-pro-preview/openapi.json` で Router が提供するスキーマから生成されています。これは、リクエストがプロバイダーに到達する前に呼び出しを検証する際に使用される同一のドキュメントです。

### 出力

<ResponseField name="candidates" type="object[]" />

<ResponseField name="candidates[].citationMetadata" type="object" />

<ResponseField name="candidates[].citationMetadata.citations" type="object[]" />

<ResponseField name="candidates[].citationMetadata.citations[].authors" type="string[]" />

<ResponseField name="candidates[].citationMetadata.citations[].endIndex" type="integer" />

<ResponseField name="candidates[].citationMetadata.citations[].license" type="string" />

<ResponseField name="candidates[].citationMetadata.citations[].publicationDate" type="string (date)">
  形式: `date`
</ResponseField>

<ResponseField name="candidates[].citationMetadata.citations[].startIndex" type="integer" />

<ResponseField name="candidates[].citationMetadata.citations[].title" type="string" />

<ResponseField name="candidates[].citationMetadata.citations[].uri" type="string" />

<ResponseField name="candidates[].content" type="object">
  モデルとの現在の会話のコンテンツ。単一ターンのクエリでは、これは単一のインスタンスです。マルチターンのクエリでは、これは会話履歴と最新のリクエストを含む繰り返しフィールドです。
</ResponseField>

<ResponseField name="candidates[].content.parts" type="object[]" required />

<ResponseField name="candidates[].content.parts[].fileData" type="object">
  URI ベースのデータ。
</ResponseField>

<ResponseField name="candidates[].content.parts[].fileData.fileUri" type="string">
  URI
</ResponseField>

<ResponseField name="candidates[].content.parts[].fileData.mimeType" type="string">
  data フィールドまたは fileUri フィールドで指定されたファイルのメディアタイプ。許容される値は以下のとおりです。gemini-2.0-flash-lite および gemini-2.0-flash では、オーディオファイルの最大長は 8.4 時間、ビデオファイル（音声なし）の最大長は 1 時間です。詳細については、Gemini のオーディオとビデオの要件を参照してください。テキストファイルは UTF-8 でエンコードする必要があります。テキストファイルの内容はトークン制限にカウントされます。画像解像度に制限はありません。

  指定可能な値: `application/pdf`, `audio/mpeg`, `audio/mp3`, `audio/wav`, `image/png`, `image/jpeg`, `image/webp`, `text/plain`, `video/mov`, `video/mpeg`, `video/mp4`, `video/mpg`, `video/avi`, `video/wmv`, `video/mpegps`, `video/flv`, `image/heic`, `image/heif`, `audio/flac`, `video/webm`
</ResponseField>

<ResponseField name="candidates[].content.parts[].inlineData" type="object">
  生のバイト形式のインラインデータ。gemini-2.0-flash-lite および gemini-2.0-flash では、inlineData を使用して最大 3000 枚の画像を指定できます。
</ResponseField>

<ResponseField name="candidates[].content.parts[].inlineData.data" type="string (byte)">
  プロンプトにインラインで含める画像、PDF、またはビデオの base64 エンコード。メディアをインラインで含める場合は、データのメディアタイプ（mimeType）も指定する必要があります。サイズ制限: 20MB

  形式: `byte`
</ResponseField>

<ResponseField name="candidates[].content.parts[].inlineData.mimeType" type="string">
  data フィールドまたは fileUri フィールドで指定されたファイルのメディアタイプ。許容される値は以下のとおりです。gemini-2.0-flash-lite および gemini-2.0-flash では、オーディオファイルの最大長は 8.4 時間、ビデオファイル（音声なし）の最大長は 1 時間です。詳細については、Gemini のオーディオとビデオの要件を参照してください。テキストファイルは UTF-8 でエンコードする必要があります。テキストファイルの内容はトークン制限にカウントされます。画像解像度に制限はありません。

  指定可能な値: `application/pdf`, `audio/mpeg`, `audio/mp3`, `audio/wav`, `image/png`, `image/jpeg`, `image/webp`, `text/plain`, `video/mov`, `video/mpeg`, `video/mp4`, `video/mpg`, `video/avi`, `video/wmv`, `video/mpegps`, `video/flv`, `image/heic`, `image/heif`, `audio/flac`, `video/webm`
</ResponseField>

<ResponseField name="candidates[].content.parts[].mediaProcessing" type="string">
  モデルがこのパートの動画をどのように読み取るか。"AGENTIC" を設定すると、固定レートのフレームサンプリングの代わりに、モデルが検査するセグメントを決定できるようになります。デフォルトの固定レートサンプリングでは省略します。gemini-3.7-flash 以降の Flash モデルでサポートされています。
</ResponseField>

<ResponseField name="candidates[].content.parts[].text" type="string">
  テキストプロンプトまたはコードスニペット。
</ResponseField>

<ResponseField name="candidates[].content.parts[].thought" type="boolean">
  このパートがモデルによる思考/推論ステップであることを示します。
</ResponseField>

<ResponseField name="candidates[].content.role" type="string">
  指定可能な値: `user`, `model`
</ResponseField>

<ResponseField name="candidates[].finishReason" type="string" />

<ResponseField name="candidates[].safetyRatings" type="object[]" />

<ResponseField name="candidates[].safetyRatings[].category" type="string">
  指定可能な値: `HARM_CATEGORY_SEXUALLY_EXPLICIT`, `HARM_CATEGORY_HATE_SPEECH`, `HARM_CATEGORY_HARASSMENT`, `HARM_CATEGORY_DANGEROUS_CONTENT`
</ResponseField>

<ResponseField name="candidates[].safetyRatings[].probability" type="string">
  コンテンツが指定された安全カテゴリに違反する確率

  指定可能な値: `NEGLIGIBLE`, `LOW`, `MEDIUM`, `HIGH`, `UNKNOWN`
</ResponseField>

<ResponseField name="createTime" type="string">
  レスポンスが作成されたタイムスタンプ。
</ResponseField>

<ResponseField name="modelVersion" type="string">
  レスポンスの生成に使用されたモデルバージョン。
</ResponseField>

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

<ResponseField name="promptFeedback.blockReason" type="string" />

<ResponseField name="promptFeedback.blockReasonMessage" type="string" />

<ResponseField name="promptFeedback.safetyRatings" type="object[]" />

<ResponseField name="promptFeedback.safetyRatings[].category" type="string">
  指定可能な値: `HARM_CATEGORY_SEXUALLY_EXPLICIT`, `HARM_CATEGORY_HATE_SPEECH`, `HARM_CATEGORY_HARASSMENT`, `HARM_CATEGORY_DANGEROUS_CONTENT`
</ResponseField>

<ResponseField name="promptFeedback.safetyRatings[].probability" type="string">
  コンテンツが指定された安全カテゴリに違反する確率

  指定可能な値: `NEGLIGIBLE`、`LOW`、`MEDIUM`、`HIGH`、`UNKNOWN`
</ResponseField>

<ResponseField name="responseId" type="string">
  レスポンスの一意の識別子。
</ResponseField>

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

<ResponseField name="usageMetadata.cachedContentTokenCount" type="integer">
  出力専用。入力内のキャッシュされた部分（キャッシュされたコンテンツ）のトークン数。
</ResponseField>

<ResponseField name="usageMetadata.candidatesTokenCount" type="integer">
  レスポンス内のトークン数。
</ResponseField>

<ResponseField name="usageMetadata.candidatesTokensDetails" type="object[]">
  モダリティ別の候補トークンの内訳。
</ResponseField>

<ResponseField name="usageMetadata.candidatesTokensDetails[].modality" type="string">
  入力または出力コンテンツのモダリティの種類。

  指定可能な値: `MODALITY_UNSPECIFIED`、`TEXT`、`IMAGE`、`VIDEO`、`AUDIO`、`DOCUMENT`
</ResponseField>

<ResponseField name="usageMetadata.candidatesTokensDetails[].tokenCount" type="integer">
  指定されたモダリティのトークン数。
</ResponseField>

<ResponseField name="usageMetadata.promptTokenCount" type="integer">
  リクエスト内のトークン数。cachedContent が設定されている場合でも、これは有効なプロンプト全体のサイズを表し、キャッシュされたコンテンツのトークン数も含まれます。
</ResponseField>

<ResponseField name="usageMetadata.promptTokensDetails" type="object[]">
  モダリティ別のプロンプトトークンの内訳。
</ResponseField>

<ResponseField name="usageMetadata.promptTokensDetails[].modality" type="string">
  入力または出力コンテンツのモダリティの種類。

  指定可能な値: `MODALITY_UNSPECIFIED`、`TEXT`、`IMAGE`、`VIDEO`、`AUDIO`、`DOCUMENT`
</ResponseField>

<ResponseField name="usageMetadata.promptTokensDetails[].tokenCount" type="integer">
  指定されたモダリティのトークン数。
</ResponseField>

<ResponseField name="usageMetadata.thoughtsTokenCount" type="integer">
  thoughts 出力に含まれるトークン数。
</ResponseField>

<ResponseField name="usageMetadata.toolUsePromptTokenCount" type="integer">
  ツール使用プロンプトに含まれるトークン数。
</ResponseField>

<ResponseField name="usageMetadata.toolUsePromptTokensDetails" type="object[]">
  モダリティごとのツール使用プロンプトトークンの内訳。
</ResponseField>

<ResponseField name="usageMetadata.toolUsePromptTokensDetails[].modality" type="string">
  入力または出力コンテンツのモダリティの種類。

  指定可能な値: `MODALITY_UNSPECIFIED`, `TEXT`, `IMAGE`, `VIDEO`, `AUDIO`, `DOCUMENT`
</ResponseField>

<ResponseField name="usageMetadata.toolUsePromptTokensDetails[].tokenCount" type="integer">
  指定されたモダリティのトークン数。
</ResponseField>

<ResponseField name="usageMetadata.totalTokenCount" type="integer">
  トークンの総数（プロンプト + 候補）。
</ResponseField>

<ResponseField name="usageMetadata.trafficType" type="string">
  リクエストに使用されたトラフィックタイプ（例: PROVISIONED\_THROUGHPUT）。
</ResponseField>

## 例

### 入力

```json theme={null}
{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Describe a single red maple leaf on a white background in one sentence."
        }
      ]
    }
  ],
  "generationConfig": {
    "temperature": 0.7,
    "maxOutputTokens": 256
  }
}
```

### 出力

```json theme={null}
{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [
          {
            "text": "A single red maple leaf rests on a plain white background, its edges sharp and its color deep."
          }
        ]
      },
      "finishReason": "STOP"
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 18,
    "candidatesTokenCount": 24
  }
}
```

## 出荷前の確認

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>
