{"openapi":"3.0.2","info":{"title":"anthropic/claude-haiku-4-5-20251001","description":"The request body Comfy Router accepts for the model \"anthropic/claude-haiku-4-5-20251001\", and the response body it returns. The INPUT schema is the same schema the server validates a call against before it reaches the provider, so what is published and what is enforced cannot differ. `x-comfy-router-input-modalities` records the media kinds the model is documented to accept; the request schema is shared across sibling models and may admit media kinds this model ignores. The OUTPUT schema describes the provider's native result document exactly as Router returns it: Router does not validate, narrow or re-envelope the response, so the output schema is descriptive rather than enforced, and Comfy owns no output shape of its own.","version":"f527cfcae844"},"paths":{"/v2/models/anthropic/claude-haiku-4-5-20251001":{"post":{"operationId":"runRouterModel","summary":"Run anthropic/claude-haiku-4-5-20251001 synchronously.","security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":true,"description":"Request body for Anthropic Messages API (`/v1/messages`). Mirrors the upstream schema with strict typing only on fields the proxy reads (model, prompt extraction, streaming, billing). Other top-level fields (`tools`, `temperature`, `top_p`, `thinking`, `metadata`, etc.) pass through unchanged via `additionalProperties`.","example":{"max_tokens":16,"messages":[{"content":"Reply with the single word: ok","role":"user"}]},"properties":{"max_tokens":{"description":"Maximum number of tokens to generate before stopping.","type":"integer"},"messages":{"description":"Conversation turns. See Anthropic Messages API docs for the full content-block taxonomy.","items":{"$ref":"#/components/schemas/AnthropicMessageParam"},"type":"array"},"model":{"description":"Anthropic model identifier (e.g. `claude-sonnet-4-5`, `claude-opus-4-7`).","type":"string"},"stream":{"description":"On the Comfy Router route `POST /v2/models/anthropic/{model}`, `stream` is INERT: Router SETTLES it to `false` before dispatch and always returns the completed message as one JSON document. On the v1 `POST /proxy/anthropic/v1/messages` route, `true` makes the response a `text/event-stream` of Anthropic message events instead of a single JSON body. Send `stream` false or omit it on Router; the `text/event-stream` half of the `/proxy/` operation's 200 has no Router counterpart.","type":"boolean"},"system":{"description":"Top-level system prompt. Either a string or an array of content blocks; both reach Anthropic unchanged."}},"required":["max_tokens","messages"],"type":"object"}}}},"responses":{"200":{"description":"OK - the model's native JSON output, returned unchanged; the schema describes the provider's terminal result document as Router returns it.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AnthropicCreateMessageResponse"},{"properties":{"content":{"description":"The reply's content blocks, in order. Present on every completed message; empty when the turn produced nothing.","items":{"additionalProperties":true,"description":"One Messages API content block. `type` names the block's kind and decides which sibling fields it carries; unknown kinds pass through unchanged.","properties":{"text":{"description":"The block's text. Present on `text` blocks and absent on every other kind.","type":"string"},"type":{"description":"The block kind. `text` is the one that carries `text`; `thinking`, `redacted_thinking`, `tool_use`, `server_tool_use` and the tool-result blocks are the others Anthropic sends today, and the list is open.","type":"string"}},"type":"object"},"type":"array"}},"required":["content"],"type":"object"}],"description":"Comfy Router output schema for the Anthropic Claude models: the non-streaming Messages API document `POST /proxy/anthropic/v1/messages` answers with, forwarded unchanged. The operation is DIRECT RETURN — `routerresult/classification.go` records `{provider: anthropic, endpoint: /v1/messages}` as `ReturnModeDirect` with no poll route, because `messagesProxy`'s `ModifyResponse` reads `usage` off the finished body and meters it synchronously through `TrackUsage` — so the body a caller receives is the completed message on the original call, never a task handle.\nRouter CAPTURES rather than streams. `stream` is a settled field for this operation (`routerSettledBoolFields`, server/middleware): a Router request naming `stream` is forwarded with it set to FALSE, so a Router caller always receives this single JSON document and never the `text/event-stream` of message events the `/proxy/` route serves when `stream: true`. Send `stream` false or omit it; the `text/event-stream` half of the `/proxy/` operation's 200 has no Router counterpart.\nThe reply text is at `content[].text`. `content` is the Messages API block list and it is ALWAYS present on a completed message, but it is not uniformly text: a block carries `type`, and only `text` blocks carry `text`. `thinking`, `tool_use` and the server-tool blocks are legitimate members that carry no `text` at all, so a caller must select on `type` rather than read `content[0].text` — and an empty `content` is what a request that generated nothing looks like. The sibling top-level fields are NOT the result: `stop_reason` and `usage` are populated on a turn that emitted no content, and `model` is an echo of the request.","example":{"content":[{"text":"ok","type":"text"}],"id":"msg_01ExampleInvalidPlaceholder","model":"claude-haiku-4-5-20251001","role":"assistant","stop_reason":"end_turn","stop_sequence":null,"type":"message","usage":{"input_tokens":16,"output_tokens":3}}}}}}}}}},"components":{"schemas":{"AnthropicCacheCreationUsage":{"description":"Per-TTL breakdown of cache-write input tokens for an Anthropic Messages API call.","properties":{"ephemeral_1h_input_tokens":{"type":"integer"},"ephemeral_5m_input_tokens":{"type":"integer"}},"type":"object"},"AnthropicCreateMessageResponse":{"additionalProperties":true,"description":"JSON shape of a non-streaming Messages API response. Most fields pass through; the proxy reads `usage` for billing.","properties":{"id":{"type":"string"},"model":{"type":"string"},"role":{"type":"string"},"stop_reason":{"nullable":true,"type":"string"},"stop_sequence":{"nullable":true,"type":"string"},"type":{"type":"string"},"usage":{"$ref":"#/components/schemas/AnthropicMessagesUsage"}},"type":"object"},"AnthropicMessageParam":{"additionalProperties":true,"description":"A single conversation turn. The proxy only reads `role` and `content` (string or array of content blocks) for prompt capture; additional fields pass through.","properties":{"content":{"description":"Either a string shorthand or an array of content blocks (text, image, document, tool_use, tool_result, ...)."},"role":{"enum":["user","assistant"],"type":"string"}},"required":["role","content"],"type":"object"},"AnthropicMessagesUsage":{"description":"Token usage for an Anthropic Messages API call.","properties":{"cache_creation":{"$ref":"#/components/schemas/AnthropicCacheCreationUsage"},"cache_creation_input_tokens":{"type":"integer"},"cache_read_input_tokens":{"type":"integer"},"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"}},"type":"object"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"x-comfy-router-model-id":"anthropic/claude-haiku-4-5-20251001","x-comfy-input-schema-authored":true,"x-comfy-output-schema-authored":true,"x-comfy-router-input-modalities":["text","image"],"x-comfy-router-output-modalities":["text"]}
