POST /v2/models/{provider}/{model}를 사용합니다. 이 페이지에서는 모델 간에 공유되는 헤더를 다루며, API reference에는 생성된 계약이 나열되어 있습니다.
Comfy SDK(comfy-sdk는 Python용, @comfyorg/sdk는 TypeScript용)는 인증을 처리하고 idempotency key를 생성합니다. 아래에 설명된 대로 선택된 응답 메타데이터를 노출합니다. Raw HTTP 클라이언트는 헤더를 직접 전송하고 읽어야 합니다.
요청 헤더
string
Comfy 워크스페이스에서 생성한
comfyui-... 형식의 Comfy API 키입니다. 이 키는 워크스페이스의 모델 접근 권한과 크레딧 잔액을 사용합니다. Authorization: Bearer comfyui-... 형식으로 보낼 수도 있으며, 두 헤더가 모두 있으면 X-API-Key가 우선합니다.string
Bearer <token>. comfyui- 값은 API 키입니다. 그 외의 값은 Comfy Cloud JWT로 처리됩니다.string
하나의 논리적 생성을 식별합니다. 호출 전에 UUID를 생성해 저장한 뒤, 변경되지 않은 요청을 재시도할 때 재사용하세요. 이 키는 최대 24시간 동안 결과를 재생하거나 수락된 작업을 수집할 수 있습니다. SDK는 키를 자동으로 생성하며 직접 지정할 수도 있습니다(Python에서는
idempotency_key=, TypeScript에서는 idempotencyKey). 충돌, 만료, 재생 불가능한 결과에 대해서는 재시도 결과를 참조하세요.string
application/json. 모델의 네이티브 JSON 입력을 전송합니다. 필드와 검증 요구 사항은 모델마다 다릅니다. Router API 사용하기를 참조하세요.string
GET /v2/models/{provider}/{model}/openapi.json에서만 사용합니다. 이전 200 응답에서 받은 ETag를 전송하세요. 여전히 일치하면 동일한 ETag와 함께 본문 없는 304가 반환됩니다. 모델의 스키마를 프로세스가 실행되는 동안 캐시하고, 매 호출 전에 다시 읽는 대신 이 방식으로 재검증하세요.Response headers
string
필수
Identifies this HTTP request. Include it when contacting support. TypeScript exposes it as
requestId; Python exposes request_id on errors.string
The machine-readable error category. On a
422, use this header because the validation body has detail[] and no error_type. Combine it with the HTTP status to decide what to do. Treat an unknown value as internal_error for control flow and preserve it for diagnostics.boolean
Present and
true when Router serves a stored result instead of running the model again. It is absent on a fresh run.integer
Seconds to wait before retrying. On
409 / concurrency_limit_exceeded or 504 / deadline_exceeded, retry the same request and key after the wait. On 429 / rate_limited, it tells you when the rate limit resets.integer
The ceiling on partner spend committed to calls still running, in USD cents. An enforcing spend gate can return it on admitted responses and on its
429 refusals. It is absent when the gate is not enforcing or a different control refused the request.integer
USD cents currently committed to calls in flight. An admitted response includes its own call; a
429 excludes the refused call. Sent alongside X-Committed-Spend-Limit.integer
USD cents left below the committed-spend ceiling. It can be positive on a refusal when the requested call costs more than the remaining amount.
string
On
GET /v2/models/{provider}/{model}/openapi.json. Store it and send it back as If-None-Match to revalidate a cached schema.string
On the schema route:
private, must-revalidate. Keep the response in a private cache and revalidate stale copies with the ETag.두 가지 의미를 지닌 상태 코드
세 가지 상태는 두 버킷에 걸쳐 공유되며, 이를 구분해 주는 것이 바로 헤더입니다:다음
- Quickstart: 요청을 보내고 결과를 확인합니다.
- Comfy Router API 사용하기: 모델 검색, 스키마, 오류, 재시도, 과금.
- API 레퍼런스: 이 헤더들이 정의된 생성된 계약.
- 제한 사항: 현재 Router가 하지 않는 것과 대신 사용할 것.