GET
/v1/schemas/openrouter/chat/chat%2Fcompletions
Accept:
Request body
43 properties · 1 required · 137 $defs| property | type | description | constraints |
|---|---|---|---|
| messages* | ChatMessages[] | List of messages for the conversation | items ≥ 1 |
| 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 … | |
| debug | ChatDebugOptions | Debug options for inspecting request transformations (streaming only) | |
| 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… | |
| frequency_penalty | any | Frequency penalty (-2.0 to 2.0) | format: double |
| image_config | ImageConfig | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. | |
| logit_bias | any | Token logit bias adjustments | |
| logprobs | any | Return log probabilities | |
| max_completion_tokens | any | Maximum tokens in completion | |
| max_tokens | any | Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16. | |
| metadata | object | Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) | |
| min_p | any | Minimum probability threshold relative to the most likely token. Tokens with probability below min_p * (probability of top token) are filtered out. Not all providers support this parameter. | format: double |
| modalities | enum[] | Output modalities for the response. Supported values are "text", "image", and "audio". | |
| model | string | Model to use for completion | |
| models | any[] | Models to use for completion | |
| parallel_tool_calls | any | Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. | |
| plugins | AutoRouterPlugin | AutoBetaRouterPlugin | ModerationPlugin[] | Plugins you want to enable for this request, including their settings. | |
| prediction | Prediction | Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance. | |
| presence_penalty | any | Presence penalty (-2.0 to 2.0) | format: double |
| prompt_cache_key | any | ||
| prompt_cache_options | PromptCacheOptions | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: "30m" (default) or "12h"… | |
| provider | ProviderPreferences | When multiple model providers are available, optionally indicate your routing preference. | |
| reasoning | object | Configuration options for reasoning models | |
| reasoning_effort | enum | Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. | max | xhigh | high | medium | low | minimal · +2 more |
| repetition_penalty | any | Penalizes tokens based on how much they have already appeared in the text. A value of 1.0 means no penalty. Values above 1.0 penalize repeated tokens more strongly. Not all providers support this parameter. | format: double |
| response_format | object | object | object | … | Response format configuration | |
| 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 |
| seed | any | Random seed for deterministic outputs | |
| service_tier | enum | The service tier to use for processing this request. `fast` is accepted as an alias for `priority`. `ultrafast` prefers ultrafast endpoints and falls back to `priority`, then default endpoints. | auto | default | fast | flex | priority | scale · +2 more |
| 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 |
| stop | string | string[] | Stop sequences (up to 4) | nullable |
| 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 | Enable streaming response | default: false |
| stream_options | ChatStreamOptions | Streaming configuration options | |
| temperature | any | Sampling temperature (0-2) | format: double |
| tool_choice | enum | enum | enum | … | Tool choice configuration | |
| tools | ChatFunctionTool[] | Available tools for function calling | |
| top_a | any | Consider only tokens with "sufficiently high" probabilities based on the probability of the most likely token. Not all providers support this parameter. | format: double |
| top_k | any | Limits the model to choose from the top K most likely tokens at each step. A value of 1 means the model will always pick the most likely next token. Not all providers support this parameter. | |
| top_logprobs | any | Number of top log probabilities to return (0-20) | |
| top_p | any | Nucleus sampling parameter (0-1) | 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 | Per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity… |
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"openrouter","endpointId":"chat/completions","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}