/v1/schemas/openrouter/chat/messages
| field | recorded source |
|---|---|
| schema | Source linked above. upstream-spec Source trace0d19a8453874651361f64fbd51045d9d1d4868b39f7eb85b9866fee302c50de2{
"fetchedAt": 1794547804,
"extractorVersion": "2",
"verifiedAt": null
} |
Request body
29 properties · 2 required · 123 $defs| property | type | description | constraints |
|---|---|---|---|
| messages* | any | ||
| model* | string | ||
| cache_control | AnthropicCacheControlDirective | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also … | |
| context_management | object | ||
| deferred_tools | DeferredToolsControl | Opt-in versioned router-level deferred-tool protocol. Replay assistant reasoning unchanged on continuation. The portable profile needs the catalog unchanged across a continuation; the universal profile accepts a changed catalog and, with `announce_catalog_chan… | |
| fallbacks | any | Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries. | |
| max_tokens | integer | ||
| metadata | object | ||
| models | string[] | ||
| output_config | MessagesOutputConfig | Configuration for controlling output behavior. Supports the effort parameter and structured output format. | |
| plugins | AutoRouterPlugin | AutoBetaRouterPlugin | ModerationPlugin[] | Plugins you want to enable for this request, including their settings. | |
| provider | ProviderPreferences | When multiple model providers are available, optionally indicate your routing preference. | |
| route | enum | **DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: "fallback" (maps to "model"), "sort" (maps to "none"). | fallback | sort | null · deprecated |
| safeguards | any | ||
| service_tier | string | ||
| session_id | string | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for obser… | length ≤ 256 |
| speed | enum | any | ||
| stop_sequences | string[] | ||
| stop_server_tools_when | StopServerToolsWhenCondition[] | Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. When a condition fires while the model is still emitting tool calls, the pending tool calls are executed and one final tu… | items ≥ 1 |
| stream | boolean | ||
| system | string | AnthropicTextBlockParam[] | ||
| temperature | number | format: double | |
| thinking | object | object | object | … | ||
| tool_choice | object | object | object | … | ||
| tools | object | object | object[] | ||
| top_k | integer | ||
| top_p | number | format: double | |
| trace | TraceConfig | 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. | |
| user | string | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual u… | length ≤ 256 |
Types
123 $defsAlignmentPluginobject
Beta. States the listed rules to the model and evaluates every turn against them; the configuration, metadata, and error shapes may change.
| id* | enum | alignment | |
| instruct | boolean | Whether the rules are stated to the model in a system message on every provider call. Default true. | |
| max_retries | integer | Provider calls made again after a blocked turn, in enforce mode. Default 1. | |
| mode | enum | `enforce`: a turn that breaks a rule is withheld, retried, and finally returned as an error. `audit`: every turn is evaluated and returned. Default `audit`. | enforce | audit |
| rules* | AlignmentRule[] | Rules the reply must follow. Each rule is evaluated on its own. | items ≥ 1 · items ≤ 128 |
| threshold | number | Probability at or above which a rule is broken, from 0.01 to 1. Default 0.7. | format: double |
AlignmentRuleobject
| rule* | string | Text that states what the reply must do or must not do. | length ≥ 1 · length ≤ 200 |
| watch* | enum[] | Fields of the assistant message the rule applies to. The rule is evaluated on a message that has at least one of them and is not applicable to any other message. | items ≥ 1 · items ≤ 5 |
AnthropicAllowedCallersenum[]
AnthropicBase64ImageSourceobject
| data* | string | ||
| media_type* | enum | image/jpeg | image/png | image/gif | image/webp | |
| type* | enum | base64 |
AnthropicBase64PdfSourceobject
| data* | string | ||
| media_type* | enum | application/pdf | |
| type* | enum | base64 |
AnthropicCacheControlDirectiveobject
Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also …
| ttl | enum | 5m | 1h | |
| type* | enum | ephemeral |
AnthropicCacheControlTtlenum
5m | 1h
AnthropicCitationCharLocationParamobject
| cited_text* | string | ||
| document_index* | integer | ||
| document_title* | any | ||
| end_char_index* | integer | ||
| start_char_index* | integer | ||
| type* | enum | char_location |
AnthropicCitationContentBlockLocationParamobject
| cited_text* | string | ||
| document_index* | integer | ||
| document_title* | any | ||
| end_block_index* | integer | ||
| start_block_index* | integer | ||
| type* | enum | content_block_location |
AnthropicCitationPageLocationParamobject
| cited_text* | string | ||
| document_index* | integer | ||
| document_title* | any | ||
| end_page_number* | integer | ||
| start_page_number* | integer | ||
| type* | enum | page_location |
AnthropicCitationSearchResultLocationParamobject
| cited_text* | string | ||
| end_block_index* | integer | ||
| search_result_index* | integer | ||
| source* | string | ||
| start_block_index* | integer | ||
| title* | any | ||
| type* | enum | search_result_location |
AnthropicCitationWebSearchResultLocationParamobject
| cited_text* | string | ||
| encrypted_index* | string | ||
| title* | any | ||
| type* | enum | web_search_result_location | |
| url* | string |
AnthropicDocumentBlockParamobject
| cache_control | AnthropicCacheControlDirective | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also … | |
| citations | object | ||
| context | any | ||
| source* | object | object | object | … | ||
| title | any | ||
| type* | enum | document |
AnthropicFileDocumentSourceobject
| file_id* | string | ||
| type* | enum | file |
AnthropicImageBlockParamobject
| cache_control | AnthropicCacheControlDirective | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also … | |
| source* | object | object | object | ||
| type* | enum | image |
AnthropicImageMimeTypeenum
image/jpeg | image/png | image/gif | image/webp
AnthropicInputTokensClearAtLeastobject
| type* | enum | input_tokens | |
| value* | integer |
AnthropicInputTokensTriggerobject
| type* | enum | input_tokens | |
| value* | integer |
AnthropicMessageOutputConfigobject
| effort | enum | low | medium | high | xhigh | max | null |
AnthropicOutputEffortenum
low | medium | high | xhigh | max | null
AnthropicPlainTextSourceobject
| data* | string | ||
| media_type* | enum | text/plain | |
| type* | enum | text |
AnthropicSafeguardobject
A server-side safeguard Anthropic evaluates alongside the completion
| classifier_context | object | ||
| type* | string |
AnthropicSearchResultBlockParamobject
| cache_control | AnthropicCacheControlDirective | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also … | |
| citations | object | ||
| content* | AnthropicTextBlockParam[] | ||
| source* | string | ||
| title* | string | ||
| type* | enum | search_result |
AnthropicSpeedenum
fast | standard | null
AnthropicSystemClearAtenum
next_user_message | never | null
AnthropicTextBlockParamobject
| cache_control | AnthropicCacheControlDirective | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also … | |
| citations | any | ||
| text* | string | ||
| type* | enum | text |
AnthropicThinkingBlockBindingobject
| mismatch_behavior | enum | Deprecated: legacy alias of prefix_mismatch_behavior. Send only one of the two. | error | drop_block | null · deprecated |
| prefix_mismatch_behavior | enum | error | drop_block | null |
AnthropicThinkingDisplayenum
summarized | omitted | updates | null
AnthropicThinkingTurnsobject
| type* | enum | thinking_turns | |
| value* | integer |
AnthropicToolSearchToolBm25object
| allowed_callers | enum[] | ||
| cache_control | AnthropicCacheControlDirective | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also … | |
| defer_loading | boolean | ||
| name* | enum | tool_search_tool_bm25 | |
| strict | boolean | ||
| type* | enum | tool_search_tool_bm25_20251119 | tool_search_tool_bm25 |
AnthropicToolSearchToolRegexobject
| allowed_callers | enum[] | ||
| cache_control | AnthropicCacheControlDirective | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also … | |
| defer_loading | boolean | ||
| name* | enum | tool_search_tool_regex | |
| strict | boolean | ||
| type* | enum | tool_search_tool_regex_20251119… | tool_search_tool_regex |
AnthropicToolUnionobject | object | object | …
An Anthropic tool definition: a client-defined tool with a JSON Schema `input_schema`, or a server tool (bash, text editor, web search).
AnthropicToolUsesKeepobject
| type* | enum | tool_uses | |
| value* | integer |
AnthropicToolUsesTriggerobject
| type* | enum | tool_uses | |
| value* | integer |
AnthropicUrlImageSourceobject
| type* | enum | url | |
| url* | string |
AnthropicUrlPdfSourceobject
| type* | enum | url | |
| url* | string |
AnthropicWebSearchResultBlockParamobject
| encrypted_content* | string | ||
| page_age | any | ||
| title* | string | ||
| type* | enum | web_search_result | |
| url* | string |
AnthropicWebSearchToolUserLocationobject
| city | any | ||
| country | any | ||
| region | any | ||
| timezone | any | ||
| type* | enum | approximate |
ArmorAutoModeobject
| allow | string | ArmorRule[] | ||
| environment | string | ArmorEnvironmentEntry[] | ||
| hard_deny | string | ArmorRule[] | ||
| soft_deny | string | ArmorRule[] |
ArmorContextobject
The Armor context: Claude Code's `classifier_context` (v1), with `auto_mode.{hard_deny,soft_deny,allow}` rules as strings or `{ id, instructions, threshold? }` objects and `auto_mode.environment` entries as `"Name: value"` strings or `{ name, value }` objects.…
| auto_mode | ArmorAutoMode | ||
| v* | enum | 1 |
ArmorEnvironmentEntryobject
| name* | string | length ≥ 1 · length ≤ 120 | |
| value* | string | length ≤ 4000 |
ArmorPluginobject
Evaluates every client tool call the model emits against a rule stack (hard-deny, soft-deny, allow) before it reaches the caller. The stack merges the workspace guardrail, this plugin, and any Anthropic `safeguards`; on endpoints that support Anthropic's `dang…
| classifier_context | ArmorContext | The Armor context: Claude Code's `classifier_context` (v1), with `auto_mode.{hard_deny,soft_deny,allow}` rules as strings or `{ id, instructions, threshold? }` objects and `auto_mode.environment` entries as `"Name: value"` strings or `{ name, value }` objects.… | |
| enabled | boolean | Set to false to disable Armor for this request. Defaults to true. | |
| evaluate_native_tools | boolean | Run provider-native server tools (web search, code execution, ...) through the agent loop so Armor evaluates them too. Defaults to false: native passthrough stands and such calls are reported `skipped`. | |
| id* | enum | armor | |
| mode | enum | `enforce` withholds blocked calls; `audit` evaluates and reports the same verdicts without withholding any calls, regardless of `on_error`. Default `enforce`. | enforce | audit |
| on_error | enum | When the classifier cannot answer (timeout, upstream error, context too long) the call is reported `unavailable`; `block` rejects it and `log` releases it. Default `block`. | log | block |
| output_mode | enum | How a blocked call reaches the caller. `text` (the default): the call is withheld and an `<openrouter_armor_blocked>` marker stands in assistant text. `custom_item` (Responses API only): the call is withheld and an `openrouter:armor_blocked` output item carrie… | text | custom_item | claude_code_compatibility |
| use_cc_style_default_rules | boolean | Prepend Claude Code's built-in auto-mode rule set (1 hard-deny, 72 soft-deny, 17 allow, 21 environment slots) ahead of every configured rule. Defaults to true on the Anthropic Messages API and false elsewhere. |
ArmorRuleobject
| id* | string | Stable id, unique within its source; reported as the deciding rule when it fires. | length ≥ 1 · length ≤ 64 |
| instructions* | string | What the rule matches, written for the classifier. | length ≥ 1 · length ≤ 8000 |
| name | string | Display name shown in verdict explanations; defaults to the id. | length ≥ 1 · length ≤ 120 |
| threshold | number | Probability at or above which the rule counts as matched. Defaults to 0.6 for hard-deny and soft-deny rules and 0.7 for allow rules (an exception needs stronger evidence to clear a matched soft deny). | format: double |
AutoBetaRouterPluginobject
| allowed_models | string[] | List of model patterns to filter which models the auto-beta-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Whe… | items ≤ 1024 |
| cost_quality_tradeoff | integer | Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-beta-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. H… | 0 ≤ n ≤ 10 · deprecated |
| cost_tier | enum | Named cost/quality setting. For auto-beta-router, tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are pro… | low | medium | high | xhigh | max |
| enabled | boolean | Set to false to disable the auto-beta-router plugin for this request. Defaults to true. | |
| excluded_models | string[] | List of model patterns to exclude from auto-beta-router selection. Supports wildcards (e.g., "meta-llama/*" excludes all Llama models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after allowed_mo… | items ≤ 1024 |
| id* | enum | auto-beta-router |
AutoRouterPluginobject
| allowed_models | string[] | List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When not… | items ≤ 1024 |
| cost_quality_tradeoff | integer | Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher… | 0 ≤ n ≤ 10 · deprecated |
| cost_tier | enum | Named cost/quality setting. Tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided. | low | medium | high | xhigh | max |
| enabled | boolean | Set to false to disable the auto-router plugin for this request. Defaults to true. | |
| excluded_models | string[] | List of model patterns to exclude from auto-router selection. Supports wildcards (e.g., "meta-llama/*" excludes all Llama models). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after allowed_models,… | items ≤ 1024 |
| id* | enum | auto-router | |
| pin_model | boolean | When true, reuses the model from the most recent assistant message's `model` attribute for subsequent turns. Defaults to false. |
BashServerToolobject
OpenRouter built-in server tool: runs shell commands server-side in a sandboxed container
| parameters | BashServerToolConfig | Configuration for the openrouter:bash server tool | |
| type* | enum | openrouter:bash |
BashServerToolConfigobject
Configuration for the openrouter:bash server tool
| engine | enum | Which bash engine to use. "openrouter" runs commands server-side in the OpenRouter sandbox. "auto" (default) and "native" use native passthrough, returning the tool call to your application to run client-side; OpenRouter does not execute the commands. | auto | native | openrouter |
| environment | object | object | Execution environment for the bash server tool. |
BashServerToolEngineenum
Which bash engine to use. "openrouter" runs commands server-side in the OpenRouter sandbox. "auto" (default) and "native" use native passthrough, returning the tool call to your application to run client-side; OpenRouter does not execute the commands.
auto | native | openrouter
BashServerToolEnvironmentobject | object
Execution environment for the bash server tool.
ContainerAutoEnvironmentobject
An OpenRouter-managed, auto-provisioned ephemeral container.
| file_ids | string[] | Workspace file ids (or_file_…) to attach into the container before the first command runs. Each file is copied to the container home as a writable copy named {last 8 characters of the file id}-{base filename} (a file stored as data/report.csv with id or_file_…… | items ≤ 20 |
| network_policy | object | object | Network egress policy for the container. "disabled" blocks all outbound internet; "allowlist" permits only hosts matching the listed hostnames or * glob patterns (ports 80/443, DNS via Cloudflare resolvers). The policy is fixed when a container starts: sending… | |
| type* | enum | container_auto |
ContainerFileIdsstring[]
Workspace file ids (or_file_…) to attach into the container before the first command runs. Each file is copied to the container home as a writable copy named {last 8 characters of the file id}-{base filename} (a file stored as data/report.csv with id or_file_……
items ≤ 20
ContainerNetworkPolicyobject | object
Network egress policy for the container. "disabled" blocks all outbound internet; "allowlist" permits only hosts matching the listed hostnames or * glob patterns (ports 80/443, DNS via Cloudflare resolvers). The policy is fixed when a container starts: sending…
ContainerReferenceEnvironmentobject
Reference to a container by its canonical id — a previously returned container_id or a fresh name to create a persistent container.
| container_id* | string | Canonical container id to reuse (max 40 characters, letters/digits/underscores/hyphens). Any container_id previously returned by a bash or shell tool result works here and reattaches to the same container and files — including session-derived ids (sess_...) an… | length ≥ 1 · length ≤ 40 |
| file_ids | string[] | Workspace file ids (or_file_…) to attach into the container before the first command runs. Each file is copied to the container home as a writable copy named {last 8 characters of the file id}-{base filename} (a file stored as data/report.csv with id or_file_…… | items ≤ 20 |
| network_policy | object | object | Network egress policy for the container. "disabled" blocks all outbound internet; "allowlist" permits only hosts matching the listed hostnames or * glob patterns (ports 80/443, DNS via Cloudflare resolvers). The policy is fixed when a container starts: sending… | |
| type* | enum | container_reference |
ContextCompressionEngineenum
The compression engine to use. Defaults to "middle-out".
middle-out
ContextCompressionPluginobject
| enabled | boolean | Set to false to disable the context-compression plugin for this request. Defaults to true. | |
| engine | enum | The compression engine to use. Defaults to "middle-out". | middle-out |
| id* | enum | context-compression |
DatetimeServerToolobject
OpenRouter built-in server tool: returns the current date and time
| parameters | DatetimeServerToolConfig | Configuration for the openrouter:datetime server tool | |
| type* | enum | openrouter:datetime |
DatetimeServerToolConfigobject
Configuration for the openrouter:datetime server tool
| timezone | string | IANA timezone name (e.g. "America/New_York"). Defaults to UTC. |
DeferredBm25Searchobject
Deterministic BM25 retrieval over supplied tool definitions.
| max_results | integer | ||
| miss_sources | boolean | Universal profile only, for searches the router answers through the `tool_search` wrapper. Unless false, a search that matches nothing also names the deferred sources this search covers (namespaces, MCP servers, and shared `<server>_` prefixes; up to 40 names … | |
| siblings | boolean | Universal profile only, for searches the router answers through the `tool_search` wrapper; code-mode `search()` and a client-owned tool search list the matched tools alone. When true, each result also names up to 16 other deferred tools of every source a match… | |
| spread | boolean | Universal profile only, for keyword searches the router answers through the `tool_search` wrapper. When true, a result spreads across sources: of the 3 x limit best-scoring candidates, those scoring at least 60% of the best match take at most 2 slots per sourc… | |
| type* | enum | bm25 |
DeferredCustomSearchobject
Caller-executed search returning existing tool identities under result_key.
| max_results | integer | ||
| result_key* | string | length ≥ 1 | |
| tool_id* | string | length ≥ 1 | |
| type* | enum | custom |
DeferredRegexSearchobject
Versioned safe-regex retrieval over supplied tool definitions.
| max_results | integer | ||
| miss_sources | boolean | Universal profile only, for searches the router answers through the `tool_search` wrapper. Unless false, a search that matches nothing also names the deferred sources this search covers (namespaces, MCP servers, and shared `<server>_` prefixes; up to 40 names … | |
| siblings | boolean | Universal profile only, for searches the router answers through the `tool_search` wrapper; code-mode `search()` and a client-owned tool search list the matched tools alone. When true, each result also names up to 16 other deferred tools of every source a match… | |
| type* | enum | regex |
DeferredToolsControlobject
Opt-in versioned router-level deferred-tool protocol. Replay assistant reasoning unchanged on continuation. The portable profile needs the catalog unchanged across a continuation; the universal profile accepts a changed catalog and, with `announce_catalog_chan…
| announce_catalog_changes | boolean | Universal profile only. When true, a catalog whose deferred tools changed between two of the model's own turns (a client that connects MCP servers while the model works) is re-announced before the next model turn, with the sources added, changed and removed si… | |
| cascade_mode | enum | How a universal `tool_search` query reaches the client's own tool search. Absent or `keywords`: a `select:` query becomes the words of the selected names and the limit is always filled. `native`: a `select:` query passes through verbatim when the client search… | keywords | native |
| hint | string | Universal profile only. Caller text announced to the model with the deferred catalog before its first turn, for example which sources the task needs. Repeated only when it changes. Trimmed before the length bounds apply. Recorded in the `catalog_index` discove… | length ≥ 1 · length ≤ 2000 |
| interface | enum | How the universal profile exposes the hidden catalog to the provider. Absent or `wrappers`: the `tool_search` and `tool_exec` tools. `code_mode`: one `tool_code` tool that runs a short JavaScript program in which `search()` and `call()` reach the catalog, so s… | wrappers | code_mode |
| min_deferred_tools | integer | Universal profile only. When fewer tools than this would be deferred, the universal profile defers none of them and sends the client tools unchanged, so a harness with a handful of non-core tools and no MCP servers pays no search turn for them. Counted after t… | |
| profile* | enum | Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes (u… | portable | universal |
| protocol* | enum | v1 | |
| scope | enum | Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. Ex… | all | mcp |
| search* | object | object | object | Router-local regex/BM25 or caller-owned custom search. | |
| validation* | enum | Where tool-call arguments are checked against the original schema. Only `runtime` (in OpenRouter) is available in this release. | runtime |
DeferredToolsSearchStrategyobject | object | object
Router-local regex/BM25 or caller-owned custom search.
DeprecatedRouteenum
**DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: "fallback" (maps to "model"), "sort" (maps to "none").
fallback | sort | null
FileParserPluginobject
| enabled | boolean | Set to false to disable the file-parser plugin for this request. Defaults to true. | |
| id* | enum | file-parser | |
| PDFParserOptions | Options for PDF parsing. |
FusionPluginobject
| analysis_models | string[] | For a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool, slugs of models to run in parallel as the "expert panel" the analyst analyzes. Each model receives the same user prompt with web_search + web_fetch enabled. Capp… | items ≥ 1 · items ≤ 8 |
| enabled | boolean | Set to false to disable Fusion configuration for a run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool. Defaults to true. | |
| id* | enum | fusion | |
| max_tool_calls | integer | For a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool, the maximum number of tool-calling steps each panelist (analysis model) and the analyst model may take during their agentic web-research loop. Models with web_se… | 1 ≤ n ≤ 16 |
| model | string | For a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool, the slug of the model that performs both the analyst step (with web_search + web_fetch) and the final synthesis. When omitted, defaults to the first model in the… | |
| preset | enum | Configuration for a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool. A curated OpenRouter preset (slugs follow `<task>-<tier>`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and an… | general-high | general-budget | general-fast |
| tools | object[] | For a Fusion run started by the `openrouter/fusion` model slug or `openrouter:fusion` server tool, server tools available to panelist and analyst inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. Whe… | items ≤ 8 |
ImageGenerationServerTool_OpenRouterobject
OpenRouter built-in server tool: generates images from text prompts using an image generation model
| parameters | ImageGenerationServerToolConfig | 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. | |
| type* | enum | openrouter:image_generation |
ImageGenerationServerToolConfigobject
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.
| model | string | Which image generation model to use (e.g. "openai/gpt-image-2.6-flare"). Defaults to "openai/gpt-image-2.6-flare". |
JevRouterPluginobject
| allowed_models | string[] | Alias of `models`, matching the auto-router field name. Entries from both fields are combined. | items ≤ 1024 |
| cost_tier | string | Select low, medium, high, or a cost tier configured by the operator. Overrides the live-config tier and replaces the shared routing policy with that tier. Omit to use the live configuration. Model exclusions and the router kill switch still apply. | |
| excluded_models | string[] | Remove these models from the router. Each entry is a model slug or a wildcard pattern (e.g. "xiaomi/*"). A `~author/family-latest` alias matches every revision of that family. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters acros… | items ≤ 1024 |
| id* | enum | jev-router | |
| models | string[] | Restrict the router to these models. Each entry is a model slug or a wildcard pattern (e.g. "anthropic/*"), matched against the current pool; models outside the pool are ignored. A `~author/family-latest` alias matches every revision of that family. Up to 1024… | items ≤ 1024 |
MessagesAdvisorToolResultBlockobject
Advisor tool result from a prior assistant turn, replayed back to the model on the next turn. Mirrors the block Anthropic returns in assistant content when the `advisor_20260301` tool runs.
| content* | object | ||
| tool_use_id* | string | ||
| type* | enum | advisor_tool_result |
MessagesBashToolResultBlockobject
Output of a sandbox-executed `openrouter:bash` call from a prior assistant turn. Accepted on replay and dropped before the provider request — Anthropic has no equivalent block.
| container_id | string | The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed. | |
| content* | object | ||
| files | object[] | Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API. | |
| tool_use_id* | string | ||
| type* | enum | openrouter_bash_tool_result |
MessagesFallbackParamobject
Fallback model to try when the primary model fails or refuses. Only the `model` field is supported; per-attempt overrides are rejected.
| model* | string |
MessagesMessageParamobject
Anthropic message with OpenRouter extensions
| clear_at | enum | next_user_message | never | null | |
| content* | string | AnthropicTextBlockParam | AnthropicImageBlockParam | AnthropicDocumentBlockParam[] | ||
| output_config | AnthropicMessageOutputConfig | ||
| role* | enum | user | assistant | system |
MessagesOutputConfigobject
Configuration for controlling output behavior. Supports the effort parameter and structured output format.
| effort | enum | How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer. Valid values are `low`, `medium`, `high`, `xhigh`, or `max`. | low | medium | high | xhigh | max | null |
| format | object | A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs). | |
| task_budget | object | Task budget for an agentic turn. The model sees a countdown of remaining tokens and uses it to prioritize work and wind down gracefully. Advisory — does not enforce a hard cap. |
MessagesSearchModelsServerToolobject
OpenRouter built-in server tool: searches and filters AI models available on OpenRouter
| parameters | SearchModelsServerToolConfig | Configuration for the openrouter:experimental__search_models server tool | |
| type* | enum | openrouter:experimental__search… |
MessagesShellToolResultBlockobject
Output of an `openrouter:shell` call from a prior assistant turn. Accepted on replay and dropped before the provider request — Anthropic has no equivalent block.
| container_id | string | The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed. | |
| content* | object | ||
| files | object[] | Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API. | |
| tool_use_id* | string | ||
| type* | enum | openrouter_shell_tool_result |
MessagesToolAdditionBlockobject
Adds a tool mid-conversation without invalidating the prompt cache: either a previously deferred tool (declared in `tools` with `defer_loading: true`, referenced by name) or a full inline `tool_definition`. Only valid in `role: "system"` messages. Not supporte…
| cache_control | AnthropicCacheControlDirective | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also … | |
| tool* | object | object | object | … | ||
| type* | enum | tool_addition |
MessagesToolRemovalBlockobject
Removes a tool from the conversation mid-conversation without invalidating the prompt cache. Only valid in `role: "system"` messages. Not supported on Claude Sonnet 5 or models older than Claude Opus 4.8.
| cache_control | AnthropicCacheControlDirective | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also … | |
| tool* | object | object | object | ||
| type* | enum | tool_removal |
ModerationPluginobject
| id* | enum | moderation |
OpenRouterWebSearchServerToolobject
OpenRouter built-in server tool: searches the web for current information
| parameters | WebSearchConfig | ||
| type* | enum | openrouter:web_search |
ORAnthropicToolSearchResultParamobject
Router-owned deferred discovery result for continuation.
| content* | object | ||
| tool_use_id* | string | ||
| type* | enum | openrouter_tool_search_result |
ParetoRouterPluginobject
| enabled | boolean | Set to false to disable the pareto-router plugin for this request. Defaults to true. | |
| id* | enum | pareto-router | |
| max_price | number | Maximum input price in USD per million tokens. When set, quality-tier selection (min_coding_score) is bypassed: the router computes the Pareto frontier over the top coding models and routes to the best-scoring frontier model priced at or below this cap, fallin… | n ≥ 0 · format: double |
| min_coding_score | number | Minimum coding quality score between 0 and 1. Maps to internal quality tiers: >= 0.66 → high (top coding models), >= 0.33 → medium (strong modern flagships), < 0.33 → low (capable coders above the median). Omit to default to the highest tier (equivalent to >= … | 0 ≤ n ≤ 1 · format: double |
| price_source | enum | Price source for the Pareto frontier cost axis and for enforcing max_price. "prompt" uses catalog list price (endpoint.pricing.prompt). "weighted_avg" uses traffic-weighted effective input price from ClickHouse, falling back to prompt price for models without … | prompt | weighted_avg |
PDFParserEngineenum | enum
The engine to use for parsing PDF files. "pdf-text" is deprecated and automatically redirected to "cloudflare-ai".
PDFParserOptionsobject
Options for PDF parsing.
| engine | enum | enum | The engine to use for parsing PDF files. "pdf-text" is deprecated and automatically redirected to "cloudflare-ai". |
PercentileLatencyCutoffsobject
Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
| p50 | any | Maximum p50 latency (seconds) | format: double |
| p75 | any | Maximum p75 latency (seconds) | format: double |
| p90 | any | Maximum p90 latency (seconds) | format: double |
| p99 | any | Maximum p99 latency (seconds) | format: double |
PercentileThroughputCutoffsobject
Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
| p50 | any | Minimum p50 throughput (tokens/sec) | format: double |
| p75 | any | Minimum p75 throughput (tokens/sec) | format: double |
| p90 | any | Minimum p90 throughput (tokens/sec) | format: double |
| p99 | any | Minimum p99 throughput (tokens/sec) | format: double |
PreferredMaxLatencynumber | object
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 …
nullable
PreferredMinThroughputnumber | object
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 caus…
nullable
ProviderNameenum
Modal | AkashML | AI21 | AionLabs | Alibaba | Ambient · +118 more
ProviderOptionsobject
Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silentl…
| 01ai | object | ||
| ai21 | object | ||
| aion-labs | object | ||
| akashml | object | ||
| alibaba | object | ||
| amazon-bedrock | object | ||
| amazon-bedrock/claude-on-aws | object | ||
| amazon-nova | object | ||
| ambient | object | ||
| antdigital | object | ||
| anthropic | object | ||
| anthropic/2 | object | ||
| anyscale | object | ||
| arcee-ai | object | ||
| assemblyai | object | ||
| atlas-cloud | object | ||
| atoma | object | ||
| avian | object | ||
| azure | object | ||
| baidu | object | ||
| baseten | object | ||
| black-forest-labs | object | ||
| byteplus | object | ||
| centml | object | ||
| cerebras | object | ||
| chutes | object | ||
| cirrascale | object | ||
| clarifai | object | ||
| claude-on-aws | object | ||
| cloudflare | object | ||
| cohere | object | ||
| coreweave | object | ||
| cosine | object | ||
| crofai | object | ||
| crucible | object | ||
| crusoe | object | ||
| darkbloom | object | ||
| databricks | object | ||
| decart | object | ||
| deepgram | object | ||
| deepinfra | object | ||
| deepseek | object | ||
| dekallm | object | ||
| digitalocean | object | ||
| elevenlabs | object | ||
| enfer | object | ||
| fake-provider | object | ||
| featherless | object | ||
| fireworks | object | ||
| fish-audio | object | ||
| friendli | object | ||
| gmicloud | object | ||
| google-ai-studio | object | ||
| google-vertex | object | ||
| gopomelo | object | ||
| groq | object | ||
| heygen | object | ||
| huggingface | object | ||
| hyperbolic | object | ||
| hyperbolic-quantized | object | ||
| inception | object | ||
| inceptron | object | ||
| inferact-vllm | object | ||
| inference-net | object | ||
| infermatic | object | ||
| inflection | object | ||
| inocloud | object | ||
| io-net | object | ||
| ionstream | object | ||
| klusterai | object | ||
| krea | object | ||
| kt | object | ||
| lambda | object | ||
| lepton | object | ||
| liquid | object | ||
| lynn | object | ||
| lynn-private | object | ||
| makora | object | ||
| mancer | object | ||
| mancer-old | object | ||
| mara | object | ||
| meta | object | ||
| minimax | object | ||
| mistral | object | ||
| modal | object | ||
| modelrun | object | ||
| modular | object | ||
| moonshotai | object | ||
| morph | object | ||
| ncompass | object | ||
| near-ai | object | ||
| nebius | object | ||
| nex-agi | object | ||
| nextbit | object | ||
| nineteen | object | ||
| novita | object | ||
| nvidia | object | ||
| octoai | object | ||
| ollama | object | ||
| open-inference | object | ||
| openai | object | ||
| parallel | object | ||
| parasail | object | ||
| pareto-alpha | object | ||
| particle-ai | object | ||
| pearl-research | object | ||
| perceptron | object | ||
| perplexity | object | ||
| phala | object | ||
| poolside | object | ||
| primalabs | object | ||
| primeintellect | object | ||
| quiver | object | ||
| recraft | object | ||
| recursal | object | ||
| recursive | object | ||
| reflection | object | ||
| reka | object | ||
| relace | object | ||
| replicate | object | ||
| respan | object | ||
| river | object | ||
| runway | object | ||
| sail-research | object | ||
| sakana | object | ||
| sakana-ai | object | ||
| sambanova | object | ||
| sambanova-cloaked | object | ||
| scaledown | object | ||
| seed | object | ||
| sf-compute | object | ||
| siliconflow | object | ||
| sourceful | object | ||
| speechify | object | ||
| stealth | object | ||
| stepfun | object | ||
| streamlake | object | ||
| switchpoint | object | ||
| targon | object | ||
| tencent | object | ||
| tenstorrent | object | ||
| thinkingmachines | object | ||
| together | object | ||
| together-lite | object | ||
| typesafe | object | ||
| ubicloud | object | ||
| unbiased | object | ||
| upstage | object | ||
| venice | object | ||
| voyageai | object | ||
| wafer | object | ||
| wandb | object | ||
| wandb-legacy | object | ||
| xai | object | ||
| xiaomi | object | ||
| z-ai | object |
ProviderPreferencesobject
When multiple model providers are available, optionally indicate your routing preference.
| allow_fallbacks | any | Whether to allow backup providers to serve requests - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. - false: use only the primary/custom provider, and return the upstream error if it… | |
| data_collection | enum | Data collection setting. If no available model provider meets the requirement, your request will return an error. - allow: (default) allow providers which store user data non-transiently and may train on it | deny | allow | null |
| enforce_distillable_text | any | Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. | |
| ignore | any | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | |
| max_price | object | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | |
| only | any | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | |
| options | ProviderOptions | Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silentl… | |
| order | any | 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 err… | |
| preferred_max_latency | number | object | 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 … | nullable |
| preferred_min_throughput | number | object | 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 caus… | nullable |
| quantizations | any | A list of quantization levels to filter the provider by. | |
| require_parameters | any | 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. | |
| sort | enum | object | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | nullable |
| zdr | any | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. |
ProviderSortenum
The provider sorting strategy (price, throughput, latency)
price | throughput | latency | exacto
ProviderSortConfigobject
The provider sorting strategy (price, throughput, latency)
| by | enum | The provider sorting strategy (price, throughput, latency) | price | throughput | latency | exacto | null |
| partition | enum | Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback models remain fallbacks), "none" sorts all endpoints together regardless of model. | model | none | null |
Quantizationenum
int4 | int8 | fp4 | mxfp4 | nvfp4 | fp6 · +6 more
ResponseHealingPluginobject
| enabled | boolean | Set to false to disable the response-healing plugin for this request. Defaults to true. | |
| id* | enum | response-healing |
SearchModelsServerToolConfigobject
Configuration for the openrouter:experimental__search_models server tool
| max_results | integer | Maximum number of models to return. Defaults to 5, max 20. |
SearchQualityLevelenum
How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity 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 ada…
low | medium | high
ShellServerTool_OpenRouterobject
OpenRouter built-in server tool: runs shell commands server-side in a sandboxed container (a sandbox-backed clone of OpenAI's hosted shell tool)
| parameters | ShellServerToolConfig | Configuration for the openrouter:shell server tool | |
| type* | enum | openrouter:shell |
ShellServerToolConfigobject
Configuration for the openrouter:shell server tool
| engine | enum | Which shell engine to use. "openrouter" runs commands server-side in the OpenRouter sandbox. "auto" (default) keeps the provider's native hosted shell when available (OpenAI); on other providers the call is routed to the OpenRouter sandbox. | auto | openrouter |
| environment | object | object | Server-side execution environment for the shell tool. Only container-backed environments are supported; "local" shells are not. |
ShellServerToolEngineenum
Which shell engine to use. "openrouter" runs commands server-side in the OpenRouter sandbox. "auto" (default) keeps the provider's native hosted shell when available (OpenAI); on other providers the call is routed to the OpenRouter sandbox.
auto | openrouter
ShellServerToolEnvironmentobject | object
Server-side execution environment for the shell tool. Only container-backed environments are supported; "local" shells are not.
StopServerToolsWhenStopServerToolsWhenCondition[]
Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. When a condition fires while the model is still emitting tool calls, the pending tool calls are executed and one final tu…
items ≥ 1
StopServerToolsWhenConditionobject | object | object | …
A single condition that, when met, halts the server-tool agent loop.
StopServerToolsWhenFinishReasonIsobject
Stop when the upstream model emits this finish reason (e.g. `length`).
| reason* | string | length ≥ 1 | |
| type* | enum | finish_reason_is |
StopServerToolsWhenHasToolCallobject
Stop after a tool with this name has been called.
| tool_name* | string | length ≥ 1 | |
| type* | enum | has_tool_call |
StopServerToolsWhenMaxCostobject
Stop once cumulative cost across the loop exceeds this dollar threshold.
| max_cost_in_dollars* | number | format: double | |
| type* | enum | max_cost |
StopServerToolsWhenMaxTokensUsedobject
Stop once cumulative token usage across the loop exceeds this threshold.
| max_tokens* | integer | ||
| type* | enum | max_tokens_used |
StopServerToolsWhenStepCountIsobject
Stop after the agent loop has executed this many steps.
| step_count* | integer | ||
| type* | enum | step_count_is |
SwitchyardRouterPluginobject
| algorithm | enum | Routing algorithm for this request. "capability" calls a small judge model to rate how demanding the task is, then picks the efficient or capable candidate. "stage" reads the tool-result history (errors, repeated failures, edits landing) and calls the judge on… | capability | stage | auto | random | composite | passthrough |
| id* | enum | switchyard-router | |
| judge_model | string | The model that runs the judge call for the judge-backed algorithms ("capability", "stage", and "composite"). The model must support structured outputs and have a provider that your account and request settings allow. Otherwise, the request uses the platform de… | length ≥ 1 |
ToolSearchServerToolobject
OpenRouter built-in server tool: finds tools marked `defer_loading` and makes them callable
| parameters | ToolSearchServerToolConfig | Configuration for the openrouter:tool_search server tool | |
| type* | enum | openrouter:tool_search |
ToolSearchServerToolConfigobject
Configuration for the openrouter:tool_search server tool
| max_results | integer | Maximum tools returned by one search. Defaults to 5. |
TraceConfigobject
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.
| generation_name | string | ||
| parent_span_id | string | ||
| span_name | string | ||
| trace_id | string | ||
| trace_name | string |
WebFetchEngineEnumenum
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. "parallel" u…
auto | native | openrouter | exa | parallel | firecrawl
WebFetchPluginobject
| allowed_domains | string[] | Only fetch from these domains. | |
| blocked_domains | string[] | Never fetch from these domains. | |
| id* | enum | web-fetch | |
| max_content_tokens | integer | Maximum content length in approximate tokens. Content exceeding this limit is truncated. | |
| max_uses | integer | Maximum number of web fetches per request. Once exceeded, the tool returns an error. |
WebFetchServerToolobject
OpenRouter built-in server tool: fetches full content from a URL (web page or PDF)
| parameters | WebFetchServerToolConfig | Configuration for the openrouter:web_fetch server tool | |
| type* | enum | openrouter:web_fetch |
WebFetchServerToolConfigobject
Configuration for the openrouter:web_fetch server tool
| allowed_domains | string[] | Only fetch from these domains. | |
| blocked_domains | string[] | Never fetch from these domains. | |
| engine | enum | 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. "parallel" u… | auto | native | openrouter | exa | parallel | firecrawl |
| max_content_tokens | integer | Maximum content length in approximate tokens. Content exceeding this limit is truncated. | |
| max_uses | integer | Maximum number of web fetches per request. Once exceeded, the tool returns an error. |
WebSearchConfigobject
| allowed_domains | string[] | Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, SpaceXAI). Cannot be used with excluded_domains. | |
| engine | enum | 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 the Firecrawl search API. "parallel" uses the Parallel search… | native | exa | parallel | firecrawl | perplexity | auto |
| excluded_domains | string[] | Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, OpenAI, and SpaceXAI. Cannot be used with allowed_domains. | |
| max_characters | integer | Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result … | |
| max_results | integer | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. | |
| max_total_results | integer | 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. | |
| max_uses | integer | Maximum number of web searches the model may perform in a single request. Once reached, further search calls return an error result instead of executing. Applies to the Exa, Firecrawl, Parallel, and Perplexity engines. With native provider search, forwarded on… | |
| mode | enum | Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo, fast, basic (default), and advanced. Modes unsupported by the selected engine are ignored. | instant | fast | auto | deep-lite | deep | deep-reasoning · +3 more |
| search_context_size | enum | How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity 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 ada… | low | medium | high |
| user_location | WebSearchUserLocationServerTool | Approximate user location for location-biased results. | |
| x_search | XSearchOptions | Enable SpaceXAI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXAI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXAI, per post and per user profile fetched. |
WebSearchEngineenum
The search engine to use for web search.
native | exa | firecrawl | parallel | perplexity
WebSearchEngineEnumenum
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 the Firecrawl search API. "parallel" uses the Parallel search…
native | exa | parallel | firecrawl | perplexity | auto
WebSearchModeenum
Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo, fast, basic (default), and advanced. Modes unsupported by the selected engine are ignored.
instant | fast | auto | deep-lite | deep | deep-reasoning · +3 more
WebSearchPluginobject
| enabled | boolean | Set to false to disable the web-search plugin for this request. Defaults to true. | |
| engine | enum | The search engine to use for web search. | native | exa | firecrawl | parallel | perplexity |
| exclude_domains | string[] | A list of domains to exclude from web search results. Supports wildcards (e.g. "*.substack.com") and path filtering (e.g. "openai.com/blog"). | |
| id* | enum | web | |
| include_domains | string[] | A list of domains to restrict web search results to. Supports wildcards (e.g. "*.substack.com") and path filtering (e.g. "openai.com/blog"). | |
| max_results | integer | ||
| max_uses | integer | 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). | |
| mode | enum | Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo, fast, basic (default), and advanced. Modes unsupported by the selected engine are ignored. | instant | fast | auto | deep-lite | deep | deep-reasoning · +3 more |
| search_prompt | string | ||
| user_location | any | any | ||
| x_search | XSearchOptions | Enable SpaceXAI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXAI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXAI, per post and per user profile fetched. |
WebSearchUserLocationobject
User location information for web search
| city | any | ||
| country | any | ||
| region | any | ||
| timezone | any | ||
| type | enum | approximate |
WebSearchUserLocationServerToolobject
Approximate user location for location-biased results.
| city | any | ||
| country | any | ||
| region | any | ||
| timezone | any | ||
| type | enum | approximate |
XSearchOptionsobject
Enable SpaceXAI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXAI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXAI, per post and per user profile fetched.
| allowed_x_handles | string[] | Only include posts from these X handles (max 20). Cannot be used with excluded_x_handles. | items ≤ 20 |
| enable_image_understanding | boolean | Analyze images attached to matching posts. | |
| enable_video_understanding | boolean | Analyze videos attached to matching posts. | |
| excluded_x_handles | string[] | Exclude posts from these X handles (max 20). Cannot be used with allowed_x_handles. | items ≤ 20 |
| from_date | string | Start of the post date range (ISO 8601 date, e.g. "2025-01-01"). | format: date |
| to_date | string | End of the post date range (ISO 8601 date, e.g. "2025-12-31"). | format: date |
Validate a payload
before you spend tokens$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"openrouter","endpointId":"messages","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}