Read input and output schemas
Each model exposes a standalone OpenAPI document:requestBody describes the input, and the 200 response describes the output when an output schema has been authored. Input validation and output documentation are different: Router validates against its input schema but does not validate the returned provider result against its output schema.
Inspect the output media type as well as its fields. An unauthored output can use */*, and some models return binary data rather than JSON.
Cache a schema
Save the schema and itsETag. On a later schema fetch, pass that ETag in If-None-Match. A 304 has no body; keep the cached document. A 200 supplies a replacement document and ETag.
Cache-Control: private, must-revalidate. Keep authenticated responses out of shared caches. This ETag/304 behavior applies only to the schema endpoint.
Validation and fallback schemas
An authored input schema rejects invalid fields before the provider call with422 and a detail[] array. Read the field paths in loc; see validation errors.
Some schemas accept any JSON object and set x-comfy-input-schema-authored: false. Router forwards those requests without model-specific validation, so the provider can still reject them.
Read the result
Router returns each model’s terminal result shape. There is no common image, video, or text envelope: BFL image output usesresult.sample, while other models can return URL lists or inline bytes.
Some asset URLs are rehosted by Comfy; others remain provider URLs or inline bytes. Check result assets and download expiring assets promptly. Replays do not renew URLs.
Next
- Queued requests: submit a run and collect the result later.
- Errors and retries: handle failures without paying twice.