GET
/v1/schemas/openrouter/chat/messages
Accept:
Request body
27 properties · 2 required · 90 $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 | ||
| 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 |
| 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 |
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"openrouter","endpointId":"messages","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}