> ## 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에서 GPT 5 Mini 사용하기

> Comfy Router를 통해 openai/gpt-5-mini 호출하기: 엔드포인트, 요청 형태, Router가 반환하는 응답.

OpenAI가 제공하고 Comfy Router가 서비스하는 `openai/gpt-5-mini`의 API 레퍼런스입니다.

## 빠른 시작

[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:** `openai/gpt-5-mini`

**엔드포인트:** `POST https://api.comfy.org/v2/models/openai/gpt-5-mini`

<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(
              "openai/gpt-5-mini",
              {
                  "input": "Reply with the single word: ok",
                  "max_output_tokens": 1024,
              },
          )

      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("openai/gpt-5-mini", {
        input: "Reply with the single word: ok",
        max_output_tokens: 1024,
      });

      console.log(data);
      ```

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

  <Tab title="Queue and collect later">
    동일한 본문을 `POST https://api.comfy.org/v2/models/openai/gpt-5-mini/requests` 로 보냅니다. Router는 실행이 접수되는 즉시 `201` 과 `request_id` 를 응답하며, 결과는 준비가 되는 대로 이 프로세스나 다른 프로세스에서 수집할 수 있습니다. 상태, 취소, 수집 방법은 [Queued delivery](/ko/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(
              "openai/gpt-5-mini",
              {
                  "input": "Reply with the single word: ok",
                  "max_output_tokens": 1024,
              },
          )
          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("openai/gpt-5-mini", {
        input: "Reply with the single word: ok",
        max_output_tokens: 1024,
      });
      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/openai/gpt-5-mini/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\", \"max_output_tokens\": 1024}"

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

## 스키마

### 입력

<ParamField body="include" type="string[]">
  모델 응답에 포함할 추가 출력 데이터입니다.
</ParamField>

<ParamField body="input" type="string | object[]" required>
  모델에 전달되는 텍스트, 이미지 또는 파일 입력으로, 응답을 생성하는 데 사용됩니다. 이 계약에서 Router가 제공할 수 없는 유일한 필드이며, 아래 `required`의 유일한 항목입니다.
</ParamField>

<ParamField body="instructions" type="string">
  모델의 컨텍스트 첫 번째 항목으로 시스템(또는 개발자) 메시지를 삽입합니다.
</ParamField>

<ParamField body="max_output_tokens" type="integer">
  응답을 위해 생성되는 토큰 수의 상한으로, 가시적 출력 토큰과 추론 토큰을 포함합니다. 추론 id에서는 이 상한을 숨김 추론 토큰과 공유하므로, 작은 값은 가시적 텍스트가 나오기 전에 전체 예산을 소진할 수 있습니다. 이것이 추론 스모크 케이스가 1024를 보내고 채팅 케이스가 16을 보내는 이유입니다.

  범위: `1`부터 `…`까지
</ParamField>

<ParamField body="model" type="string">
  OpenAI 모델 식별자입니다. Comfy Router에서 이 필드는 선택 사항(OPTIONAL)이며 Router가 `{model}` 경로 세그먼트에서 이를 채웁니다. 명시적 `null`도 같은 방식으로 교체됩니다. 경로와 일치하지 않는 값을 보내면 거부됩니다.
</ParamField>

<ParamField body="parallel_tool_calls" type="boolean">
  모델이 도구 호출을 병렬로 실행하도록 허용할지 여부입니다.
</ParamField>

<ParamField body="previous_response_id" type="string">
  다중 턴 대화를 위한 이전 응답의 ID입니다.
</ParamField>

<ParamField body="reasoning" type="object">
  추론 티어 전용입니다. 추론 모델을 위한 구성입니다. 예: `{"effort": "medium"}`. 변경 없이 전달됩니다. 허용되는 키는 OpenAI의 추론 가이드를 참조하세요. 채팅 티어 id는 이를 무시합니다.
</ParamField>

<ParamField body="store" type="boolean">
  OpenAI가 생성된 응답을 나중에 검색할 수 있도록 저장할지 여부입니다.
</ParamField>

<ParamField body="stream" type="boolean">
  이 필드를 보내는 호출자가 거부되지 않도록 선언되어 있지만, 이 표면에서는 아무 효과가 없습니다. Router는 디스패치 이전에 이를 `false`로 확정합니다. 이 엔드포인트는 `text/event-stream`을 중계하는 대신 공급자 응답을 캡처하기 때문입니다. openAiResponsesProxy의 ModifyResponse는 이를 디코딩할 수 없으므로, 스트리밍 생성은 OpenAI가 과금하고 아무도 계량하지 않게 됩니다. 스트림이 필요하면 `POST /proxy/openai/v1/responses`를 사용하세요.
</ParamField>

<ParamField body="temperature" type="number">
  샘플링 온도입니다. 채팅 티어 전용입니다. o 시리즈 추론 id(`o1`, `o1-pro`, `o3`, `o4-mini`)는 OpenAI에서 이 매개변수를 거부합니다. Router는 이들에 대해 이를 거부하지 않습니다. 두 티어가 하나의 스키마를 공유하는 이유에 대해서는 이 컴포넌트의 설명을 참조하세요. 따라서 이를 보내는 추론 호출은 OpenAI 자체의 오류로 응답됩니다.

  범위: `0`부터 `2`까지
</ParamField>

<ParamField body="text" type="object">
  출력 형식 구성입니다. 예를 들어 Structured Outputs의 경우 `{"format": {"type": "json_schema", ...}}`입니다. 변경 없이 전달됩니다.
</ParamField>

<ParamField body="tool_choice" type="string | object">
  모델이 사용할 도구를 어떻게 선택해야 하는지 지정합니다. 문자열 모드이거나 도구를 지정하는 객체입니다.
</ParamField>

<ParamField body="tools" type="object[]">
  모델이 호출할 수 있는 도구 정의입니다. Router는 도구 분류를 좁히지 않습니다. 허용되는 형태는 OpenAI의 Responses API 레퍼런스를 참조하세요.
</ParamField>

<ParamField body="top_p" type="number">
  Nucleus 샘플링 컷오프입니다. `temperature`와 동일한 조건으로 채팅 티어 전용입니다.

  범위: `0`부터 `1`까지
</ParamField>

<ParamField body="truncation" type="string">
  컨텍스트가 모델의 창을 초과할 때의 잘림(truncation) 전략입니다. 위의 세 값 목록과 달리 여기서는 enum이 실제로 강제됩니다. 이 두 값이 OpenAI가 문서화한 완전한 집합이며 그 이후 늘어나지 않았기 때문입니다. 명시적 `null`은 위 필드들과 동일한 조건으로 여전히 허용됩니다.

  가능한 값: `auto`, `disabled`
</ParamField>

<ParamField body="usage" type="object">
  토큰 사용량 봉투(envelope)입니다. v1 작업이 요청 본문에 이를 선언하기 때문에 이 계약에 존재합니다. OpenAI는 RESPONSE에 이를 채우므로, 호출자가 보낼 이유가 없습니다.
</ParamField>

Router가 `GET /v2/models/openai/gpt-5-mini/openapi.json`에서 제공하는 스키마에서 생성되었으며, 이는 요청이 공급자에 도달하기 이전에 호출을 검증하는 데 사용하는 동일한 문서입니다.

### 출력

<ResponseField name="instructions" type="string">
  모델의 컨텍스트에서 첫 번째 항목으로 시스템(또는 개발자) 메시지를 삽입합니다.

  `previous_response_id`와 함께 사용하면 이전 응답의 instructions가 다음 응답으로 이어지지 않습니다. 따라서 새 응답에서 시스템(또는 개발자) 메시지를 간단히 교체할 수 있습니다.
</ResponseField>

<ResponseField name="max_output_tokens" type="integer">
  표시되는 출력 토큰과 [추론 토큰](https://platform.openai.com/docs/guides/reasoning)을 포함하여 응답에 대해 생성할 수 있는 토큰 수의 상한입니다.
</ResponseField>

<ResponseField name="model" type="string">
  응답을 생성하는 데 사용되는 모델
</ResponseField>

<ResponseField name="temperature" type="number" default="1">
  응답의 무작위성을 제어합니다

  범위: `0` \~ `2`
</ResponseField>

<ResponseField name="top_p" type="number" default="1">
  nucleus 샘플링을 통해 응답의 다양성을 제어합니다

  범위: `0` \~ `1`
</ResponseField>

<ResponseField name="truncation" type="string" default="&#x22;disabled&#x22;">
  모델 응답에 사용할 잘라내기 전략입니다.

  * `auto`: 이 응답과 이전 응답들의 컨텍스트가 모델의 컨텍스트 창 크기를 초과하면, 모델은 대화 중간의 입력 항목을 삭제하여 컨텍스트 창에 맞도록 응답을 잘라냅니다.
  * `disabled`(기본값): 모델 응답이 모델의 컨텍스트 창 크기를 초과할 경우 요청이 400 오류와 함께 실패합니다.

    가능한 값: `auto`, `disabled`
</ResponseField>

<ResponseField name="previous_response_id" type="string">
  모델에 대한 이전 응답의 고유 ID입니다. 이를 사용하여 다중 턴 대화를 생성합니다.
  [대화 상태](https://platform.openai.com/docs/guides/conversation-state)에 대해 더 알아보세요.
</ResponseField>

<ResponseField name="reasoning" type="object">
  **o-시리즈 모델 전용**

  [추론 모델](https://platform.openai.com/docs/guides/reasoning)을 위한 구성 옵션입니다.
</ResponseField>

<ResponseField name="reasoning.context" type="string">
  이후 턴에서 어떤 추론 항목이 모델에 다시 제공되는지 제어합니다. 예: `auto`, `current_turn`, `all_turns`.
</ResponseField>

<ResponseField name="reasoning.effort" type="string" default="&#x22;medium&#x22;">
  **o-시리즈 모델 전용**

  [추론 모델](https://platform.openai.com/docs/guides/reasoning)의 추론 노력을 제한합니다.
  현재 지원되는 값은 `low`, `medium`, `high`입니다. 추론 노력을 줄이면
  응답이 더 빨라지고 응답에서 추론에 사용되는 토큰이 줄어들 수 있습니다.

  가능한 값: `low`, `medium`, `high`
</ResponseField>

<ResponseField name="reasoning.generate_summary" type="string">
  **지원 중단됨:** 대신 `summary`를 사용하세요.

  모델이 수행한 추론의 요약입니다. 이는 모델의 추론 과정을
  디버깅하고 이해하는 데 유용할 수 있습니다.
  `auto`, `concise`, `detailed` 중 하나입니다.

  가능한 값: `auto`, `concise`, `detailed`
</ResponseField>

<ResponseField name="reasoning.mode" type="string">
  응답에 사용되는 추론 모드입니다.
</ResponseField>

<ResponseField name="reasoning.summary" type="string">
  모델이 수행한 추론의 요약입니다. 이는 모델의 추론 과정을
  디버깅하고 이해하는 데 유용할 수 있습니다.
  `auto`, `concise`, `detailed` 중 하나입니다.

  가능한 값: `auto`, `concise`, `detailed`
</ResponseField>

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

<ResponseField name="text.format" type="object">
  모델이 출력해야 하는 형식을 지정하는 객체입니다.

  `{ "type": "json_schema" }`를 구성하면 Structured Outputs가 활성화되어
  모델이 제공한 JSON 스키마와 일치하도록 보장합니다. 자세한 내용은
  [Structured Outputs 가이드](https://platform.openai.com/docs/guides/structured-outputs)를 참조하세요.

  기본 형식은 추가 옵션이 없는 `{ "type": "text" }`입니다.

  **gpt-4o 및 최신 모델에는 권장되지 않습니다:**

  `{ "type": "json_object" }`로 설정하면 이전 JSON 모드가 활성화되어
  모델이 생성하는 메시지가 유효한 JSON임을 보장합니다. 이를 지원하는
  모델에서는 `json_schema`를 사용하는 것이 좋습니다.
</ResponseField>

<ResponseField name="text.verbosity" type="string">
  모델 응답의 상세도를 제한합니다. `low`, `medium`, `high` 중 하나입니다.
</ResponseField>

<ResponseField name="tool_choice" type="`none`, `auto`, `required` | object">
  응답을 생성할 때 모델이 사용할 도구(또는 도구들)를 어떻게 선택해야 하는지
  지정합니다. 모델이 호출할 수 있는 도구를 지정하는 방법은 `tools` 매개변수를
  참조하세요.
</ResponseField>

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

<ResponseField name="background" type="boolean">
  모델 응답이 배경에서 실행되는지 여부입니다.
</ResponseField>

<ResponseField name="billing" type="object">
  응답에 대한 결제 정보입니다.
</ResponseField>

<ResponseField name="billing.payer" type="string">
  응답 비용을 지불할 책임이 있는 주체입니다.
</ResponseField>

<ResponseField name="completed_at" type="number">
  이 응답이 완료된 시점의 Unix 타임스탬프(초)입니다. 상태가 `completed`일 때만 존재합니다.
</ResponseField>

<ResponseField name="created_at" type="number">
  이 응답이 생성된 시점의 Unix 타임스탬프(초)입니다.
</ResponseField>

<ResponseField name="error" type="object">
  모델이 응답 생성에 실패했을 때 반환되는 오류 객체입니다.
</ResponseField>

<ResponseField name="error.code" type="string" required>
  응답의 오류 코드입니다.  Possible values: `server_error`, `rate_limit_exceeded`, `invalid_prompt`, `vector_store_timeout`, `invalid_image`, `invalid_image_format`, `invalid_base64_image`, `invalid_image_url`, `image_too_large`, `image_too_small`, `image_parse_error`, `image_content_policy_violation`, `invalid_image_mode`, `image_file_too_large`, `unsupported_image_media_type`, `empty_image_file`, `failed_to_download_image`, `image_file_not_found`
</ResponseField>

<ResponseField name="error.message" type="string" required>
  오류에 대한 사람이 읽을 수 있는 설명입니다.
</ResponseField>

<ResponseField name="frequency_penalty" type="number">
  지금까지의 텍스트에서 기존 등장 빈도를 기준으로 새 token에 페널티를 부여합니다.
</ResponseField>

<ResponseField name="id" type="string">
  이 Response의 고유 식별자입니다.
</ResponseField>

<ResponseField name="incomplete_details" type="object">
  응답이 불완전한 이유에 대한 세부 정보입니다.
</ResponseField>

<ResponseField name="incomplete_details.reason" type="string">
  응답이 불완전한 이유입니다.

  Possible values: `max_output_tokens`, `content_filter`
</ResponseField>

<ResponseField name="max_tool_calls" type="integer">
  하나의 응답에서 처리할 수 있는 내장 도구에 대한 총 호출의 최대 수입니다.
</ResponseField>

<ResponseField name="metadata" type="object">
  응답에 첨부할 수 있는 키-값 쌍의 집합입니다.
</ResponseField>

<ResponseField name="moderation" type="object">
  moderations가 요청된 경우 응답 입력 및 출력에 대한 moderation 결과입니다.
</ResponseField>

<ResponseField name="object" type="string">
  이 리소스의 객체 유형이며, 항상 `response`로 설정됩니다.

  Possible values: `response`
</ResponseField>

<ResponseField name="output" type="object[]">
  모델이 생성한 콘텐츠 항목의 배열입니다.

  * `output` 배열에 있는 항목의 길이와 순서는 모델의 응답에 따라 달라집니다.
  * `output` 배열의 첫 번째 항목에 접근하여 모델이 생성한 콘텐츠를 가진 `assistant` 메시지라고 가정하기보다는, SDK에서 지원되는 경우 `output_text` 속성을 사용하는 것을 고려해 보세요.
</ResponseField>

<ResponseField name="output_text" type="string">
  `output` 배열의 모든 `output_text` 항목에 있는 집계된 텍스트 출력을 포함하는 SDK 전용 편의 속성입니다(있는 경우). Python 및 JavaScript SDK에서 지원됩니다.
</ResponseField>

<ResponseField name="parallel_tool_calls" type="boolean" default="true">
  모델이 도구 호출을 병렬로 실행하도록 허용할지 여부입니다.
</ResponseField>

<ResponseField name="presence_penalty" type="number">
  지금까지의 텍스트에 등장하는지 여부를 기준으로 새 token에 페널티를 부여합니다.
</ResponseField>

<ResponseField name="prompt_cache_key" type="string">
  OpenAI가 유사한 요청에 대한 응답을 캐시하여 캐시 적중률을 최적화하는 데 사용합니다. `user` 필드를 대체합니다.
</ResponseField>

<ResponseField name="prompt_cache_retention" type="string">
  prompt cache의 보존 정책입니다. 예: `in_memory` 또는 `24h`.
</ResponseField>

<ResponseField name="safety_identifier" type="string">
  OpenAI의 사용 정책을 위반할 수 있는 애플리케이션 사용자를 감지하는 데 사용되는 안정적인 식별자입니다.
</ResponseField>

<ResponseField name="service_tier" type="string">
  요청을 처리하는 데 사용되는 처리 등급입니다. 예: `auto`, `default`, `flex`, `scale` 또는 `priority`.
</ResponseField>

<ResponseField name="status" type="string">
  응답 생성의 상태입니다. `completed`, `failed`, `in_progress`, `cancelled`, `queued`, `incomplete` 중 하나입니다.

  Possible values: `completed`, `failed`, `in_progress`, `cancelled`, `queued`, `incomplete`
</ResponseField>

<ResponseField name="store" type="boolean">
  나중에 API를 통해 검색할 수 있도록 응답을 저장할지 여부입니다.
</ResponseField>

<ResponseField name="tool_usage" type="object">
  내장 도구별로 분류된 token 및 요청 사용량입니다.
</ResponseField>

<ResponseField name="tool_usage.image_gen" type="object">
  이미지 생성 도구의 token 사용량입니다.
</ResponseField>

<ResponseField name="tool_usage.image_gen.input_tokens" type="integer" />

<ResponseField name="tool_usage.image_gen.input_tokens_details" type="object" />

<ResponseField name="tool_usage.image_gen.input_tokens_details.image_tokens" type="integer" />

<ResponseField name="tool_usage.image_gen.input_tokens_details.text_tokens" type="integer" />

<ResponseField name="tool_usage.image_gen.output_tokens" type="integer" />

<ResponseField name="tool_usage.image_gen.output_tokens_details" type="object" />

<ResponseField name="tool_usage.image_gen.output_tokens_details.image_tokens" type="integer" />

<ResponseField name="tool_usage.image_gen.output_tokens_details.text_tokens" type="integer" />

<ResponseField name="tool_usage.image_gen.total_tokens" type="integer" />

<ResponseField name="tool_usage.web_search" type="object">
  웹 검색 도구 사용량입니다.
</ResponseField>

<ResponseField name="tool_usage.web_search.num_requests" type="integer" />

<ResponseField name="top_logprobs" type="integer">
  각 token 위치에서 반환할 가장 가능성이 높은 token의 최대 개수이며, 각각 관련 log probability가 함께 제공됩니다.
</ResponseField>

<ResponseField name="usage" type="object">
  입력 token, 출력 token, 출력 token의 세부 내역, 사용된 총 token을 포함한 token 사용 세부 정보를 나타냅니다.
</ResponseField>

<ResponseField name="usage.input_tokens" type="integer" required>
  입력 token 수입니다.
</ResponseField>

<ResponseField name="usage.input_tokens_details" type="object" required>
  입력 token의 세부 내역입니다.
</ResponseField>

<ResponseField name="usage.input_tokens_details.cache_write_tokens" type="integer">
  캐시에 기록된 입력 token 수입니다.
</ResponseField>

<ResponseField name="usage.input_tokens_details.cached_tokens" type="integer" required>
  캐시에서 검색된 토큰 수입니다.
  [프롬프트 캐싱에 대한 자세한 내용](https://platform.openai.com/docs/guides/prompt-caching).
</ResponseField>

<ResponseField name="usage.output_tokens" type="integer" required>
  출력 토큰 수입니다.
</ResponseField>

<ResponseField name="usage.output_tokens_details" type="object" required>
  출력 토큰에 대한 세부 분석입니다.
</ResponseField>

<ResponseField name="usage.output_tokens_details.reasoning_tokens" type="integer" required>
  추론 토큰 수입니다.
</ResponseField>

<ResponseField name="usage.total_tokens" type="integer" required>
  사용된 총 토큰 수입니다.
</ResponseField>

<ResponseField name="user" type="string">
  최종 사용자에 대한 지원 중단된 식별자입니다. `safety_identifier` 및 `prompt_cache_key`로 교체되었습니다.
</ResponseField>

## 예제

### 입력

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

### 출력

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

## 배포 전 확인

SDK는 `Idempotency-Key`를 생성하고 자동 재시도에 재사용합니다. 수동으로 재시도할 때는 원본 키를 재사용하세요. Router는 연결을 최대 10분간 유지할 수 있습니다.

요청이 실패하면 Router는 그 이유를 설명하는 `X-Comfy-Error-Type` 응답 헤더를 보냅니다. `422`는 Router가 공급자를 호출하기 전에 입력을 거부했음을 의미하고, `413`은 요청 본문이 Router가 허용하는 크기보다 컸음을 의미합니다. [결과 URL이 만료](/ko/development/comfy-router/reference#결과-에셋)될 수 있으므로 생성된 에셋은 즉시 다운로드하세요.

위의 필드 설명에 명시된 크기 제한은 해당 필드에 대한 공급자 자체의 한도이며, 공급자 사양에서 인용한 것입니다. Router는 전체 요청 본문에 별도의 상한을 적용하며, base64로 인코딩된 미디어도 여기에 포함됩니다. [요청 본문 크기](/ko/development/comfy-router/limitations)를 참고하세요.

<CardGroup cols={3}>
  <Card title="헤더" icon="list" href="/ko/development/comfy-router/headers">
    인증, 멱등성, 요청 ID, 오류 분류, 재시도 간격, 지출 한도.
  </Card>

  <Card title="Router API 사용" icon="code" href="/ko/development/comfy-router/api">
    모델 검색, 검증 오류, 재시도, 과금.
  </Card>

  <Card title="제한 사항" icon="triangle-exclamation" href="/ko/development/comfy-router/limitations">
    Router가 현재 지원하지 않는 기능과 대신 사용할 방법.
  </Card>
</CardGroup>
