https://api.comfy.org
Every endpoint below is authenticated. Send X-API-Key: <api-key> or Authorization: Bearer <jwt>.
Comfy API keys can also be sent as Bearer tokens. X-API-Key takes precedence when both credential headers are supplied. See authentication headers for the key/JWT distinction and the Quickstart for access requirements.
Endpoints
GET /v2/models
List the models Comfy Router can run.
List available model IDs and billing facts. Use next_cursor while has_more is true.
Parameters
Responses
GET /v2/models/{provider}/{model}
Read one partner model’s catalog entry by canonical model ID.
Read details for one model without listing the full catalog.
Parameters
Responses
POST /v2/models/{provider}/{model}
Run a partner model synchronously by canonical model ID.
Run a model and receive its finished result in the same response.
Parameters
Request body
application/json — RouterModelInput (required)
The partner model’s native JSON input, forwarded to the provider unchanged.
Responses
GET /v2/models/{provider}/{model}/openapi.json
Read one partner model’s input and output schemas as an OpenAPI document.
Read one model’s input and output schemas as a standalone OpenAPI document.
Parameters
Responses
Table descriptions are brief. Use Using the Comfy Router API for model selection, validation, retries, and billing, and Headers for header behavior.
Error buckets
Machine-readable Router error category, also sent in theX-Comfy-Error-Type header.
Request-level buckets
Raised for a request Router accepted and then could not complete.Transport-level buckets
Raised by Router itself, before or around the call to the model.Response headers
Result assets
A model can return asset URLs, inline bytes, or both. The providers below copy selected assets onto Comfy storage and replace their URLs. This behavior depends on the model; there is no request header that selects it.
These lifetimes start when the URL is signed, not when you open it. Cached or replayed URLs can have less time remaining; replay does not renew them. Download the asset promptly. Only the assets named in each row are copied:
byteplus/seedream-* and byteplus/seededit-* images are not covered by the BytePlus video row.
Veo (veo/*) has a separate storage path. In response.videos[], read whichever member is present: bytesBase64Encoded contains the clip inline, while gcsUri contains a Comfy-signed HTTPS link when the environment is configured for direct provider writes to Comfy storage. That link is valid for 24 hours from the response. The latter case writes the asset directly rather than copying it, so Veo is not in the rehosting table.
Other models return provider asset references or inline bytes. Provider URLs follow the provider’s expiry, which can be much shorter than the lifetimes above and is not specified by the Router contract.
Copying is best effort per asset. If one copy fails, that entry keeps its provider reference; the response can contain both Comfy and provider URLs, with no explicit per-asset copy-status field. The generation still succeeds and is charged. Do not infer every URL’s lifetime from one successfully rehosted asset.
The xai and minimax adapters serialize through known provider types, so undeclared provider fields may be omitted. Consult the model’s output schema rather than assuming that every field from a provider SDK is preserved.
Whether a result is Comfy-hosted also decides whether a completed call can still be replayed from its Idempotency-Key record later; the Idempotency-Key parameter above says what a retry is answered with when it cannot be.
Per-model input and output schemas
Read each model’s fields fromGET /v2/models/{provider}/{model}/openapi.json. The operation’s requestBody describes input validation; its 200 response describes the output shape and media type when authored. When x-comfy-input-schema-authored is false, Router accepts any JSON object without model-specific prevalidation. Provider requirements still apply. The output schemas describe results; Router does not validate returned provider payloads against them. An unauthored output may use */* rather than application/json; inspect the response content type before decoding it.
Schemas
RouterChargesOnPolicyRejection
Whether a content-policy refusal is charged for this model. Treat an unknown value as potentially charged. Type:string
RouterErrorResponse
Error body for authentication, access, model lookup, quota, and provider transport failures.RouterErrorType
Machine-readable Router error category, also sent in theX-Comfy-Error-Type header.
Type: string
RouterModelBilling
Billing behavior to check before invoking a model. It does not include prices or usage.RouterModelDetail
Per-model detail for one Comfy Router model: everything the catalog listing reports for it, plus the per-model fields that only the single-model route carries. ComposesRouterModelListEntry, RouterModelDetailFields.
Type: object
RouterModelDetailFields
Optional fields returned by the model-details endpoint.RouterModelId
The model ID used inPOST /v2/models/{provider}/{model}.
Type: string — Model ID, e.g. anthropic/claude-opus-4-6, Up to 193 characters
RouterModelInput
The model input object. Read the selected model’s OpenAPI document for fields and validation. Type:object
RouterModelInputSchemaDocument
A standalone OpenAPI document for one model’s input and output. Type:object
RouterModelListEntry
A model’s ID and billing facts.RouterModelListResponse
One page of the Router model catalog.RouterModelOutput
The model result object. Read the selected model’s output schema for its exact shape. Type:object
RouterModelSegment
The model portion of a{provider}/{model} model ID.
Type: string — Alphanumeric slug, e.g. claude-opus-4-6, Up to 128 characters
RouterPageCursor
An opaque catalog cursor. Pass it back unchanged ascursor.
Type: string — Opaque cursor returned as next_cursor, 1–512 characters
RouterProviderSegment
The provider portion of a{provider}/{model} model ID.
Type: string — Alphanumeric slug, e.g. anthropic, Up to 64 characters
RouterValidationErrorContext
Provider-supplied details about the validation rule that failed. Type:object
RouterValidationErrorDetail
One field-level validation failure.RouterValidationErrorInput
The rejected input value, when the provider includes it.RouterValidationErrorResponse
The422 validation error body. Read X-Comfy-Error-Type for its category.