GET

/v1/schemas/openrouter/chat/messages

kind inputactivity chathash fcc606f5extracted Jul 26, 2026version currentsource upstream spec ↗

Request body

27 properties · 2 required · 90 $defs
propertytypedescriptionconstraints
messages*any
model*string
cache_controlAnthropicCacheControlDirectiveEnable 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_managementobject
fallbacksanyFallback 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_tokensinteger
metadataobject
modelsstring[]
output_configMessagesOutputConfigConfiguration for controlling output behavior. Supports the effort parameter and structured output format.
pluginsAutoRouterPlugin | AutoBetaRouterPlugin | ModerationPlugin[]Plugins you want to enable for this request, including their settings.
providerProviderPreferencesWhen multiple model providers are available, optionally indicate your routing preference.
routeenum**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_tierstring
session_idstringA 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
speedenum | any
stop_sequencesstring[]
stop_server_tools_whenStopServerToolsWhenCondition[]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
streamboolean
systemstring | AnthropicTextBlockParam[]
temperaturenumberformat: double
thinkingobject | object | object
tool_choiceobject | object | object | …
toolsobject | object | object[]
top_kinteger
top_pnumberformat: double
traceTraceConfigMetadata 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.
userstringA 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 tokens
shell
$ curl -X POST https://modelschemas.com/v1/validate \
    -d '{"provider":"openrouter","endpointId":"messages","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}