{"openapi":"3.0.2","info":{"title":"openrouter/chat-completions","description":"The request body Comfy Router accepts for the model \"openrouter/chat-completions\", 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":"f1eec10bd0b2"},"paths":{"/v2/models/openrouter/chat-completions":{"post":{"operationId":"runRouterModel","summary":"Run openrouter/chat-completions synchronously.","security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"Chat completion request parameters.\n\n`model` is CALLER-CHOSEN and is not resolved by Comfy Router: the Router model ID `openrouter/chat-completions` names this operation, not a model, and whatever you put in `model` (or in the `models` fallback list) is forwarded to OpenRouter unchanged. Use OpenRouter's own model IDs - `anthropic/claude-sonnet-4.5`, `openai/gpt-5` - which carry characters a `{provider}/{model}` Router ID cannot spell, which is why the operation rather than the model is what Router enumerates. A request with no `model` is rejected with a 400 — and `models` alone does NOT satisfy that: the fallback list is forwarded, but the attribution model is read from `model`, so send `model` and use `models` to say what to fall back to.\n\n`stream` is refused on the `/proxy/` route (`stream: true` is a 400). On Comfy Router it is honoured only while stream-direct is enabled for this model, and the response is then OpenRouter's own `text/event-stream` of chat-completion chunks. Otherwise Comfy Router forces it to `false` on the forwarded request and serves the completed JSON document.","properties":{"cache_control":{"$ref":"#/components/schemas/OpenRouterAnthropicCacheControlDirective"},"debug":{"$ref":"#/components/schemas/OpenRouterChatDebugOptions"},"frequency_penalty":{"description":"Frequency penalty (-2.0 to 2.0)","format":"double","nullable":true,"type":"number"},"image_config":{"$ref":"#/components/schemas/OpenRouterImageConfig"},"logit_bias":{"additionalProperties":{"format":"double","type":"number"},"description":"Token logit bias adjustments","nullable":true,"type":"object"},"logprobs":{"description":"Return log probabilities","nullable":true,"type":"boolean"},"max_completion_tokens":{"description":"Maximum tokens in completion","nullable":true,"type":"integer"},"max_tokens":{"description":"Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16.","nullable":true,"type":"integer"},"messages":{"description":"List of messages for the conversation","items":{"$ref":"#/components/schemas/OpenRouterChatMessages"},"type":"array"},"metadata":{"additionalProperties":{"type":"string"},"description":"Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)","type":"object"},"modalities":{"description":"Output modalities for the response. Supported values are \"text\", \"image\", and \"audio\".","items":{"$ref":"#/components/schemas/OpenRouterChatRequestModalitiesItems"},"type":"array"},"model":{"$ref":"#/components/schemas/OpenRouterModelName"},"models":{"$ref":"#/components/schemas/OpenRouterChatModelNames"},"parallel_tool_calls":{"description":"Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response.","nullable":true,"type":"boolean"},"plugins":{"description":"Plugins you want to enable for this request, including their settings.","items":{"$ref":"#/components/schemas/OpenRouterChatRequestPluginsItems"},"type":"array"},"presence_penalty":{"description":"Presence penalty (-2.0 to 2.0)","format":"double","nullable":true,"type":"number"},"provider":{"$ref":"#/components/schemas/OpenRouterProviderPreferences"},"reasoning":{"$ref":"#/components/schemas/OpenRouterChatRequestReasoning"},"response_format":{"$ref":"#/components/schemas/OpenRouterChatRequestResponseFormat"},"route":{"description":"Any type"},"seed":{"description":"Random seed for deterministic outputs","nullable":true,"type":"integer"},"service_tier":{"description":"The service tier to use for processing this request.","oneOf":[{"$ref":"#/components/schemas/OpenRouterChatRequestServiceTier"}]},"session_id":{"description":"A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.","type":"string"},"stop":{"$ref":"#/components/schemas/OpenRouterChatRequestStop"},"stop_server_tools_when":{"$ref":"#/components/schemas/OpenRouterStopServerToolsWhen"},"stream":{"default":false,"description":"Honoured on Comfy Router when stream-direct is enabled for this model; the response is then OpenRouter's own `text/event-stream` of chat-completion chunks, with `usage` (including `cost`) on the final chunk. Otherwise settled to false. Refused with a 400 on POST /proxy/openrouter/api/v1/chat/completions.","type":"boolean"},"stream_options":{"$ref":"#/components/schemas/OpenRouterChatStreamOptions"},"temperature":{"description":"Sampling temperature (0-2)","format":"double","nullable":true,"type":"number"},"tool_choice":{"$ref":"#/components/schemas/OpenRouterChatToolChoice"},"tools":{"description":"Available tools for function calling","items":{"$ref":"#/components/schemas/OpenRouterChatFunctionTool"},"type":"array"},"top_logprobs":{"description":"Number of top log probabilities to return (0-20)","nullable":true,"type":"integer"},"top_p":{"description":"Nucleus sampling parameter (0-1)","format":"double","nullable":true,"type":"number"},"trace":{"$ref":"#/components/schemas/OpenRouterTraceConfig"},"user":{"description":"Unique user identifier","type":"string"}},"required":["messages"],"title":"ChatRequest","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":{"description":"Chat completion response, forwarded from OpenRouter unchanged. `model` names the model OpenRouter actually ran, which is the caller's `model` unless a `models` fallback list selected another one. `usage.cost` is what Comfy meters the call on.","example":{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"ok"}}],"created":1750000000,"id":"gen-0000000000-examplecompletion","model":"anthropic/claude-sonnet-4.5","object":"chat.completion","system_fingerprint":null,"usage":{"completion_tokens":128,"cost":0.00123,"prompt_tokens":42,"total_tokens":170}},"properties":{"choices":{"description":"List of completion choices","items":{"$ref":"#/components/schemas/OpenRouterChatChoice"},"type":"array"},"created":{"description":"Unix timestamp of creation","type":"integer"},"id":{"description":"Unique completion identifier","type":"string"},"model":{"description":"Model used for completion","type":"string"},"object":{"$ref":"#/components/schemas/OpenRouterChatResultObject"},"openrouter_metadata":{"$ref":"#/components/schemas/OpenRouterMetadata"},"service_tier":{"description":"The service tier used by the upstream provider for this request","nullable":true,"type":"string"},"system_fingerprint":{"description":"System fingerprint","nullable":true,"type":"string"},"usage":{"$ref":"#/components/schemas/OpenRouterChatUsage"}},"required":["choices","created","id","model","object","system_fingerprint"],"title":"ChatResult","type":"object"}}}}}}}},"components":{"schemas":{"ImageGenerationServerTool_OpenRouter":{"description":"OpenRouter built-in server tool: generates images from text prompts using an image generation model","properties":{"parameters":{"$ref":"#/components/schemas/OpenRouterImageGenerationServerToolConfig"},"type":{"$ref":"#/components/schemas/OpenRouterImageGenerationServerToolOpenRouterType"}},"required":["type"],"title":"ImageGenerationServerTool_OpenRouter","type":"object"},"OpenRouterAnthropicCacheControlDirective":{"description":"Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.","properties":{"ttl":{"$ref":"#/components/schemas/OpenRouterAnthropicCacheControlTtl"},"type":{"$ref":"#/components/schemas/OpenRouterAnthropicCacheControlDirectiveType"}},"required":["type"],"title":"AnthropicCacheControlDirective","type":"object"},"OpenRouterAnthropicCacheControlDirectiveType":{"enum":["ephemeral"],"title":"AnthropicCacheControlDirectiveType","type":"string"},"OpenRouterAnthropicCacheControlTtl":{"enum":["5m","1h"],"title":"AnthropicCacheControlTtl","type":"string"},"OpenRouterBigNumberUnion":{"description":"Price per million prompt tokens","title":"BigNumberUnion","type":"string"},"OpenRouterChatAssistantImages":{"description":"Generated images from image generation models","items":{"$ref":"#/components/schemas/OpenRouterChatAssistantImagesItems"},"title":"ChatAssistantImages","type":"array"},"OpenRouterChatAssistantImagesItems":{"properties":{"image_url":{"$ref":"#/components/schemas/OpenRouterChatAssistantImagesItemsImageUrl"}},"required":["image_url"],"title":"ChatAssistantImagesItems","type":"object"},"OpenRouterChatAssistantImagesItemsImageUrl":{"properties":{"url":{"description":"URL or base64-encoded data of the generated image","type":"string"}},"required":["url"],"title":"ChatAssistantImagesItemsImageUrl","type":"object"},"OpenRouterChatAssistantMessage":{"description":"Assistant message for requests and responses","properties":{"audio":{"$ref":"#/components/schemas/OpenRouterChatAudioOutput"},"content":{"$ref":"#/components/schemas/OpenRouterChatMessagesDiscriminatorMappingAssistantContent"},"images":{"$ref":"#/components/schemas/OpenRouterChatAssistantImages"},"name":{"description":"Optional name for the assistant","type":"string"},"reasoning":{"description":"Reasoning output","nullable":true,"type":"string"},"reasoning_details":{"$ref":"#/components/schemas/OpenRouterChatReasoningDetails"},"refusal":{"description":"Refusal message if content was refused","nullable":true,"type":"string"},"tool_calls":{"description":"Tool calls made by the assistant","items":{"$ref":"#/components/schemas/OpenRouterChatToolCall"},"type":"array"}},"title":"ChatAssistantMessage","type":"object"},"OpenRouterChatAudioOutput":{"description":"Audio output data or reference","properties":{"data":{"description":"Base64 encoded audio data","type":"string"},"expires_at":{"description":"Audio expiration timestamp","type":"integer"},"id":{"description":"Audio output identifier","type":"string"},"transcript":{"description":"Audio transcript","type":"string"}},"title":"ChatAudioOutput","type":"object"},"OpenRouterChatChoice":{"description":"Chat completion choice","properties":{"finish_reason":{"$ref":"#/components/schemas/OpenRouterChatFinishReasonEnum"},"index":{"description":"Choice index","type":"integer"},"logprobs":{"allOf":[{"$ref":"#/components/schemas/OpenRouterChatTokenLogprobs"}],"nullable":true},"message":{"$ref":"#/components/schemas/OpenRouterChatAssistantMessage"}},"required":["finish_reason","index","message"],"title":"ChatChoice","type":"object"},"OpenRouterChatContentCacheControl":{"description":"Cache control for the content part","properties":{"ttl":{"$ref":"#/components/schemas/OpenRouterAnthropicCacheControlTtl"},"type":{"$ref":"#/components/schemas/OpenRouterChatContentCacheControlType"}},"required":["type"],"title":"ChatContentCacheControl","type":"object"},"OpenRouterChatContentCacheControlType":{"enum":["ephemeral"],"title":"ChatContentCacheControlType","type":"string"},"OpenRouterChatContentItems":{"description":"Content part for chat completion messages","oneOf":[{"description":"File content part for document processing","properties":{"file":{"$ref":"#/components/schemas/OpenRouterChatContentItemsDiscriminatorMappingFileFile"},"type":{"description":"Discriminator value: file","enum":["file"],"type":"string"}},"required":["type","file"],"type":"object"},{"description":"Image content part for vision models","properties":{"image_url":{"$ref":"#/components/schemas/OpenRouterChatContentItemsDiscriminatorMappingImageUrlImageUrl"},"type":{"description":"Discriminator value: image_url","enum":["image_url"],"type":"string"}},"required":["type","image_url"],"type":"object"},{"description":"Audio input content part. Supported audio formats vary by provider.","properties":{"input_audio":{"$ref":"#/components/schemas/OpenRouterChatContentItemsDiscriminatorMappingInputAudioInputAudio"},"type":{"description":"Discriminator value: input_audio","enum":["input_audio"],"type":"string"}},"required":["type","input_audio"],"type":"object"},{"description":"Video input content part (legacy format - deprecated)","properties":{"type":{"$ref":"#/components/schemas/OpenRouterLegacyChatContentVideoType"},"video_url":{"$ref":"#/components/schemas/OpenRouterChatContentVideoInput"}},"required":["type","video_url"],"type":"object"},{"description":"Text content part","properties":{"cache_control":{"$ref":"#/components/schemas/OpenRouterChatContentCacheControl"},"text":{"type":"string"},"type":{"$ref":"#/components/schemas/OpenRouterChatContentTextType"}},"required":["type","text"],"type":"object"},{"description":"Video input content part","properties":{"type":{"$ref":"#/components/schemas/OpenRouterChatContentVideoType"},"video_url":{"$ref":"#/components/schemas/OpenRouterChatContentVideoInput"}},"required":["type","video_url"],"type":"object"}],"title":"ChatContentItems"},"OpenRouterChatContentItemsDiscriminatorMappingFileFile":{"properties":{"file_data":{"description":"File content as base64 data URL or URL","type":"string"},"file_id":{"description":"File ID for previously uploaded files","type":"string"},"filename":{"description":"Original filename","type":"string"}},"title":"ChatContentItemsDiscriminatorMappingFileFile","type":"object"},"OpenRouterChatContentItemsDiscriminatorMappingImageUrlImageUrl":{"properties":{"detail":{"$ref":"#/components/schemas/OpenRouterChatContentItemsDiscriminatorMappingImageUrlImageUrlDetail"},"url":{"description":"URL of the image (data: URLs supported)","type":"string"}},"required":["url"],"title":"ChatContentItemsDiscriminatorMappingImageUrlImageUrl","type":"object"},"OpenRouterChatContentItemsDiscriminatorMappingImageUrlImageUrlDetail":{"description":"Image detail level for vision models","enum":["auto","low","high"],"title":"ChatContentItemsDiscriminatorMappingImageUrlImageUrlDetail","type":"string"},"OpenRouterChatContentItemsDiscriminatorMappingInputAudioInputAudio":{"properties":{"data":{"description":"Base64 encoded audio data","type":"string"},"format":{"description":"Audio format (e.g., wav, mp3, flac, m4a, ogg, aiff, aac, pcm16, pcm24). Supported formats vary by provider.","type":"string"}},"required":["data","format"],"title":"ChatContentItemsDiscriminatorMappingInputAudioInputAudio","type":"object"},"OpenRouterChatContentText":{"description":"Text content part","properties":{"cache_control":{"$ref":"#/components/schemas/OpenRouterChatContentCacheControl"},"text":{"type":"string"},"type":{"$ref":"#/components/schemas/OpenRouterChatContentTextType"}},"required":["text","type"],"title":"ChatContentText","type":"object"},"OpenRouterChatContentTextType":{"enum":["text"],"title":"ChatContentTextType","type":"string"},"OpenRouterChatContentVideoInput":{"description":"Video input object","properties":{"url":{"description":"URL of the video (data: URLs supported)","type":"string"}},"required":["url"],"title":"ChatContentVideoInput","type":"object"},"OpenRouterChatContentVideoType":{"enum":["video_url"],"title":"ChatContentVideoType","type":"string"},"OpenRouterChatDebugOptions":{"description":"Debug options for inspecting request transformations (streaming only)","properties":{"echo_upstream_body":{"description":"If true, includes the transformed upstream request body in a debug chunk at the start of the stream. Only works with streaming mode.","type":"boolean"}},"title":"ChatDebugOptions","type":"object"},"OpenRouterChatFinishReasonEnum":{"enum":["tool_calls","stop","length","content_filter","error"],"title":"ChatFinishReasonEnum","type":"string"},"OpenRouterChatFunctionTool":{"description":"Tool definition for function calling (regular function or OpenRouter built-in server tool)","oneOf":[{"$ref":"#/components/schemas/OpenRouterChatFunctionTool0"},{"$ref":"#/components/schemas/OpenRouterDatetimeServerTool"},{"$ref":"#/components/schemas/ImageGenerationServerTool_OpenRouter"},{"$ref":"#/components/schemas/OpenRouterChatSearchModelsServerTool"},{"$ref":"#/components/schemas/OpenRouterWebFetchServerTool"},{"$ref":"#/components/schemas/OpenRouterWebSearchServerTool"},{"$ref":"#/components/schemas/OpenRouterChatWebSearchShorthand"}],"title":"ChatFunctionTool"},"OpenRouterChatFunctionTool0":{"properties":{"cache_control":{"$ref":"#/components/schemas/OpenRouterChatContentCacheControl"},"function":{"$ref":"#/components/schemas/OpenRouterChatFunctionToolOneOf0Function"},"type":{"$ref":"#/components/schemas/OpenRouterChatFunctionToolOneOf0Type"}},"required":["function","type"],"title":"ChatFunctionTool0","type":"object"},"OpenRouterChatFunctionToolOneOf0Function":{"description":"Function definition for tool calling","properties":{"description":{"description":"Function description for the model","type":"string"},"name":{"description":"Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)","type":"string"},"parameters":{"additionalProperties":{"description":"Any type"},"description":"Function parameters as JSON Schema object","type":"object"},"strict":{"description":"Enable strict schema adherence","nullable":true,"type":"boolean"}},"required":["name"],"title":"ChatFunctionToolOneOf0Function","type":"object"},"OpenRouterChatFunctionToolOneOf0Type":{"enum":["function"],"title":"ChatFunctionToolOneOf0Type","type":"string"},"OpenRouterChatJsonSchemaConfig":{"description":"JSON Schema configuration object","properties":{"description":{"description":"Schema description for the model","type":"string"},"name":{"description":"Schema name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)","type":"string"},"schema":{"additionalProperties":{"description":"Any type"},"description":"JSON Schema object","type":"object"},"strict":{"description":"Enable strict schema adherence","nullable":true,"type":"boolean"}},"required":["name"],"title":"ChatJsonSchemaConfig","type":"object"},"OpenRouterChatMessages":{"description":"Chat completion message with role-based discrimination","oneOf":[{"description":"Assistant message for requests and responses","properties":{"audio":{"$ref":"#/components/schemas/OpenRouterChatAudioOutput"},"content":{"$ref":"#/components/schemas/OpenRouterChatMessagesDiscriminatorMappingAssistantContent"},"images":{"$ref":"#/components/schemas/OpenRouterChatAssistantImages"},"name":{"description":"Optional name for the assistant","type":"string"},"reasoning":{"description":"Reasoning output","nullable":true,"type":"string"},"reasoning_details":{"$ref":"#/components/schemas/OpenRouterChatReasoningDetails"},"refusal":{"description":"Refusal message if content was refused","nullable":true,"type":"string"},"role":{"description":"Discriminator value: assistant","enum":["assistant"],"type":"string"},"tool_calls":{"description":"Tool calls made by the assistant","items":{"$ref":"#/components/schemas/OpenRouterChatToolCall"},"type":"array"}},"required":["role"],"type":"object"},{"description":"Developer message","properties":{"content":{"$ref":"#/components/schemas/OpenRouterChatMessagesDiscriminatorMappingDeveloperContent"},"name":{"description":"Optional name for the developer message","type":"string"},"role":{"description":"Discriminator value: developer","enum":["developer"],"type":"string"}},"required":["role","content"],"type":"object"},{"description":"System message for setting behavior","properties":{"content":{"$ref":"#/components/schemas/OpenRouterChatSystemMessageContent"},"name":{"description":"Optional name for the system message","type":"string"},"role":{"$ref":"#/components/schemas/OpenRouterChatSystemMessageRole"}},"required":["role","content"],"type":"object"},{"description":"Tool response message","properties":{"content":{"$ref":"#/components/schemas/OpenRouterChatToolMessageContent"},"role":{"$ref":"#/components/schemas/OpenRouterChatToolMessageRole"},"tool_call_id":{"description":"ID of the assistant message tool call this message responds to","type":"string"}},"required":["role","content","tool_call_id"],"type":"object"},{"description":"User message","properties":{"content":{"$ref":"#/components/schemas/OpenRouterChatUserMessageContent"},"name":{"description":"Optional name for the user","type":"string"},"role":{"$ref":"#/components/schemas/OpenRouterChatUserMessageRole"}},"required":["role","content"],"type":"object"}],"title":"ChatMessages"},"OpenRouterChatMessagesDiscriminatorMappingAssistantContent":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/OpenRouterChatMessagesDiscriminatorMappingAssistantContent1"},{"description":"Any type"}],"description":"Assistant message content","title":"ChatMessagesDiscriminatorMappingAssistantContent"},"OpenRouterChatMessagesDiscriminatorMappingAssistantContent1":{"items":{"$ref":"#/components/schemas/OpenRouterChatContentItems"},"title":"ChatMessagesDiscriminatorMappingAssistantContent1","type":"array"},"OpenRouterChatMessagesDiscriminatorMappingDeveloperContent":{"description":"Developer message content","oneOf":[{"type":"string"},{"$ref":"#/components/schemas/OpenRouterChatMessagesDiscriminatorMappingDeveloperContent1"}],"title":"ChatMessagesDiscriminatorMappingDeveloperContent"},"OpenRouterChatMessagesDiscriminatorMappingDeveloperContent1":{"items":{"$ref":"#/components/schemas/OpenRouterChatContentText"},"title":"ChatMessagesDiscriminatorMappingDeveloperContent1","type":"array"},"OpenRouterChatModelNames":{"description":"Models to use for completion","items":{"$ref":"#/components/schemas/OpenRouterModelName"},"title":"ChatModelNames","type":"array"},"OpenRouterChatNamedToolChoice":{"description":"Named tool choice for specific function","properties":{"function":{"$ref":"#/components/schemas/OpenRouterChatNamedToolChoiceFunction"},"type":{"$ref":"#/components/schemas/OpenRouterChatNamedToolChoiceType"}},"required":["function","type"],"title":"ChatNamedToolChoice","type":"object"},"OpenRouterChatNamedToolChoiceFunction":{"properties":{"name":{"description":"Function name to call","type":"string"}},"required":["name"],"title":"ChatNamedToolChoiceFunction","type":"object"},"OpenRouterChatNamedToolChoiceType":{"enum":["function"],"title":"ChatNamedToolChoiceType","type":"string"},"OpenRouterChatReasoningDetails":{"description":"Reasoning details for extended thinking models","items":{"$ref":"#/components/schemas/OpenRouterReasoningDetailUnion"},"title":"ChatReasoningDetails","type":"array"},"OpenRouterChatReasoningSummaryVerbosityEnum":{"enum":["auto","concise","detailed"],"title":"ChatReasoningSummaryVerbosityEnum","type":"string"},"OpenRouterChatRequestModalitiesItems":{"enum":["text","image","audio"],"title":"ChatRequestModalitiesItems","type":"string"},"OpenRouterChatRequestPluginsItems":{"oneOf":[{"description":"auto-router variant","properties":{"allowed_models":{"description":"List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list.","items":{"type":"string"},"type":"array"},"enabled":{"description":"Set to false to disable the auto-router plugin for this request. Defaults to true.","type":"boolean"},"id":{"description":"Discriminator value: auto-router","enum":["auto-router"],"type":"string"}},"required":["id"],"type":"object"},{"description":"context-compression variant","properties":{"enabled":{"description":"Set to false to disable the context-compression plugin for this request. Defaults to true.","type":"boolean"},"engine":{"$ref":"#/components/schemas/OpenRouterContextCompressionEngine"},"id":{"description":"Discriminator value: context-compression","enum":["context-compression"],"type":"string"}},"required":["id"],"type":"object"},{"description":"file-parser variant","properties":{"enabled":{"description":"Set to false to disable the file-parser plugin for this request. Defaults to true.","type":"boolean"},"id":{"description":"Discriminator value: file-parser","enum":["file-parser"],"type":"string"},"pdf":{"$ref":"#/components/schemas/OpenRouterPDFParserOptions"}},"required":["id"],"type":"object"},{"description":"fusion variant","properties":{"analysis_models":{"description":"Slugs of models to run in parallel as the \"expert panel\" the judge analyzes. Each model receives the same user prompt with web_search + web_fetch enabled. Capped at 8 models to bound cost amplification. When omitted, defaults to the Quality preset from the /labs/fusion UI (~anthropic/claude-opus-latest, ~openai/gpt-latest, ~google/gemini-pro-latest).","items":{"type":"string"},"type":"array"},"enabled":{"description":"Set to false to disable the fusion plugin for this request. Defaults to true.","type":"boolean"},"id":{"description":"Discriminator value: fusion","enum":["fusion"],"type":"string"},"max_tool_calls":{"description":"Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16.","type":"integer"},"model":{"description":"Slug of the model that performs both the judge step (with web_search + web_fetch) and the final synthesis. When omitted, defaults to the first model in the Quality preset.","type":"string"}},"required":["id"],"type":"object"},{"description":"moderation variant","properties":{"id":{"description":"Discriminator value: moderation","enum":["moderation"],"type":"string"}},"required":["id"],"type":"object"},{"description":"pareto-router variant","properties":{"enabled":{"description":"Set to false to disable the pareto-router plugin for this request. Defaults to true.","type":"boolean"},"id":{"description":"Discriminator value: pareto-router","enum":["pareto-router"],"type":"string"},"min_coding_score":{"description":"Minimum desired coding score between 0 and 1, where 1 is best. Higher values select from stronger coding models (sourced from Artificial Analysis coding percentiles). Maps internally to one of three tiers (low, medium, high). Omit to use the router default tier.","format":"double","type":"number"}},"required":["id"],"type":"object"},{"description":"response-healing variant","properties":{"enabled":{"description":"Set to false to disable the response-healing plugin for this request. Defaults to true.","type":"boolean"},"id":{"description":"Discriminator value: response-healing","enum":["response-healing"],"type":"string"}},"required":["id"],"type":"object"},{"description":"web variant","properties":{"enabled":{"description":"Set to false to disable the web-search plugin for this request. Defaults to true.","type":"boolean"},"engine":{"$ref":"#/components/schemas/OpenRouterWebSearchEngine"},"exclude_domains":{"description":"A list of domains to exclude from web search results. Supports wildcards (e.g. \"*.substack.com\") and path filtering (e.g. \"openai.com/blog\").","items":{"type":"string"},"type":"array"},"id":{"$ref":"#/components/schemas/OpenRouterWebSearchPluginId"},"include_domains":{"description":"A list of domains to restrict web search results to. Supports wildcards (e.g. \"*.substack.com\") and path filtering (e.g. \"openai.com/blog\").","items":{"type":"string"},"type":"array"},"max_results":{"type":"integer"},"max_uses":{"description":"Maximum number of times the model can invoke web search in a single turn. Passed through to native providers that support it (e.g. Anthropic).","type":"integer"},"search_prompt":{"type":"string"},"user_location":{"$ref":"#/components/schemas/OpenRouterWebSearchPluginUserLocation"}},"required":["id"],"type":"object"},{"description":"web-fetch variant","properties":{"allowed_domains":{"description":"Only fetch from these domains.","items":{"type":"string"},"type":"array"},"blocked_domains":{"description":"Never fetch from these domains.","items":{"type":"string"},"type":"array"},"id":{"$ref":"#/components/schemas/OpenRouterWebFetchPluginId"},"max_content_tokens":{"description":"Maximum content length in approximate tokens. Content exceeding this limit is truncated.","type":"integer"},"max_uses":{"description":"Maximum number of web fetches per request. Once exceeded, the tool returns an error.","type":"integer"}},"required":["id"],"type":"object"}],"title":"ChatRequestPluginsItems"},"OpenRouterChatRequestReasoning":{"description":"Configuration options for reasoning models","properties":{"effort":{"description":"Constrains effort on reasoning for reasoning models","oneOf":[{"$ref":"#/components/schemas/OpenRouterChatRequestReasoningEffort"}]},"summary":{"$ref":"#/components/schemas/OpenRouterChatReasoningSummaryVerbosityEnum"}},"title":"ChatRequestReasoning","type":"object"},"OpenRouterChatRequestReasoningEffort":{"description":"Constrains effort on reasoning for reasoning models","enum":["xhigh","high","medium","low","minimal","none"],"title":"ChatRequestReasoningEffort","type":"string"},"OpenRouterChatRequestResponseFormat":{"description":"Response format configuration","oneOf":[{"description":"Custom grammar response format","properties":{"grammar":{"description":"Custom grammar for text generation","type":"string"},"type":{"description":"Discriminator value: grammar","enum":["grammar"],"type":"string"}},"required":["type","grammar"],"type":"object"},{"description":"JSON object response format","properties":{"type":{"$ref":"#/components/schemas/OpenRouterFormatJsonObjectConfigType"}},"required":["type"],"type":"object"},{"description":"JSON Schema response format for structured outputs","properties":{"json_schema":{"$ref":"#/components/schemas/OpenRouterChatJsonSchemaConfig"},"type":{"description":"Discriminator value: json_schema","enum":["json_schema"],"type":"string"}},"required":["type","json_schema"],"type":"object"},{"description":"Python code response format","properties":{"type":{"description":"Discriminator value: python","enum":["python"],"type":"string"}},"required":["type"],"type":"object"},{"description":"Default text response format","properties":{"type":{"description":"Discriminator value: text","enum":["text"],"type":"string"}},"required":["type"],"type":"object"}],"title":"ChatRequestResponseFormat"},"OpenRouterChatRequestServiceTier":{"description":"The service tier to use for processing this request.","enum":["auto","default","flex","priority","scale"],"title":"ChatRequestServiceTier","type":"string"},"OpenRouterChatRequestStop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"description":"Any type"}],"description":"Stop sequences (up to 4)","title":"ChatRequestStop"},"OpenRouterChatResultObject":{"enum":["chat.completion"],"title":"ChatResultObject","type":"string"},"OpenRouterChatSearchModelsServerTool":{"description":"OpenRouter built-in server tool: searches and filters AI models available on OpenRouter","properties":{"parameters":{"$ref":"#/components/schemas/OpenRouterSearchModelsServerToolConfig"},"type":{"$ref":"#/components/schemas/OpenRouterChatSearchModelsServerToolType"}},"required":["type"],"title":"ChatSearchModelsServerTool","type":"object"},"OpenRouterChatSearchModelsServerToolType":{"enum":["openrouter:experimental__search_models"],"title":"ChatSearchModelsServerToolType","type":"string"},"OpenRouterChatStreamOptions":{"description":"Streaming configuration options","properties":{"include_usage":{"description":"Deprecated: This field has no effect. Full usage details are always included.","type":"boolean"}},"title":"ChatStreamOptions","type":"object"},"OpenRouterChatSystemMessageContent":{"description":"System message content","oneOf":[{"type":"string"},{"$ref":"#/components/schemas/OpenRouterChatSystemMessageContent1"}],"title":"ChatSystemMessageContent"},"OpenRouterChatSystemMessageContent1":{"items":{"$ref":"#/components/schemas/OpenRouterChatContentText"},"title":"ChatSystemMessageContent1","type":"array"},"OpenRouterChatSystemMessageRole":{"enum":["system"],"title":"ChatSystemMessageRole","type":"string"},"OpenRouterChatTokenLogprob":{"description":"Token log probability information","properties":{"bytes":{"description":"UTF-8 bytes of the token","items":{"type":"integer"},"nullable":true,"type":"array"},"logprob":{"description":"Log probability of the token","format":"double","type":"number"},"token":{"description":"The token","type":"string"},"top_logprobs":{"description":"Top alternative tokens with probabilities","items":{"$ref":"#/components/schemas/OpenRouterChatTokenLogprobTopLogprobsItems"},"type":"array"}},"required":["bytes","logprob","token","top_logprobs"],"title":"ChatTokenLogprob","type":"object"},"OpenRouterChatTokenLogprobTopLogprobsItems":{"properties":{"bytes":{"items":{"type":"integer"},"nullable":true,"type":"array"},"logprob":{"format":"double","type":"number"},"token":{"type":"string"}},"required":["bytes","logprob","token"],"title":"ChatTokenLogprobTopLogprobsItems","type":"object"},"OpenRouterChatTokenLogprobs":{"description":"Log probabilities for the completion","properties":{"content":{"description":"Log probabilities for content tokens","items":{"$ref":"#/components/schemas/OpenRouterChatTokenLogprob"},"nullable":true,"type":"array"},"refusal":{"description":"Log probabilities for refusal tokens","items":{"$ref":"#/components/schemas/OpenRouterChatTokenLogprob"},"nullable":true,"type":"array"}},"required":["content"],"title":"ChatTokenLogprobs","type":"object"},"OpenRouterChatToolCall":{"description":"Tool call made by the assistant","properties":{"function":{"$ref":"#/components/schemas/OpenRouterChatToolCallFunction"},"id":{"description":"Tool call identifier","type":"string"},"type":{"$ref":"#/components/schemas/OpenRouterChatToolCallType"}},"required":["function","id","type"],"title":"ChatToolCall","type":"object"},"OpenRouterChatToolCallFunction":{"properties":{"arguments":{"description":"Function arguments as JSON string","type":"string"},"name":{"description":"Function name to call","type":"string"}},"required":["arguments","name"],"title":"ChatToolCallFunction","type":"object"},"OpenRouterChatToolCallType":{"enum":["function"],"title":"ChatToolCallType","type":"string"},"OpenRouterChatToolChoice":{"description":"Tool choice configuration","oneOf":[{"$ref":"#/components/schemas/OpenRouterChatToolChoice0"},{"$ref":"#/components/schemas/OpenRouterChatToolChoice1"},{"$ref":"#/components/schemas/OpenRouterChatToolChoice2"},{"$ref":"#/components/schemas/OpenRouterChatNamedToolChoice"}],"title":"ChatToolChoice"},"OpenRouterChatToolChoice0":{"enum":["none"],"title":"ChatToolChoice0","type":"string"},"OpenRouterChatToolChoice1":{"enum":["auto"],"title":"ChatToolChoice1","type":"string"},"OpenRouterChatToolChoice2":{"enum":["required"],"title":"ChatToolChoice2","type":"string"},"OpenRouterChatToolMessageContent":{"description":"Tool response content","oneOf":[{"type":"string"},{"$ref":"#/components/schemas/OpenRouterChatToolMessageContent1"}],"title":"ChatToolMessageContent"},"OpenRouterChatToolMessageContent1":{"items":{"$ref":"#/components/schemas/OpenRouterChatContentItems"},"title":"ChatToolMessageContent1","type":"array"},"OpenRouterChatToolMessageRole":{"enum":["tool"],"title":"ChatToolMessageRole","type":"string"},"OpenRouterChatUsage":{"description":"Token usage statistics","properties":{"completion_tokens":{"description":"Number of tokens in the completion","type":"integer"},"completion_tokens_details":{"description":"Detailed completion token usage","oneOf":[{"$ref":"#/components/schemas/OpenRouterChatUsageCompletionTokensDetails"}]},"cost":{"description":"Cost of the completion","format":"double","nullable":true,"type":"number"},"cost_details":{"$ref":"#/components/schemas/OpenRouterCostDetails"},"is_byok":{"description":"Whether a request was made using a Bring Your Own Key configuration","type":"boolean"},"prompt_tokens":{"description":"Number of tokens in the prompt","type":"integer"},"prompt_tokens_details":{"description":"Detailed prompt token usage","oneOf":[{"$ref":"#/components/schemas/OpenRouterChatUsagePromptTokensDetails"}]},"total_tokens":{"description":"Total number of tokens","type":"integer"}},"required":["completion_tokens","prompt_tokens","total_tokens"],"title":"ChatUsage","type":"object"},"OpenRouterChatUsageCompletionTokensDetails":{"description":"Detailed completion token usage","properties":{"accepted_prediction_tokens":{"description":"Accepted prediction tokens","nullable":true,"type":"integer"},"audio_tokens":{"description":"Tokens used for audio output","nullable":true,"type":"integer"},"reasoning_tokens":{"description":"Tokens used for reasoning","nullable":true,"type":"integer"},"rejected_prediction_tokens":{"description":"Rejected prediction tokens","nullable":true,"type":"integer"}},"title":"ChatUsageCompletionTokensDetails","type":"object"},"OpenRouterChatUsagePromptTokensDetails":{"description":"Detailed prompt token usage","properties":{"audio_tokens":{"description":"Audio input tokens","type":"integer"},"cache_write_tokens":{"description":"Tokens written to cache. Only returned for models with explicit caching and cache write pricing.","type":"integer"},"cached_tokens":{"description":"Cached prompt tokens","type":"integer"},"video_tokens":{"description":"Video input tokens","type":"integer"}},"title":"ChatUsagePromptTokensDetails","type":"object"},"OpenRouterChatUserMessageContent":{"description":"User message content","oneOf":[{"type":"string"},{"$ref":"#/components/schemas/OpenRouterChatUserMessageContent1"}],"title":"ChatUserMessageContent"},"OpenRouterChatUserMessageContent1":{"items":{"$ref":"#/components/schemas/OpenRouterChatContentItems"},"title":"ChatUserMessageContent1","type":"array"},"OpenRouterChatUserMessageRole":{"enum":["user"],"title":"ChatUserMessageRole","type":"string"},"OpenRouterChatWebSearchShorthand":{"description":"Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search.","properties":{"allowed_domains":{"description":"Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, and most native providers (Anthropic, OpenAI, xAI). Not supported with Perplexity. Cannot be used with excluded_domains.","items":{"type":"string"},"type":"array"},"engine":{"$ref":"#/components/schemas/OpenRouterWebSearchEngineEnum"},"excluded_domains":{"description":"Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Anthropic, and xAI. Not supported with OpenAI (silently ignored) or Perplexity. Cannot be used with allowed_domains.","items":{"type":"string"},"type":"array"},"max_results":{"description":"Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search.","type":"integer"},"max_total_results":{"description":"Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified.","type":"integer"},"parameters":{"$ref":"#/components/schemas/OpenRouterWebSearchConfig"},"search_context_size":{"$ref":"#/components/schemas/OpenRouterSearchQualityLevel"},"type":{"$ref":"#/components/schemas/OpenRouterChatWebSearchShorthandType"},"user_location":{"$ref":"#/components/schemas/OpenRouterWebSearchUserLocationServerTool"}},"required":["type"],"title":"ChatWebSearchShorthand","type":"object"},"OpenRouterChatWebSearchShorthandType":{"enum":["web_search","web_search_preview","web_search_preview_2025_03_11","web_search_2025_08_26"],"title":"ChatWebSearchShorthandType","type":"string"},"OpenRouterContextCompressionEngine":{"description":"The compression engine to use. Defaults to \"middle-out\".","enum":["middle-out"],"title":"ContextCompressionEngine","type":"string"},"OpenRouterCostDetails":{"description":"Breakdown of upstream inference costs","properties":{"upstream_inference_completions_cost":{"format":"double","type":"number"},"upstream_inference_cost":{"format":"double","nullable":true,"type":"number"},"upstream_inference_prompt_cost":{"format":"double","type":"number"}},"required":["upstream_inference_completions_cost","upstream_inference_prompt_cost"],"title":"CostDetails","type":"object"},"OpenRouterDatetimeServerTool":{"description":"OpenRouter built-in server tool: returns the current date and time","properties":{"parameters":{"$ref":"#/components/schemas/OpenRouterDatetimeServerToolConfig"},"type":{"$ref":"#/components/schemas/OpenRouterDatetimeServerToolType"}},"required":["type"],"title":"DatetimeServerTool","type":"object"},"OpenRouterDatetimeServerToolConfig":{"description":"Configuration for the openrouter:datetime server tool","properties":{"timezone":{"description":"IANA timezone name (e.g. \"America/New_York\"). Defaults to UTC.","type":"string"}},"title":"DatetimeServerToolConfig","type":"object"},"OpenRouterDatetimeServerToolType":{"enum":["openrouter:datetime"],"title":"DatetimeServerToolType","type":"string"},"OpenRouterEndpointInfo":{"properties":{"model":{"type":"string"},"provider":{"type":"string"},"selected":{"type":"boolean"}},"required":["model","provider","selected"],"title":"EndpointInfo","type":"object"},"OpenRouterEndpointsMetadata":{"properties":{"available":{"items":{"$ref":"#/components/schemas/OpenRouterEndpointInfo"},"type":"array"},"total":{"type":"integer"}},"required":["available","total"],"title":"EndpointsMetadata","type":"object"},"OpenRouterFormatJsonObjectConfigType":{"enum":["json_object"],"title":"FormatJsonObjectConfigType","type":"string"},"OpenRouterImageConfig":{"anyOf":[{"additionalProperties":true,"properties":{"aspect_ratio":{"description":"Output aspect ratio, e.g. \"16:9\".","type":"string"},"background":{"description":"Background treatment for the generated image.","type":"string"},"moderation":{"description":"Moderation strength applied to image generation.","type":"string"},"output_compression":{"description":"Compression level for the encoded output.","type":"integer"},"output_format":{"description":"Encoding of the returned image, e.g. \"png\".","type":"string"},"quality":{"description":"Rendering quality preset.","type":"string"},"size":{"description":"Output size, e.g. \"1024x1024\".","type":"string"}},"type":"object"},{"type":"string"},{"format":"double","type":"number"},{"items":{"description":"Any type"},"type":"array"}],"title":"ImageConfig"},"OpenRouterImageGenerationServerToolConfig":{"description":"Configuration for the openrouter:image_generation server tool. Accepts all image_config params (aspect_ratio, quality, size, background, output_format, output_compression, moderation, etc.) plus a model field.","properties":{"model":{"description":"Which image generation model to use (e.g. \"openai/gpt-5-image\"). Defaults to \"openai/gpt-5-image\".","type":"string"}},"title":"ImageGenerationServerToolConfig","type":"object"},"OpenRouterImageGenerationServerToolOpenRouterType":{"enum":["openrouter:image_generation"],"title":"ImageGenerationServerToolOpenRouterType","type":"string"},"OpenRouterLegacyChatContentVideoType":{"enum":["input_video"],"title":"LegacyChatContentVideoType","type":"string"},"OpenRouterMetadata":{"properties":{"attempt":{"type":"integer"},"attempts":{"items":{"$ref":"#/components/schemas/OpenRouterRouterAttempt"},"type":"array"},"endpoints":{"$ref":"#/components/schemas/OpenRouterEndpointsMetadata"},"is_byok":{"type":"boolean"},"params":{"$ref":"#/components/schemas/OpenRouterRouterParams"},"pipeline":{"items":{"$ref":"#/components/schemas/OpenRouterPipelineStage"},"type":"array"},"region":{"nullable":true,"type":"string"},"requested":{"type":"string"},"strategy":{"$ref":"#/components/schemas/OpenRouterRoutingStrategy"},"summary":{"type":"string"}},"required":["attempt","endpoints","is_byok","region","requested","strategy","summary"],"title":"OpenRouterMetadata","type":"object"},"OpenRouterModelName":{"description":"Model to use for completion","title":"ModelName","type":"string"},"OpenRouterPDFParserEngine":{"description":"The engine to use for parsing PDF files. \"pdf-text\" is deprecated and automatically redirected to \"cloudflare-ai\".","oneOf":[{"$ref":"#/components/schemas/OpenRouterPdfParserEngine0"},{"$ref":"#/components/schemas/OpenRouterPdfParserEngine1"}],"title":"PDFParserEngine"},"OpenRouterPDFParserOptions":{"description":"Options for PDF parsing.","properties":{"engine":{"$ref":"#/components/schemas/OpenRouterPDFParserEngine"}},"title":"PDFParserOptions","type":"object"},"OpenRouterPdfParserEngine0":{"enum":["mistral-ocr","native","cloudflare-ai"],"title":"PdfParserEngine0","type":"string"},"OpenRouterPdfParserEngine1":{"enum":["pdf-text"],"title":"PdfParserEngine1","type":"string"},"OpenRouterPercentileLatencyCutoffs":{"description":"Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.","properties":{"p50":{"description":"Maximum p50 latency (seconds)","format":"double","nullable":true,"type":"number"},"p75":{"description":"Maximum p75 latency (seconds)","format":"double","nullable":true,"type":"number"},"p90":{"description":"Maximum p90 latency (seconds)","format":"double","nullable":true,"type":"number"},"p99":{"description":"Maximum p99 latency (seconds)","format":"double","nullable":true,"type":"number"}},"title":"PercentileLatencyCutoffs","type":"object"},"OpenRouterPercentileThroughputCutoffs":{"description":"Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred.","properties":{"p50":{"description":"Minimum p50 throughput (tokens/sec)","format":"double","nullable":true,"type":"number"},"p75":{"description":"Minimum p75 throughput (tokens/sec)","format":"double","nullable":true,"type":"number"},"p90":{"description":"Minimum p90 throughput (tokens/sec)","format":"double","nullable":true,"type":"number"},"p99":{"description":"Minimum p99 throughput (tokens/sec)","format":"double","nullable":true,"type":"number"}},"title":"PercentileThroughputCutoffs","type":"object"},"OpenRouterPipelineStage":{"properties":{"cost_usd":{"format":"double","nullable":true,"type":"number"},"data":{"additionalProperties":{"description":"Any type"},"type":"object"},"guardrail_id":{"type":"string"},"guardrail_scope":{"type":"string"},"name":{"type":"string"},"summary":{"type":"string"},"type":{"$ref":"#/components/schemas/OpenRouterPipelineStageType"}},"required":["name","type"],"title":"PipelineStage","type":"object"},"OpenRouterPipelineStageType":{"description":"Categorical kind of a pipeline stage. Multiple plugins can share a type (e.g. all guardrail-level plugins emit `guardrail`); the `name` field disambiguates which plugin emitted it.","enum":["guardrail","plugin","server_tools","response_healing","context_compression"],"title":"PipelineStageType","type":"string"},"OpenRouterPreferredMaxLatency":{"anyOf":[{"format":"double","type":"number"},{"$ref":"#/components/schemas/OpenRouterPercentileLatencyCutoffs"},{"description":"Any type"}],"description":"Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.","title":"PreferredMaxLatency"},"OpenRouterPreferredMinThroughput":{"anyOf":[{"format":"double","type":"number"},{"$ref":"#/components/schemas/OpenRouterPercentileThroughputCutoffs"},{"description":"Any type"}],"description":"Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.","title":"PreferredMinThroughput"},"OpenRouterProviderName":{"enum":["AkashML","AI21","AionLabs","Alibaba","Ambient","Baidu","Amazon Bedrock","Amazon Nova","Anthropic","Arcee AI","AtlasCloud","Avian","Azure","BaseTen","BytePlus","Black Forest Labs","Cerebras","Chutes","Cirrascale","Clarifai","Cloudflare","Cohere","Crucible","Crusoe","DeepInfra","DeepSeek","DekaLLM","Featherless","Fireworks","Friendli","GMICloud","Google","Google AI Studio","Groq","Hyperbolic","Inception","Inceptron","InferenceNet","Ionstream","Infermatic","Io Net","Inflection","Liquid","Mara","Mancer 2","Minimax","ModelRun","Mistral","Modular","Moonshot AI","Morph","NCompass","Nebius","Nex AGI","NextBit","Novita","Nvidia","OpenAI","OpenInference","Parasail","Poolside","Perceptron","Perplexity","Phala","Recraft","Reka","Relace","SambaNova","Seed","SiliconFlow","Sourceful","StepFun","Stealth","StreamLake","Switchpoint","Together","Upstage","Venice","WandB","Xiaomi","xAI","Z.AI","FakeProvider"],"title":"ProviderName","type":"string"},"OpenRouterProviderPreferences":{"description":"When multiple model providers are available, optionally indicate your routing preference.","properties":{"allow_fallbacks":{"description":"Whether to allow backup providers to serve requests\n- true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider.\n- false: use only the primary/custom provider, and return the upstream error if it's unavailable.\n","nullable":true,"type":"boolean"},"data_collection":{"description":"Data collection setting. If no available model provider meets the requirement, your request will return an error.\n- allow: (default) allow providers which store user data non-transiently and may train on it\n\n- deny: use only providers which do not collect user data.","oneOf":[{"$ref":"#/components/schemas/OpenRouterProviderPreferencesDataCollection"}]},"enforce_distillable_text":{"description":"Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.","nullable":true,"type":"boolean"},"ignore":{"description":"List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.","items":{"$ref":"#/components/schemas/OpenRouterProviderPreferencesIgnoreItems"},"nullable":true,"type":"array"},"max_price":{"$ref":"#/components/schemas/OpenRouterProviderPreferencesMaxPrice"},"only":{"description":"List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.","items":{"$ref":"#/components/schemas/OpenRouterProviderPreferencesOnlyItems"},"nullable":true,"type":"array"},"order":{"description":"An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.","items":{"$ref":"#/components/schemas/OpenRouterProviderPreferencesOrderItems"},"nullable":true,"type":"array"},"preferred_max_latency":{"$ref":"#/components/schemas/OpenRouterPreferredMaxLatency"},"preferred_min_throughput":{"$ref":"#/components/schemas/OpenRouterPreferredMinThroughput"},"quantizations":{"description":"A list of quantization levels to filter the provider by.","items":{"$ref":"#/components/schemas/OpenRouterQuantization"},"nullable":true,"type":"array"},"require_parameters":{"description":"Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.","nullable":true,"type":"boolean"},"sort":{"$ref":"#/components/schemas/OpenRouterProviderPreferencesSort"},"zdr":{"description":"Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.","nullable":true,"type":"boolean"}},"title":"ProviderPreferences","type":"object"},"OpenRouterProviderPreferencesDataCollection":{"description":"Data collection setting. If no available model provider meets the requirement, your request will return an error.\n- allow: (default) allow providers which store user data non-transiently and may train on it\n\n- deny: use only providers which do not collect user data.","enum":["deny","allow"],"title":"ProviderPreferencesDataCollection","type":"string"},"OpenRouterProviderPreferencesIgnoreItems":{"anyOf":[{"$ref":"#/components/schemas/OpenRouterProviderName"},{"type":"string"}],"title":"ProviderPreferencesIgnoreItems"},"OpenRouterProviderPreferencesMaxPrice":{"description":"The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.","properties":{"audio":{"$ref":"#/components/schemas/OpenRouterBigNumberUnion"},"completion":{"$ref":"#/components/schemas/OpenRouterBigNumberUnion"},"image":{"$ref":"#/components/schemas/OpenRouterBigNumberUnion"},"prompt":{"$ref":"#/components/schemas/OpenRouterBigNumberUnion"},"request":{"$ref":"#/components/schemas/OpenRouterBigNumberUnion"}},"title":"ProviderPreferencesMaxPrice","type":"object"},"OpenRouterProviderPreferencesOnlyItems":{"anyOf":[{"$ref":"#/components/schemas/OpenRouterProviderName"},{"type":"string"}],"title":"ProviderPreferencesOnlyItems"},"OpenRouterProviderPreferencesOrderItems":{"anyOf":[{"$ref":"#/components/schemas/OpenRouterProviderName"},{"type":"string"}],"title":"ProviderPreferencesOrderItems"},"OpenRouterProviderPreferencesSort":{"anyOf":[{"$ref":"#/components/schemas/OpenRouterProviderSort"},{"$ref":"#/components/schemas/OpenRouterProviderSortConfig"},{"description":"Any type"}],"description":"The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.","title":"ProviderPreferencesSort"},"OpenRouterProviderSort":{"description":"The provider sorting strategy (price, throughput, latency)","enum":["price","throughput","latency","exacto"],"title":"ProviderSort","type":"string"},"OpenRouterProviderSortConfig":{"description":"The provider sorting strategy (price, throughput, latency)","properties":{"by":{"description":"The provider sorting strategy (price, throughput, latency)","oneOf":[{"$ref":"#/components/schemas/OpenRouterProviderSortConfigBy"}]},"partition":{"description":"Partitioning strategy for sorting: \"model\" (default) groups endpoints by model before sorting (fallback models remain fallbacks), \"none\" sorts all endpoints together regardless of model.","oneOf":[{"$ref":"#/components/schemas/OpenRouterProviderSortConfigPartition"}]}},"title":"ProviderSortConfig","type":"object"},"OpenRouterProviderSortConfigBy":{"description":"The provider sorting strategy (price, throughput, latency)","enum":["price","throughput","latency","exacto"],"title":"ProviderSortConfigBy","type":"string"},"OpenRouterProviderSortConfigPartition":{"description":"Partitioning strategy for sorting: \"model\" (default) groups endpoints by model before sorting (fallback models remain fallbacks), \"none\" sorts all endpoints together regardless of model.","enum":["model","none"],"title":"ProviderSortConfigPartition","type":"string"},"OpenRouterQuantization":{"enum":["int4","int8","fp4","fp6","fp8","fp16","bf16","fp32","unknown"],"title":"Quantization","type":"string"},"OpenRouterReasoningDetailUnion":{"anyOf":[{"description":"Reasoning detail encrypted schema","properties":{"data":{"type":"string"},"format":{"$ref":"#/components/schemas/OpenRouterReasoningFormat"},"id":{"nullable":true,"type":"string"},"index":{"type":"integer"},"type":{"description":"Discriminator value: reasoning.encrypted","type":"string"}},"required":["type","data"],"type":"object"},{"description":"Reasoning detail summary schema","properties":{"format":{"$ref":"#/components/schemas/OpenRouterReasoningFormat"},"id":{"nullable":true,"type":"string"},"index":{"type":"integer"},"summary":{"type":"string"},"type":{"description":"Discriminator value: reasoning.summary","type":"string"}},"required":["type","summary"],"type":"object"},{"description":"Reasoning detail text schema","properties":{"format":{"$ref":"#/components/schemas/OpenRouterReasoningFormat"},"id":{"nullable":true,"type":"string"},"index":{"type":"integer"},"signature":{"nullable":true,"type":"string"},"text":{"nullable":true,"type":"string"},"type":{"description":"Discriminator value: reasoning.text","type":"string"}},"required":["type"],"type":"object"}],"description":"Reasoning detail union schema","title":"ReasoningDetailUnion"},"OpenRouterReasoningFormat":{"enum":["unknown","openai-responses-v1","azure-openai-responses-v1","xai-responses-v1","anthropic-claude-v1","google-gemini-v1"],"title":"ReasoningFormat","type":"string"},"OpenRouterRouterAttempt":{"properties":{"model":{"type":"string"},"provider":{"type":"string"},"status":{"type":"integer"}},"required":["model","provider","status"],"title":"RouterAttempt","type":"object"},"OpenRouterRouterParams":{"properties":{"quality_floor":{"format":"double","type":"number"},"throughput_floor":{"format":"double","type":"number"},"version_group":{"type":"string"}},"title":"RouterParams","type":"object"},"OpenRouterRoutingStrategy":{"enum":["direct","auto","free","latest","alias","fallback","pareto","bodybuilder","fusion"],"title":"RoutingStrategy","type":"string"},"OpenRouterSearchModelsServerToolConfig":{"description":"Configuration for the openrouter:experimental__search_models server tool","properties":{"max_results":{"description":"Maximum number of models to return. Defaults to 5, max 20.","type":"integer"}},"title":"SearchModelsServerToolConfig","type":"object"},"OpenRouterSearchQualityLevel":{"description":"How much context to retrieve per result. Applies to Exa and Parallel engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size.","enum":["low","medium","high"],"title":"SearchQualityLevel","type":"string"},"OpenRouterStopServerToolsWhen":{"description":"Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`.","items":{"$ref":"#/components/schemas/OpenRouterStopServerToolsWhenCondition"},"title":"StopServerToolsWhen","type":"array"},"OpenRouterStopServerToolsWhenCondition":{"description":"A single condition that, when met, halts the server-tool agent loop.","oneOf":[{"description":"Stop when the upstream model emits this finish reason (e.g. `length`).","properties":{"reason":{"type":"string"},"type":{"$ref":"#/components/schemas/OpenRouterStopServerToolsWhenFinishReasonIsType"}},"required":["type","reason"],"type":"object"},{"description":"Stop after a tool with this name has been called.","properties":{"tool_name":{"type":"string"},"type":{"$ref":"#/components/schemas/OpenRouterStopServerToolsWhenHasToolCallType"}},"required":["type","tool_name"],"type":"object"},{"description":"Stop once cumulative cost across the loop exceeds this dollar threshold.","properties":{"max_cost_in_dollars":{"format":"double","type":"number"},"type":{"$ref":"#/components/schemas/OpenRouterStopServerToolsWhenMaxCostType"}},"required":["type","max_cost_in_dollars"],"type":"object"},{"description":"Stop once cumulative token usage across the loop exceeds this threshold.","properties":{"max_tokens":{"type":"integer"},"type":{"$ref":"#/components/schemas/OpenRouterStopServerToolsWhenMaxTokensUsedType"}},"required":["type","max_tokens"],"type":"object"},{"description":"Stop after the agent loop has executed this many steps.","properties":{"step_count":{"type":"integer"},"type":{"$ref":"#/components/schemas/OpenRouterStopServerToolsWhenStepCountIsType"}},"required":["type","step_count"],"type":"object"}],"title":"StopServerToolsWhenCondition"},"OpenRouterStopServerToolsWhenFinishReasonIsType":{"enum":["finish_reason_is"],"title":"StopServerToolsWhenFinishReasonIsType","type":"string"},"OpenRouterStopServerToolsWhenHasToolCallType":{"enum":["has_tool_call"],"title":"StopServerToolsWhenHasToolCallType","type":"string"},"OpenRouterStopServerToolsWhenMaxCostType":{"enum":["max_cost"],"title":"StopServerToolsWhenMaxCostType","type":"string"},"OpenRouterStopServerToolsWhenMaxTokensUsedType":{"enum":["max_tokens_used"],"title":"StopServerToolsWhenMaxTokensUsedType","type":"string"},"OpenRouterStopServerToolsWhenStepCountIsType":{"enum":["step_count_is"],"title":"StopServerToolsWhenStepCountIsType","type":"string"},"OpenRouterTraceConfig":{"description":"Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.","properties":{"generation_name":{"type":"string"},"parent_span_id":{"type":"string"},"span_name":{"type":"string"},"trace_id":{"type":"string"},"trace_name":{"type":"string"}},"title":"TraceConfig","type":"object"},"OpenRouterWebFetchEngineEnum":{"description":"Which fetch engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in fetch. \"exa\" uses Exa Contents API. \"openrouter\" uses direct HTTP fetch. \"firecrawl\" uses Firecrawl scrape (requires BYOK).","enum":["auto","native","openrouter","firecrawl","exa"],"title":"WebFetchEngineEnum","type":"string"},"OpenRouterWebFetchPluginId":{"enum":["web-fetch"],"title":"WebFetchPluginId","type":"string"},"OpenRouterWebFetchServerTool":{"description":"OpenRouter built-in server tool: fetches full content from a URL (web page or PDF)","properties":{"parameters":{"$ref":"#/components/schemas/OpenRouterWebFetchServerToolConfig"},"type":{"$ref":"#/components/schemas/OpenRouterWebFetchServerToolType"}},"required":["type"],"title":"WebFetchServerTool","type":"object"},"OpenRouterWebFetchServerToolConfig":{"description":"Configuration for the openrouter:web_fetch server tool","properties":{"allowed_domains":{"description":"Only fetch from these domains.","items":{"type":"string"},"type":"array"},"blocked_domains":{"description":"Never fetch from these domains.","items":{"type":"string"},"type":"array"},"engine":{"$ref":"#/components/schemas/OpenRouterWebFetchEngineEnum"},"max_content_tokens":{"description":"Maximum content length in approximate tokens. Content exceeding this limit is truncated.","type":"integer"},"max_uses":{"description":"Maximum number of web fetches per request. Once exceeded, the tool returns an error.","type":"integer"}},"title":"WebFetchServerToolConfig","type":"object"},"OpenRouterWebFetchServerToolType":{"enum":["openrouter:web_fetch"],"title":"WebFetchServerToolType","type":"string"},"OpenRouterWebSearchConfig":{"properties":{"allowed_domains":{"description":"Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, and most native providers (Anthropic, OpenAI, xAI). Not supported with Perplexity. Cannot be used with excluded_domains.","items":{"type":"string"},"type":"array"},"engine":{"$ref":"#/components/schemas/OpenRouterWebSearchEngineEnum"},"excluded_domains":{"description":"Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Anthropic, and xAI. Not supported with OpenAI (silently ignored) or Perplexity. Cannot be used with allowed_domains.","items":{"type":"string"},"type":"array"},"max_results":{"description":"Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search.","type":"integer"},"max_total_results":{"description":"Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified.","type":"integer"},"search_context_size":{"$ref":"#/components/schemas/OpenRouterSearchQualityLevel"},"user_location":{"$ref":"#/components/schemas/OpenRouterWebSearchUserLocationServerTool"}},"title":"WebSearchConfig","type":"object"},"OpenRouterWebSearchEngine":{"description":"The search engine to use for web search.","enum":["native","exa","firecrawl","parallel"],"title":"WebSearchEngine","type":"string"},"OpenRouterWebSearchEngineEnum":{"description":"Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search. \"exa\" forces the Exa search API. \"firecrawl\" uses Firecrawl (requires BYOK). \"parallel\" uses the Parallel search API.","enum":["auto","native","exa","firecrawl","parallel"],"title":"WebSearchEngineEnum","type":"string"},"OpenRouterWebSearchPluginId":{"enum":["web"],"title":"WebSearchPluginId","type":"string"},"OpenRouterWebSearchPluginUserLocation":{"description":"Approximate user location for location-biased search results. Passed through to native providers that support it (e.g. Anthropic).","properties":{"city":{"nullable":true,"type":"string"},"country":{"nullable":true,"type":"string"},"region":{"nullable":true,"type":"string"},"timezone":{"nullable":true,"type":"string"},"type":{"$ref":"#/components/schemas/OpenRouterWebSearchPluginUserLocationType"}},"required":["type"],"title":"WebSearchPluginUserLocation","type":"object"},"OpenRouterWebSearchPluginUserLocationType":{"enum":["approximate"],"title":"WebSearchPluginUserLocationType","type":"string"},"OpenRouterWebSearchServerTool":{"description":"OpenRouter built-in server tool: searches the web for current information","properties":{"parameters":{"$ref":"#/components/schemas/OpenRouterWebSearchConfig"},"type":{"$ref":"#/components/schemas/OpenRouterWebSearchServerToolType"}},"required":["type"],"title":"OpenRouterWebSearchServerTool","type":"object"},"OpenRouterWebSearchServerToolType":{"enum":["openrouter:web_search"],"title":"OpenRouterWebSearchServerToolType","type":"string"},"OpenRouterWebSearchUserLocationServerTool":{"description":"Approximate user location for location-biased results.","properties":{"city":{"nullable":true,"type":"string"},"country":{"nullable":true,"type":"string"},"region":{"nullable":true,"type":"string"},"timezone":{"nullable":true,"type":"string"},"type":{"$ref":"#/components/schemas/OpenRouterWebSearchUserLocationServerToolType"}},"title":"WebSearchUserLocationServerTool","type":"object"},"OpenRouterWebSearchUserLocationServerToolType":{"enum":["approximate"],"title":"WebSearchUserLocationServerToolType","type":"string"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"x-comfy-router-model-id":"openrouter/chat-completions","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"]}
