{"openapi":"3.0.0","info":{"description":"OpenRouter API connector — unified LLM routing (chat completions, models, embeddings, rerank, TTS/STT, images/video, responses, presets, credits, API keys, BYOK, guardrails, SCIM, workspaces). Official OpenAPI 3.1 spec (79 paths / 103 operations); Bearer API key sk-or-v1-...; host openrouter.ai/api/v1.","version":"v1"},"servers":[{"description":"OpenRouter API connector — unified LLM routing (chat completions, models, embeddings, rerank, TTS/STT, images/video, responses, presets, credits, API keys, BYOK, guardrails, SCIM, workspaces). Official OpenAPI 3.1 spec (79 paths / 103 operations); Bearer API key sk-or-v1-...; host openrouter.ai/api/v1.","url":"https://api.apirails.com/openrouter"}],"paths":{"/activity":{"get":{"tags":["Analytics"],"parameters":[{"name":"api_key_hash","in":"query","description":"Filter by API key hash (SHA-256 hex string, as returned by the keys API).","required":false,"schema":{"type":"string","example":""}},{"name":"date","in":"query","description":"Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).","required":false,"schema":{"type":"string","example":""}},{"name":"group_by","in":"query","description":"Set to 'workspace' to split each row per workspace and include `workspace_id` on every item. Omitted by default, in which case rows are aggregated across workspaces (by date, model, and endpoint) and `workspace_id` is not returned — preserving the historical response shape.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["workspace"]}}},{"name":"user_id","in":"query","description":"Filter by org member user ID. Only applicable for organization accounts.","required":false,"schema":{"type":"string","example":""}},{"name":"workspace_id","in":"query","description":"Filter by workspace ID (UUID). Returns only activity attributed to that workspace. The workspace must belong to the authenticated account.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/analytics/get-user-activity-grouped-by-endpoint.md","api_endpoint":"https://openrouter.ai/api/v1/activity"},"summary":"Get user activity grouped by endpoint","description":"Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]}},"/analytics/meta":{"get":{"tags":["Analytics"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/analytics/get-available-analytics-metrics-and-dimensions.md","api_endpoint":"https://openrouter.ai/api/v1/analytics/meta"},"summary":"Get available analytics metrics and dimensions","description":"Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]}},"/analytics/query":{"post":{"tags":["Analytics"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/analytics/query-analytics-data.md","api_endpoint":"https://openrouter.ai/api/v1/analytics/query"},"summary":"Query analytics data","description":"Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"classifier_dimensions":{"type":"object","description":"Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace.","properties":{"classifier_id":{"type":"string","description":"UUID of the classifier whose tags to group by.","required":true},"dimension_names":{"type":"array","description":"Value"},"include_nulls":{"type":"boolean","description":"When true, also include generations that have no tag from this classifier. Defaults to false, which returns only classified generations."}}},"classifier_filters":{"type":"object","description":"Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions.","properties":{"classifier_id":{"type":"string","description":"UUID of the classifier whose tags to filter by. Must match classifier_dimensions.classifier_id when both are specified.","required":true},"filters":{"type":"array","description":"Value","required":true}}},"dimensions":{"type":"array","description":"Value","items":{"type":"string"}},"filters":{"type":"array","description":"Value","items":{"type":"object","properties":{"field":{"type":"string","description":"Dimension to filter on. Use the /meta endpoint for available dimensions.","required":true},"include_unset":{"type":"boolean","description":"Include rows where the dimension has no value. Applies only to the `in` and `not_in` operators and dimensions that have an unset bucket."},"operator":{"type":"string","description":"Filter operator","required":true},"value":{"type":"string","description":"Value","required":true}}}},"granularity":{"type":"string","description":"Time granularity"},"group_limit":{"type":"number","description":"Maximum rows per distinct combination of dimensions. When omitted on time-series queries (granularity + dimensions), auto-computed to avoid truncating time windows. Explicit values override the default and may truncate time buckets if set lower than the number of buckets in the range. Ignored when no dimensions are specified."},"limit":{"type":"number","description":"Maximum total rows returned. Defaults to 1000. On time-series queries with dimensions and no explicit group_limit, the server may raise this to accommodate the expected number of unique time-bucket/dimension combinations."},"metrics":{"type":"array","description":"Value","required":true,"items":{"type":"string"}},"order_by":{"type":"object","description":"Value","properties":{"direction":{"type":"string","description":"Value","required":true,"enum":["asc","desc"]},"field":{"type":"string","description":"Field to order by: a metric included in `metrics` (or \"request_count\", which may be ordered by without being requested), a requested dimension, or \"date\".","required":true}}},"time_range":{"type":"object","description":"Value","properties":{"end":{"type":"string","description":"ISO 8601 UTC timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.","required":true},"start":{"type":"string","description":"ISO 8601 UTC timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.","required":true}}}}},"example":{"classifier_dimensions":{},"classifier_filters":{},"dimensions":[],"filters":[],"granularity":"","group_limit":"","limit":"","metrics":[],"order_by":{},"time_range":{}}}}}}},"/audio/speech":{"post":{"tags":["TTS"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/tts/create-speech.md","api_endpoint":"https://openrouter.ai/api/v1/audio/speech"},"summary":"Create speech","description":"Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"input":{"type":"string","description":"Text to synthesize","required":true},"input_references":{"type":"array","description":"Reference content for stateless voice cloning: one `input_audio` part carrying the voice sample, optionally accompanied by one `text` part with its transcript. Only routed to endpoints that support voice cloning.","items":{"type":"string"}},"model":{"type":"string","description":"TTS model identifier","required":true},"provider":{"type":"object","description":"Provider-specific passthrough configuration","properties":{"options":{"type":"object","description":"Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped."}}},"response_format":{"type":"string","description":"Audio output format","enum":["mp3","pcm"]},"speed":{"type":"number","description":"Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers."},"voice":{"type":"string","description":"Voice identifier (provider-specific)."}}},"example":{"input":"","input_references":[],"model":"","provider":{},"response_format":"","speed":"","voice":""}}}}}},"/audio/transcriptions":{"post":{"tags":["STT"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/stt/create-transcription.md","api_endpoint":"https://openrouter.ai/api/v1/audio/transcriptions"},"summary":"Create transcription","description":"Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"input_audio":{"type":"object","description":"Base64-encoded audio to transcribe","required":true,"properties":{"data":{"type":"string","description":"Base64-encoded audio data (raw bytes, not a data URI)","required":true},"format":{"type":"string","description":"Audio format (e.g., wav, mp3, flac, m4a, ogg, webm, aac). Supported formats vary by provider.","required":true}}},"language":{"type":"string","description":"ISO-639-1 language code (e.g., \"en\", \"ja\"). Auto-detected if omitted."},"model":{"type":"string","description":"STT model identifier","required":true},"provider":{"type":"object","description":"Provider-specific passthrough configuration","properties":{"options":{"type":"object","description":"Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped."}}},"response_format":{"type":"string","description":"Output format. \"json\" (default) returns { text, usage }. \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers.","enum":["json","verbose_json"]},"temperature":{"type":"number","description":"Sampling temperature for transcription"},"timestamp_granularities":{"type":"array","description":"Timestamp detail levels to include when response_format is \"verbose_json\". \"segment\" returns segment-level timestamps; \"word\" additionally returns word-level timestamps in the words array. Ignored unless response_format is \"verbose_json\".","items":{"type":"string"}}}},"example":{"input_audio":{},"language":"","model":"","provider":{},"response_format":"","temperature":"","timestamp_granularities":[]}}}}}},"/auth/keys":{"post":{"tags":["OAuth"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/oauth/exchange-authorization-code-for-api-key.md","api_endpoint":"https://openrouter.ai/api/v1/auth/keys"},"summary":"Exchange authorization code for API key","description":"Exchange an authorization code from the PKCE flow for a user-controlled API key","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"code":{"type":"string","description":"The authorization code received from the OAuth redirect","required":true},"code_challenge_method":{"type":"string","description":"The method used to generate the code challenge","enum":["S256","plain","None"]},"code_verifier":{"type":"string","description":"The code verifier if code_challenge was used in the authorization request"}}},"example":{"code":"","code_challenge_method":"","code_verifier":""}}}}}},"/auth/keys/code":{"post":{"tags":["OAuth"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/oauth/create-authorization-code.md","api_endpoint":"https://openrouter.ai/api/v1/auth/keys/code"},"summary":"Create authorization code","description":"Create an authorization code for the PKCE flow to generate a user-controlled API key","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"callback_url":{"type":"string","description":"The callback URL to redirect to after authorization. Supports https URLs and localhost/127.0.0.1 URLs on any port for local CLI tools.","required":true},"code_challenge":{"type":"string","description":"PKCE code challenge for enhanced security"},"code_challenge_method":{"type":"string","description":"The method used to generate the code challenge","enum":["S256","plain"]},"expires_at":{"type":"string","description":"Optional ISO 8601 UTC expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected."},"key_label":{"type":"string","description":"Optional custom label for the API key. Defaults to the app name if not provided."},"limit":{"type":"number","description":"Credit limit for the API key to be created"},"spawn_agent":{"type":"string","description":"Agent identifier for spawn telemetry"},"spawn_cloud":{"type":"string","description":"Cloud identifier for spawn telemetry"},"usage_limit_type":{"type":"string","description":"Optional credit limit reset interval. When set, the credit limit resets on this interval.","enum":["daily","weekly","monthly"]},"workspace_id":{"type":"string","description":"Optional workspace ID to associate the API key with"}}},"example":{"callback_url":"","code_challenge":"","code_challenge_method":"","expires_at":"","key_label":"","limit":"","spawn_agent":"","spawn_cloud":"","usage_limit_type":"","workspace_id":""}}}}}},"/benchmarks":{"get":{"tags":["Benchmarks"],"parameters":[{"name":"category","in":"query","description":"Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories.","required":false,"schema":{"type":"string","example":""}},{"name":"arena","in":"query","description":"Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["models","builders","agents"]}}},{"name":"benchmark_type","in":"query","description":"Return results for one exact OpenRouter benchmark. A `search_*` value narrows the response to search results only; a classic value narrows the OpenRouter items and leaves other sources' items as they are.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["gpqa_diamond","tau_bench_verified_airline","search_browsecomp","search_hle","search_dsqa","search_widesearch"]}}},{"name":"include_run_config","in":"query","description":"Search benchmarks only: include the published lane configuration whitelist in each search item. Defaults to false. The whitelist is limited to agent turn count, reasoning effort, and temperature so future harness configuration changes do not change the public contract.","required":false,"schema":{"type":"boolean","example":""}},{"name":"max_results","in":"query","description":"Maximum number of items to return. When omitted, all matching results are returned.","required":false,"schema":{"type":"number","example":""}},{"name":"search_engine","in":"query","description":"OpenRouter search benchmarks only: filter by the search engine used.","required":false,"schema":{"type":"string","example":""}},{"name":"search_surface","in":"query","description":"OpenRouter search benchmarks only: filter by the request surface the lane ran on.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["server-tool","plugin"]}}},{"name":"source","in":"query","description":"Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["artificial-analysis","design-arena","openrouter"]}}},{"name":"task_type","in":"query","description":"Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. `search` returns OpenRouter search benchmark results only.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["coding","intelligence","agentic","search"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/benchmarks/list-benchmarks.md","api_endpoint":"https://openrouter.ai/api/v1/benchmarks"},"summary":"List Benchmarks","description":"Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena, and OpenRouter's own tau-bench, GPQA, and web-search evals). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Use task_type=search (or a search_* benchmark_type) for OpenRouter's search benchmarks, which publish each model's highest-scoring eligible evaluation configuration with same-configuration runs combined by task-weighted mean. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.","security":[{"bearerAuth":[]}]}},"/byok":{"get":{"tags":["BYOK"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of records to return (max 100)","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination","required":false,"schema":{"type":"number","example":""}},{"name":"provider","in":"query","description":"Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`).","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["ai21","aion-labs","akashml","alibaba","amazon-bedrock","amazon-nova","ambient","anthropic","arcee-ai","atlas-cloud","avian","azure","baidu","baseten","black-forest-labs","byteplus","cerebras","chutes","cirrascale","clarifai","cloudflare","cohere","coreweave","cosine","crusoe","darkbloom","databricks","decart","deepgram","deepinfra","deepseek","dekallm","digitalocean","featherless","fireworks","fish-audio","friendli","gmicloud","google-ai-studio","google-vertex","groq","heygen","inception","inceptron","inferact-vllm","inference-net","infermatic","inflection","io-net","ionstream","krea","liquid","makora","mancer","mara","meta","minimax","mistral","modal","modelrun","modular","moonshotai","morph","ncompass","nebius","nex-agi","nextbit","novita","nvidia","ollama","open-inference","openai","parasail","perceptron","perplexity","phala","poolside","prime-intellect","quiver","recraft","reka","relace","runway","sail-research","sakana","sakana-ai","sambanova","seed","siliconflow","sourceful","stepfun","streamlake","switchpoint","tencent","tenstorrent","thinkingmachines","together","upstage","venice","voyageai","wafer","wandb","wandb-legacy","xai","xiaomi","z-ai"]}}},{"name":"workspace_id","in":"query","description":"Optional workspace ID to filter by. When omitted, resolves to the account’s default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/byok/list-byok-provider-credentials.md","api_endpoint":"https://openrouter.ai/api/v1/byok"},"summary":"List BYOK provider credentials","description":"List the bring-your-own-key (BYOK) provider credentials for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace, or the `provider` query parameter to filter by upstream provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]},"post":{"tags":["BYOK"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/byok/create-a-byok-provider-credential.md","api_endpoint":"https://openrouter.ai/api/v1/byok"},"summary":"Create a BYOK provider credential","description":"Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. When `workspace_id` is omitted, the credential is created in the default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly. Treat the raw key as write-only; it is never returned after creation. Use `allowed_api_key_hashes` to restrict the credential to specific OpenRouter API keys. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"allowed_api_key_hashes":{"type":"array","description":"Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction. Must contain at least one hash if provided. Hashes that do not belong to your account return a 400.","items":{"type":"string"}},"allowed_models":{"type":"array","description":"Optional allowlist of model slugs this credential may be used for. `null` means no restriction.","items":{"type":"string"}},"allowed_user_ids":{"type":"array","description":"Optional allowlist of user IDs that may use this credential. `null` means no restriction.","items":{"type":"string"}},"disabled":{"type":"boolean","description":"Whether this credential should be created in a disabled state."},"is_fallback":{"type":"boolean","description":"Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried."},"key":{"type":"string","description":"The raw provider API key or credential. This value is encrypted at rest and never returned in API responses.","required":true},"name":{"type":"string","description":"Optional human-readable name for the credential."},"provider":{"type":"string","description":"The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`).","required":true,"enum":["ai21","aion-labs","akashml","alibaba","amazon-bedrock","amazon-nova","ambient","anthropic","arcee-ai","atlas-cloud","avian","azure","baidu","baseten","black-forest-labs","byteplus","cerebras","chutes","cirrascale","clarifai","cloudflare","cohere","coreweave","cosine","crusoe","darkbloom","databricks","decart","deepgram","deepinfra","deepseek","dekallm","digitalocean","featherless","fireworks","fish-audio","friendli","gmicloud","google-ai-studio","google-vertex","groq","heygen","inception","inceptron","inferact-vllm","inference-net","infermatic","inflection","io-net","ionstream","krea","liquid","makora","mancer","mara","meta","minimax","mistral","modal","modelrun","modular","moonshotai","morph","ncompass","nebius","nex-agi","nextbit","novita","nvidia","ollama","open-inference","openai","parasail","perceptron","perplexity","phala","poolside","prime-intellect","quiver","recraft","reka","relace","runway","sail-research","sakana","sakana-ai","sambanova","seed","siliconflow","sourceful","stepfun","streamlake","switchpoint","tencent","tenstorrent","thinkingmachines","together","upstage","venice","voyageai","wafer","wandb","wandb-legacy","xai","xiaomi","z-ai"]},"workspace_id":{"type":"string","description":"Optional workspace ID to scope the credential to. When omitted, the credential is created in the account's default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly."}}},"example":{"allowed_api_key_hashes":[],"allowed_models":[],"allowed_user_ids":[],"disabled":"","is_fallback":"","key":"","name":"","provider":"","workspace_id":""}}}}}},"/byok/{id}":{"delete":{"tags":["BYOK"],"parameters":[{"name":"id","in":"path","description":"The BYOK credential ID (UUID).","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/byok/delete-a-byok-provider-credential.md","api_endpoint":"https://openrouter.ai/api/v1/byok/{id}"},"summary":"Delete a BYOK provider credential","description":"Delete (soft-delete) a bring-your-own-key (BYOK) provider credential by its `id`. The encrypted key material is wiped and the record is marked as deleted. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}},"get":{"tags":["BYOK"],"parameters":[{"name":"id","in":"path","description":"The BYOK credential ID (UUID).","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/byok/get-a-byok-provider-credential.md","api_endpoint":"https://openrouter.ai/api/v1/byok/{id}"},"summary":"Get a BYOK provider credential","description":"Get a single bring-your-own-key (BYOK) provider credential by its `id`. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]},"patch":{"tags":["BYOK"],"parameters":[{"name":"id","in":"path","description":"The BYOK credential ID (UUID).","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/byok/update-a-byok-provider-credential.md","api_endpoint":"https://openrouter.ai/api/v1/byok/{id}"},"summary":"Update a BYOK provider credential","description":"Update an existing bring-your-own-key (BYOK) provider credential by its `id`. Include the `key` field to rotate the raw provider API key in-place (the previous key material is overwritten). Use `allowed_api_key_hashes` to restrict the credential to specific OpenRouter API keys (`null` clears the restriction). [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"allowed_api_key_hashes":{"type":"array","description":"Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` clears the restriction. Must contain at least one hash if provided. Hashes that do not belong to your account return a 400.","items":{"type":"string"}},"allowed_models":{"type":"array","description":"Optional allowlist of model slugs this credential may be used for. `null` means no restriction.","items":{"type":"string"}},"allowed_user_ids":{"type":"array","description":"Optional allowlist of user IDs that may use this credential. `null` means no restriction.","items":{"type":"string"}},"disabled":{"type":"boolean","description":"Whether this credential is disabled."},"is_fallback":{"type":"boolean","description":"Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried."},"key":{"type":"string","description":"A new raw provider API key to rotate the credential in-place. The previous key material is overwritten and the masked label is regenerated. Encrypted at rest and never returned in API responses."},"name":{"type":"string","description":"Optional human-readable name for the credential."}}},"example":{"allowed_api_key_hashes":[],"allowed_models":[],"allowed_user_ids":[],"disabled":"","is_fallback":"","key":"","name":""}}}}}},"/chat/completions":{"post":{"tags":["Chat"],"parameters":[{"name":"X-OpenRouter-Metadata","in":"query","description":"Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["disabled","enabled"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/chat/create-a-chat-completion.md","api_endpoint":"https://openrouter.ai/api/v1/chat/completions"},"summary":"Create a chat completion","description":"Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"cache_control":{"type":"object","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. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.","properties":{"type":{"type":"string","description":"Value","required":true,"enum":["ephemeral"]},"ttl":{"type":"string","description":"Value","enum":["5m","1h"]}}},"debug":{"type":"object","description":"Debug options for inspecting request transformations (streaming only)","properties":{"echo_upstream_body":{"type":"boolean","description":"If true, includes the transformed upstream request body in a debug chunk at the start of the stream. Only works with streaming mode."}}},"frequency_penalty":{"type":"number","description":"Frequency penalty (-2.0 to 2.0)"},"image_config":{"type":"object","description":"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.","properties":{}},"logit_bias":{"type":"object","description":"Token logit bias adjustments","properties":{}},"logprobs":{"type":"boolean","description":"Return log probabilities"},"max_completion_tokens":{"type":"number","description":"Maximum tokens in completion"},"max_tokens":{"type":"number","description":"Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16."},"messages":{"type":"array","description":"List of messages for the conversation","required":true,"items":{"type":"string"}},"metadata":{"type":"object","description":"Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)","properties":{}},"min_p":{"type":"number","description":"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."},"modalities":{"type":"array","description":"Output modalities for the response. Supported values are \"text\", \"image\", and \"audio\".","items":{"type":"string"}},"model":{"type":"string","description":"Model to use for completion"},"models":{"type":"array","description":"Models to use for completion","items":{"type":"string"}},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response."},"plugins":{"type":"array","description":"Plugins you want to enable for this request, including their settings.","items":{"type":"string"}},"prediction":{"type":"object","description":"Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance.","properties":{"type":{"type":"string","description":"Value","required":true,"enum":["content"]},"content":{"type":"string","description":"Value","required":true}}},"presence_penalty":{"type":"number","description":"Presence penalty (-2.0 to 2.0)"},"prompt_cache_key":{"type":"string","description":"Value"},"prompt_cache_options":{"type":"object","description":"Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.","properties":{"mode":{"type":"string","description":"Value","required":true,"enum":["explicit"]},"ttl":{"type":"string","description":"Value"}}},"provider":{"type":"object","description":"When multiple model providers are available, optionally indicate your routing preference.","properties":{"allow_fallbacks":{"type":"boolean","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."},"data_collection":{"type":"string","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","None"]},"enforce_distillable_text":{"type":"boolean","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."},"ignore":{"type":"array","description":"List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."},"max_price":{"type":"object","description":"The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."},"only":{"type":"array","description":"List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."},"order":{"type":"array","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."},"preferred_max_latency":{"type":"number","description":"Value"},"preferred_min_throughput":{"type":"number","description":"Value"},"quantizations":{"type":"array","description":"A list of quantization levels to filter the provider by."},"require_parameters":{"type":"boolean","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."},"sort":{"type":"string","description":"The provider sorting strategy (price, throughput, latency)","enum":["price","throughput","latency","exacto"]},"zdr":{"type":"boolean","description":"Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used."}}},"reasoning":{"type":"object","description":"Configuration options for reasoning models","properties":{"effort":{"type":"string","description":"Constrains effort on reasoning for reasoning models","enum":["max","xhigh","high","medium","low","minimal","none","None"]},"summary":{"type":"string","description":"Value","enum":["auto","concise","detailed","None"]}}},"reasoning_effort":{"type":"string","description":"Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ.","enum":["max","xhigh","high","medium","low","minimal","none","None"]},"repetition_penalty":{"type":"number","description":"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."},"response_format":{"type":"string","description":"Response format configuration"},"route":{"type":"string","description":"**DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: \"fallback\" (maps to \"model\"), \"sort\" (maps to \"none\").","enum":["fallback","sort","None"]},"seed":{"type":"number","description":"Random seed for deterministic outputs"},"service_tier":{"type":"string","description":"The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.","enum":["auto","default","fast","flex","priority","scale","None"]},"session_id":{"type":"string","description":"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 observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters."},"stop":{"type":"string","description":"Value"},"stop_server_tools_when":{"type":"array","description":"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 turn is made with tool calls disabled so the response ends with a natural-language answer instead of an unfinished tool call.","items":{"type":"string"}},"stream":{"type":"boolean","description":"Enable streaming response"},"stream_options":{"type":"object","description":"Streaming configuration options","properties":{"include_usage":{"type":"boolean","description":"Deprecated: This field has no effect. Full usage details are always included."}}},"temperature":{"type":"number","description":"Sampling temperature (0-2)"},"tool_choice":{"type":"string","description":"Value","enum":["none"]},"tools":{"type":"array","description":"Available tools for function calling","items":{"type":"object","properties":{"type":{"type":"string","description":"Value","required":true,"enum":["function"]},"cache_control":{"type":"string","description":"Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request."},"function":{"type":"object","description":"Function definition for tool calling","required":true}}}},"top_a":{"type":"number","description":"Consider only tokens with \"sufficiently high\" probabilities based on the probability of the most likely token. Not all providers support this parameter."},"top_k":{"type":"number","description":"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":{"type":"number","description":"Number of top log probabilities to return (0-20)"},"top_p":{"type":"number","description":"Nucleus sampling parameter (0-1)"},"trace":{"type":"object","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","description":"Value"},"parent_span_id":{"type":"string","description":"Value"},"span_name":{"type":"string","description":"Value"},"trace_id":{"type":"string","description":"Value"},"trace_name":{"type":"string","description":"Value"}}},"user":{"type":"string","description":"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, so provider policy blocks can affect the whole account."}}},"example":{"cache_control":{},"debug":{},"frequency_penalty":"","image_config":{},"logit_bias":{},"logprobs":"","max_completion_tokens":"","max_tokens":"","messages":[],"metadata":{},"min_p":"","modalities":[],"model":"","models":[],"parallel_tool_calls":"","plugins":[],"prediction":{},"presence_penalty":"","prompt_cache_key":"","prompt_cache_options":{},"provider":{},"reasoning":{},"reasoning_effort":"","repetition_penalty":"","response_format":"","route":"","seed":"","service_tier":"","session_id":"","stop":"","stop_server_tools_when":[],"stream":"","stream_options":{},"temperature":"","tool_choice":"","tools":[],"top_a":"","top_k":"","top_logprobs":"","top_p":"","trace":{},"user":""}}}}}},"/classifications/task":{"get":{"tags":["Classifications"],"parameters":[{"name":"window","in":"query","description":"Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["7d"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/classifications/task-classification-market-share.md","api_endpoint":"https://openrouter.ai/api/v1/classifications/task"},"summary":"Task classification market share","description":"Returns the market-share breakdown of OpenRouter traffic by task classification","security":[{"bearerAuth":[]}]}},"/containers/{container_id}/files":{"get":{"tags":["Containers"],"parameters":[{"name":"container_id","in":"path","description":"The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r<nonce>`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.","required":true,"schema":{"type":"string","example":""}},{"name":"after","in":"query","description":"Forward cursor: a container file id from a previous page (typically `last_id`); listing resumes strictly after that file.","required":false,"schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"Maximum number of files to return (1-1000). Defaults to 100 when absent.","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/containers/list-container-files.md","api_endpoint":"https://openrouter.ai/api/v1/containers/{container_id}/files"},"summary":"List container files","description":"Lists the files in a container, in lexicographic path order. The container id is the canonical id returned in bash/shell tool results; a restarted session is a separate container with its own id. Paginate with `limit` and `after` (pass the previous page’s `last_id`); `has_more: true` always means the next page is fetchable that way.","security":[{"bearerAuth":[]}]}},"/containers/{container_id}/files/{file_id}":{"get":{"tags":["Containers"],"parameters":[{"name":"container_id","in":"path","description":"The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r<nonce>`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.","required":true,"schema":{"type":"string","example":""}},{"name":"file_id","in":"path","description":"Container file id (`cfile_` + base64url of the file path).","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/containers/retrieve-a-container-file.md","api_endpoint":"https://openrouter.ai/api/v1/containers/{container_id}/files/{file_id}"},"summary":"Retrieve a container file","description":"Returns the metadata of a single file in a container.","security":[{"bearerAuth":[]}]}},"/containers/{container_id}/files/{file_id}/content":{"get":{"tags":["Containers"],"parameters":[{"name":"container_id","in":"path","description":"The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r<nonce>`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.","required":true,"schema":{"type":"string","example":""}},{"name":"file_id","in":"path","description":"Container file id (`cfile_` + base64url of the file path).","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/containers/download-container-file-content.md","api_endpoint":"https://openrouter.ai/api/v1/containers/{container_id}/files/{file_id}/content"},"summary":"Download container file content","description":"Streams the raw bytes of a file in a container.","security":[{"bearerAuth":[]}]}},"/containers/{container_id}/files/{file_id}/promote":{"post":{"tags":["Containers"],"parameters":[{"name":"container_id","in":"path","description":"The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r<nonce>`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.","required":true,"schema":{"type":"string","example":""}},{"name":"file_id","in":"path","description":"Container file id (`cfile_` + base64url of the file path).","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/containers/promote-a-container-file-into-workspace-documents.md","api_endpoint":"https://openrouter.ai/api/v1/containers/{container_id}/files/{file_id}/promote"},"summary":"Promote a container file into workspace documents","description":"Copies a file from the container's sandbox prefix into the workspace's durable document storage, so it outlives the container. Returns the new document in the Files API shape, with a durable file id in the documents namespace. The copy counts against the workspace's storage quota. Unlike a direct upload, promoted files are downloadable.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/credits":{"get":{"tags":["Credits"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/credits/get-remaining-credits.md","api_endpoint":"https://openrouter.ai/api/v1/credits"},"summary":"Get remaining credits","description":"Get total credits purchased and used for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]}},"/credits/coinbase":{"post":{"tags":["Credits"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/credits/deprecated-coinbase-commerce-charge-endpoint.md","api_endpoint":"https://openrouter.ai/api/v1/credits/coinbase"},"summary":"Deprecated Coinbase Commerce charge endpoint","description":"Deprecated. The Coinbase APIs used by this endpoint have been deprecated, so Coinbase Commerce charges have been removed. Use the web credits purchase flow instead.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/datasets/app-rankings":{"get":{"tags":["Datasets"],"parameters":[{"name":"category","in":"query","description":"Marketplace category group to filter by (e.g. `coding`). Only apps tagged with a subcategory inside this group are returned. Mutually combinable with `subcategory` — when both are supplied the `subcategory` must belong to the `category` group.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["coding","creative","productivity","entertainment"]}}},{"name":"end_date","in":"query","description":"End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400.","required":false,"schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"Maximum number of apps to return (1-100). Defaults to 50.","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of ranked apps to skip before the first returned row (0-100). Defaults to 0. `rank` stays absolute, so the first row of `offset=50` is `rank: 51`.","required":false,"schema":{"type":"number","example":""}},{"name":"sort","in":"query","description":"`popular` ranks apps by total token volume inside the date window. `trending` ranks apps by absolute excess token growth: window volume minus the average volume of the three equal-length periods immediately preceding the window. Apps with no excess growth are omitted from `trending` results.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["popular","trending"]}}},{"name":"start_date","in":"query","description":"Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`.","required":false,"schema":{"type":"string","example":""}},{"name":"subcategory","in":"query","description":"Marketplace subcategory to filter by (e.g. `cli-agent`). Takes precedence over `category` for the actual filter; when `category` is also supplied the pair must be consistent.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["cli-agent","ide-extension","cloud-agent","programming-app","native-app-builder","creative-writing","video-gen","image-gen","audio-gen","roleplay","game","writing-assistant","general-chat","personal-agent","legal"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/datasets/top-apps-by-token-usage.md","api_endpoint":"https://openrouter.ai/api/v1/datasets/app-rankings"},"summary":"Top apps by token usage","description":"Returns the top public apps on OpenRouter ranked by token usage inside the requested","security":[{"bearerAuth":[]}]}},"/datasets/rankings-daily":{"get":{"tags":["Datasets"],"parameters":[{"name":"category","in":"query","description":"Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["programming","roleplay","marketing","marketing/seo","technology","science","translation","legal","finance","health","trivia","academia"]}}},{"name":"context_bucket","in":"query","description":"Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["1K","10K","100K","1M","10M"]}}},{"name":"end_date","in":"query","description":"End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400.","required":false,"schema":{"type":"string","example":""}},{"name":"language_type","in":"query","description":"Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["natural","programming"]}}},{"name":"modality","in":"query","description":"Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["text","image","image_output","audio","tool_calling"]}}},{"name":"period","in":"query","description":"Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["day","week","month"]}}},{"name":"start_date","in":"query","description":"Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/datasets/daily-token-totals-for-top-50-models.md","api_endpoint":"https://openrouter.ai/api/v1/datasets/rankings-daily"},"summary":"Daily token totals for top 50 models","description":"Returns the top 50 public models per day by total token usage on OpenRouter, plus a","security":[{"bearerAuth":[]}]}},"/datasets/session-cost":{"get":{"tags":["Datasets"],"parameters":[{"name":"app_slug","in":"query","description":"Filter to one published harness slug.","required":false,"schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"Maximum number of cells to return (1-500). Defaults to 100.","required":false,"schema":{"type":"number","example":""}},{"name":"model","in":"query","description":"Exact model permaslug filter. Works across all harness apps.","required":false,"schema":{"type":"string","example":""}},{"name":"offset","in":"query","description":"Number of sorted cells to skip (0-5000). Defaults to 0.","required":false,"schema":{"type":"number","example":""}},{"name":"turn_range","in":"query","description":"Filter by the inclusive number of turns in a session.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["1-turn","2-9-turns","10-49-turns","50-plus-turns"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/datasets/cost-per-session-by-harness-and-model.md","api_endpoint":"https://openrouter.ai/api/v1/datasets/session-cost"},"summary":"Cost per session by harness and model","description":"Returns weekly refreshed, aggregated cost-per-session cells for the published harnesses.","security":[{"bearerAuth":[]}]}},"/embeddings":{"post":{"tags":["Embeddings"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/embeddings/submit-an-embedding-request.md","api_endpoint":"https://openrouter.ai/api/v1/embeddings"},"summary":"Submit an embedding request","description":"Submits an embedding request to the embeddings router","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"dimensions":{"type":"number","description":"The number of dimensions for the output embeddings"},"encoding_format":{"type":"string","description":"The format of the output embeddings","enum":["float","base64"]},"input":{"type":"string","description":"Value","required":true},"input_type":{"type":"string","description":"The type of input (e.g. search_query, search_document)"},"model":{"type":"string","description":"The model to use for embeddings","required":true},"provider":{"type":"string","description":"Value"},"user":{"type":"string","description":"A unique identifier for the end-user"}}},"example":{"dimensions":"","encoding_format":"","input":"","input_type":"","model":"","provider":"","user":""}}}}}},"/embeddings/models":{"get":{"tags":["Embeddings"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/embeddings/list-all-embeddings-models.md","api_endpoint":"https://openrouter.ai/api/v1/embeddings/models"},"summary":"List all embeddings models","description":"Returns a list of all available embeddings models and their properties","security":[{"bearerAuth":[]}]}},"/endpoints/zdr":{"get":{"tags":["Endpoints"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/endpoints/preview-the-impact-of-zdr-on-the-available-endpoints.md","api_endpoint":"https://openrouter.ai/api/v1/endpoints/zdr"},"summary":"Preview the impact of ZDR on the available endpoints","description":"Preview the impact of ZDR on the available endpoints","security":[{"bearerAuth":[]}]}},"/files":{"get":{"tags":["Files"],"parameters":[{"name":"after","in":"query","description":"OpenAI-style forward cursor: the id to list after.","required":false,"schema":{"type":"string","example":""}},{"name":"after_id","in":"query","description":"Anthropic-style forward cursor: the id to list after.","required":false,"schema":{"type":"string","example":""}},{"name":"before_id","in":"query","description":"Anthropic-style reverse cursor. Not supported by OpenRouter storage.","required":false,"schema":{"type":"string","example":""}},{"name":"cursor","in":"query","description":"Opaque pagination cursor from a previous response.","required":false,"schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"Maximum number of files to return (1–1000).","required":false,"schema":{"type":"number","example":""}},{"name":"order","in":"query","description":"Sort direction. Only `asc` is supported by OpenRouter storage.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["asc","desc"]}}},{"name":"provider","in":"query","description":"Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["openai","anthropic"]}}},{"name":"workspace_id","in":"query","description":"Workspace to scope the request to. Defaults to the caller’s default workspace.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/files/list-files.md","api_endpoint":"https://openrouter.ai/api/v1/files"},"summary":"List files","description":"Lists files belonging to the workspace of the authenticating API key.","security":[{"bearerAuth":[]}]},"post":{"tags":["Files"],"parameters":[{"name":"provider","in":"query","description":"Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["openai","anthropic"]}}},{"name":"workspace_id","in":"query","description":"Workspace to scope the request to. Defaults to the caller’s default workspace.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/files/upload-a-file.md","api_endpoint":"https://openrouter.ai/api/v1/files"},"summary":"Upload a file","description":"Uploads a file to be referenced in future API calls. The file is stored under the workspace of the authenticating API key. Maximum file size: 100 MB; empty files are rejected. The file type is determined from the file contents — not the filename or the declared content type — and must be a PDF, a PNG/JPEG/GIF/WebP image, a DOCX/XLSX/PPTX document, an MP3/WAV/FLAC/OGG audio file, or UTF-8 text. Text is reported by its structure as `application/json`, `application/x-ndjson`, `text/csv`, `text/markdown`, or `text/plain`.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"file":{"type":"string","description":"Value","required":true}}},"example":{"file":""}}}}}},"/files/{file_id}":{"delete":{"tags":["Files"],"parameters":[{"name":"file_id","in":"path","description":"Value","required":true,"schema":{"type":"string","example":""}},{"name":"provider","in":"query","description":"Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["openai","anthropic"]}}},{"name":"workspace_id","in":"query","description":"Workspace to scope the request to. Defaults to the caller’s default workspace.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/files/delete-a-file.md","api_endpoint":"https://openrouter.ai/api/v1/files/{file_id}"},"summary":"Delete a file","description":"Deletes a file owned by the requesting workspace. Deletion is irreversible.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}},"get":{"tags":["Files"],"parameters":[{"name":"file_id","in":"path","description":"Value","required":true,"schema":{"type":"string","example":""}},{"name":"provider","in":"query","description":"Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["openai","anthropic"]}}},{"name":"workspace_id","in":"query","description":"Workspace to scope the request to. Defaults to the caller’s default workspace.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/files/get-file-metadata.md","api_endpoint":"https://openrouter.ai/api/v1/files/{file_id}"},"summary":"Get file metadata","description":"Retrieves metadata for a single file owned by the requesting workspace.","security":[{"bearerAuth":[]}]}},"/files/{file_id}/content":{"get":{"tags":["Files"],"parameters":[{"name":"file_id","in":"path","description":"Value","required":true,"schema":{"type":"string","example":""}},{"name":"provider","in":"query","description":"Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["openai","anthropic"]}}},{"name":"workspace_id","in":"query","description":"Workspace to scope the request to. Defaults to the caller’s default workspace.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/files/download-file-content.md","api_endpoint":"https://openrouter.ai/api/v1/files/{file_id}/content"},"summary":"Download file content","description":"Downloads the raw bytes of a file. Only files created server-side are downloadable; uploaded files return 400.","security":[{"bearerAuth":[]}]}},"/generation":{"get":{"tags":["Generations"],"parameters":[{"name":"id","in":"query","description":"The generation ID","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/generations/get-request-&-usage-metadata-for-a-generation.md","api_endpoint":"https://openrouter.ai/api/v1/generation"},"summary":"Get request & usage metadata for a generation","description":"Get request & usage metadata for a generation","security":[{"bearerAuth":[]}]}},"/generation/content":{"get":{"tags":["Generations"],"parameters":[{"name":"id","in":"query","description":"The generation ID","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/generations/get-stored-prompt-completion-and-error-content-for-a-generation.md","api_endpoint":"https://openrouter.ai/api/v1/generation/content"},"summary":"Get stored prompt, completion, and error content for a generation","description":"Get stored prompt, completion, and error content for a generation","security":[{"bearerAuth":[]}]}},"/generation/feedback":{"post":{"tags":["Generations"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/generations/submit-feedback-for-a-generation.md","api_endpoint":"https://openrouter.ai/api/v1/generation/feedback"},"summary":"Submit feedback for a generation","description":"Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"category":{"type":"string","description":"The category of feedback being reported","required":true,"enum":["latency","incoherence","incorrect_response","formatting","billing","api_error","other"]},"comment":{"type":"string","description":"An optional free-text comment describing the feedback"},"generation_id":{"type":"string","description":"The generation to submit feedback on","required":true}}},"example":{"category":"","comment":"","generation_id":""}}}}}},"/guardrails":{"get":{"tags":["Guardrails"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of records to return (max 100)","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination","required":false,"schema":{"type":"number","example":""}},{"name":"workspace_id","in":"query","description":"Filter guardrails by workspace ID. By default, guardrails in the default workspace are returned.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/guardrails/list-guardrails.md","api_endpoint":"https://openrouter.ai/api/v1/guardrails"},"summary":"List guardrails","description":"List all guardrails for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]},"post":{"tags":["Guardrails"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/guardrails/create-a-guardrail.md","api_endpoint":"https://openrouter.ai/api/v1/guardrails"},"summary":"Create a guardrail","description":"Create a new guardrail for the authenticated user. A newly created guardrail enforces nothing until it is assigned to API keys or organization members; `workspace_id` places the guardrail in a workspace but does not apply it to that workspace's traffic. To restrict all traffic in a workspace, update the workspace's default guardrail instead. Set `allowed_data_regions` to enforce [In-Region Routing](/docs/guides/features/in-region-routing#enforcing-in-region-routing-with-guardrails): governed requests must arrive through one of the listed OpenRouter domains and are rejected with a 403 otherwise. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"allowed_data_regions":{"type":"array","description":"Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected.","items":{"type":"string"}},"allowed_models":{"type":"array","description":"Array of model identifiers (slug or canonical_slug accepted)","items":{"type":"string"}},"allowed_providers":{"type":"array","description":"List of allowed provider IDs","items":{"type":"string"}},"content_filter_builtins":{"type":"array","description":"Builtin content filters to apply. Every builtin slug supports \"block\", \"redact\", and the detect-only \"flag\" action.","items":{"type":"object","properties":{"action":{"type":"string","description":"Action taken when the builtin filter triggers","required":true,"enum":["redact","block","flag"]},"label":{"type":"string","description":"Deprecated: labels are system-assigned and cannot be set by the caller. Accepted for backward compatibility but silently ignored."},"scan_scope":{"type":"string","description":"Which message roles to scan for prompt injection. Only applies to the regex-prompt-injection builtin. Defaults to all_messages.","enum":["user_only","all_messages"]},"slug":{"type":"string","description":"The builtin filter identifier","required":true,"enum":["email","phone","ssn","credit-card","ip-address","secrets","person-name","address","regex-prompt-injection"]}}}},"content_filters":{"type":"array","description":"Custom regex content filters to apply to request messages","items":{"type":"object","properties":{"action":{"type":"string","description":"Action taken when the pattern matches","required":true,"enum":["redact","block","flag"]},"label":{"type":"string","description":"Optional label used in redaction placeholders or error messages"},"pattern":{"type":"string","description":"A regex pattern to match against request content","required":true}}}},"description":{"type":"string","description":"Description of the guardrail"},"enable_free_model_publication":{"type":"boolean","description":"Whether this guardrail allows free endpoints that publish prompts."},"enable_free_model_training":{"type":"boolean","description":"Whether this guardrail allows free endpoints that train on request data."},"enable_paid_model_training":{"type":"boolean","description":"Whether this guardrail allows paid endpoints that train on request data."},"enforce_zdr":{"type":"boolean","description":"Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request."},"enforce_zdr_anthropic":{"type":"boolean","description":"Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided."},"enforce_zdr_google":{"type":"boolean","description":"Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided."},"enforce_zdr_openai":{"type":"boolean","description":"Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided."},"enforce_zdr_other":{"type":"boolean","description":"Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided."},"enforce_zdr_xai":{"type":"boolean","description":"Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided."},"ignored_models":{"type":"array","description":"Array of model identifiers to exclude from routing (slug or canonical_slug accepted)","items":{"type":"string"}},"ignored_providers":{"type":"array","description":"List of provider IDs to exclude from routing","items":{"type":"string"}},"include_byok_in_budgets":{"type":"boolean","description":"Whether BYOK (bring-your-own-key) inference spend counts toward this guardrail's limit_usd, in addition to OpenRouter credit spend. Defaults to false."},"limit_usd":{"type":"number","description":"Spending limit in USD. Must be provided together with `reset_interval`: a request that sets only one of the two is rejected with a 400."},"name":{"type":"string","description":"Name for the new guardrail","required":true},"reset_interval":{"type":"string","description":"Interval at which the limit resets (daily, weekly, monthly)","enum":["daily","weekly","monthly","None"]},"workspace_id":{"type":"string","description":"The workspace to create the guardrail in. When omitted, the guardrail is created in the default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly. This only places the guardrail in the workspace; the created guardrail enforces nothing for that workspace's traffic until it is assigned to API keys or members. To restrict all traffic in a workspace, update the workspace's default guardrail instead."}}},"example":{"allowed_data_regions":[],"allowed_models":[],"allowed_providers":[],"content_filter_builtins":[],"content_filters":[],"description":"","enable_free_model_publication":"","enable_free_model_training":"","enable_paid_model_training":"","enforce_zdr":"","enforce_zdr_anthropic":"","enforce_zdr_google":"","enforce_zdr_openai":"","enforce_zdr_other":"","enforce_zdr_xai":"","ignored_models":[],"ignored_providers":[],"include_byok_in_budgets":"","limit_usd":"","name":"","reset_interval":"","workspace_id":""}}}}}},"/guardrails/{id}":{"delete":{"tags":["Guardrails"],"parameters":[{"name":"id","in":"path","description":"The unique identifier of the guardrail to delete","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/guardrails/delete-a-guardrail.md","api_endpoint":"https://openrouter.ai/api/v1/guardrails/{id}"},"summary":"Delete a guardrail","description":"Delete an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}},"get":{"tags":["Guardrails"],"parameters":[{"name":"id","in":"path","description":"The unique identifier of the guardrail to retrieve","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/guardrails/get-a-guardrail.md","api_endpoint":"https://openrouter.ai/api/v1/guardrails/{id}"},"summary":"Get a guardrail","description":"Get a single guardrail by ID. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]},"patch":{"tags":["Guardrails"],"parameters":[{"name":"id","in":"path","description":"The unique identifier of the guardrail to update","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/guardrails/update-a-guardrail.md","api_endpoint":"https://openrouter.ai/api/v1/guardrails/{id}"},"summary":"Update a guardrail","description":"Update an existing guardrail, or materialize an unconfigured workspace default guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"allowed_data_regions":{"type":"array","description":"Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected.","items":{"type":"string"}},"allowed_models":{"type":"array","description":"Array of model identifiers (slug or canonical_slug accepted)","items":{"type":"string"}},"allowed_providers":{"type":"array","description":"New list of allowed provider IDs","items":{"type":"string"}},"content_filter_builtins":{"type":"array","description":"Builtin content filters to apply. Set to null to remove. Every builtin slug supports \"block\", \"redact\", and the detect-only \"flag\" action.","items":{"type":"object","properties":{"action":{"type":"string","description":"Action taken when the builtin filter triggers","required":true,"enum":["redact","block","flag"]},"label":{"type":"string","description":"Deprecated: labels are system-assigned and cannot be set by the caller. Accepted for backward compatibility but silently ignored."},"scan_scope":{"type":"string","description":"Which message roles to scan for prompt injection. Only applies to the regex-prompt-injection builtin. Defaults to all_messages.","enum":["user_only","all_messages"]},"slug":{"type":"string","description":"The builtin filter identifier","required":true,"enum":["email","phone","ssn","credit-card","ip-address","secrets","person-name","address","regex-prompt-injection"]}}}},"content_filters":{"type":"array","description":"Custom regex content filters to apply. Set to null to remove.","items":{"type":"object","properties":{"action":{"type":"string","description":"Action taken when the pattern matches","required":true,"enum":["redact","block","flag"]},"label":{"type":"string","description":"Optional label used in redaction placeholders or error messages"},"pattern":{"type":"string","description":"A regex pattern to match against request content","required":true}}}},"description":{"type":"string","description":"New description for the guardrail"},"enable_free_model_publication":{"type":"boolean","description":"Whether this guardrail allows free endpoints that publish prompts."},"enable_free_model_training":{"type":"boolean","description":"Whether this guardrail allows free endpoints that train on request data."},"enable_paid_model_training":{"type":"boolean","description":"Whether this guardrail allows paid endpoints that train on request data."},"enforce_zdr":{"type":"boolean","description":"Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request."},"enforce_zdr_anthropic":{"type":"boolean","description":"Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided."},"enforce_zdr_google":{"type":"boolean","description":"Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided."},"enforce_zdr_openai":{"type":"boolean","description":"Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided."},"enforce_zdr_other":{"type":"boolean","description":"Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided."},"enforce_zdr_xai":{"type":"boolean","description":"Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided."},"ignored_models":{"type":"array","description":"Array of model identifiers to exclude from routing (slug or canonical_slug accepted)","items":{"type":"string"}},"ignored_providers":{"type":"array","description":"List of provider IDs to exclude from routing","items":{"type":"string"}},"include_byok_in_budgets":{"type":"boolean","description":"Whether BYOK (bring-your-own-key) inference spend counts toward this guardrail's limit_usd, in addition to OpenRouter credit spend. Omit to leave unchanged."},"limit_usd":{"type":"number","description":"New spending limit in USD"},"name":{"type":"string","description":"New name for the guardrail"},"reset_interval":{"type":"string","description":"Interval at which the limit resets (daily, weekly, monthly)","enum":["daily","weekly","monthly","None"]}}},"example":{"allowed_data_regions":[],"allowed_models":[],"allowed_providers":[],"content_filter_builtins":[],"content_filters":[],"description":"","enable_free_model_publication":"","enable_free_model_training":"","enable_paid_model_training":"","enforce_zdr":"","enforce_zdr_anthropic":"","enforce_zdr_google":"","enforce_zdr_openai":"","enforce_zdr_other":"","enforce_zdr_xai":"","ignored_models":[],"ignored_providers":[],"include_byok_in_budgets":"","limit_usd":"","name":"","reset_interval":""}}}}}},"/guardrails/{id}/assignments/keys":{"get":{"tags":["Guardrails"],"parameters":[{"name":"id","in":"path","description":"The unique identifier of the guardrail","required":true,"schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"Maximum number of records to return (max 100)","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/guardrails/list-key-assignments-for-a-guardrail.md","api_endpoint":"https://openrouter.ai/api/v1/guardrails/{id}/assignments/keys"},"summary":"List key assignments for a guardrail","description":"List all API key assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]},"post":{"tags":["Guardrails"],"parameters":[{"name":"id","in":"path","description":"The unique identifier of the guardrail","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/guardrails/bulk-assign-keys-to-a-guardrail.md","api_endpoint":"https://openrouter.ai/api/v1/guardrails/{id}/assignments/keys"},"summary":"Bulk assign keys to a guardrail","description":"Assign multiple API keys to a specific guardrail. A key may hold at most one guardrail; assigning replaces any existing assignment. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"key_hashes":{"type":"array","description":"Array of API key hashes to assign to the guardrail","required":true,"items":{"type":"string"}}}},"example":{"key_hashes":[]}}}}}},"/guardrails/{id}/assignments/keys/remove":{"post":{"tags":["Guardrails"],"parameters":[{"name":"id","in":"path","description":"The unique identifier of the guardrail","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/guardrails/bulk-unassign-keys-from-a-guardrail.md","api_endpoint":"https://openrouter.ai/api/v1/guardrails/{id}/assignments/keys/remove"},"summary":"Bulk unassign keys from a guardrail","description":"Unassign multiple API keys from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"key_hashes":{"type":"array","description":"Array of API key hashes to unassign from the guardrail","required":true,"items":{"type":"string"}}}},"example":{"key_hashes":[]}}}}}},"/guardrails/{id}/assignments/members":{"get":{"tags":["Guardrails"],"parameters":[{"name":"id","in":"path","description":"The unique identifier of the guardrail","required":true,"schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"Maximum number of records to return (max 100)","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/guardrails/list-member-assignments-for-a-guardrail.md","api_endpoint":"https://openrouter.ai/api/v1/guardrails/{id}/assignments/members"},"summary":"List member assignments for a guardrail","description":"List all organization member assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]},"post":{"tags":["Guardrails"],"parameters":[{"name":"id","in":"path","description":"The unique identifier of the guardrail","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/guardrails/bulk-assign-members-to-a-guardrail.md","api_endpoint":"https://openrouter.ai/api/v1/guardrails/{id}/assignments/members"},"summary":"Bulk assign members to a guardrail","description":"Assign multiple organization members to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"member_user_ids":{"type":"array","description":"Array of member user IDs to assign to the guardrail","required":true,"items":{"type":"string"}}}},"example":{"member_user_ids":[]}}}}}},"/guardrails/{id}/assignments/members/remove":{"post":{"tags":["Guardrails"],"parameters":[{"name":"id","in":"path","description":"The unique identifier of the guardrail","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/guardrails/bulk-unassign-members-from-a-guardrail.md","api_endpoint":"https://openrouter.ai/api/v1/guardrails/{id}/assignments/members/remove"},"summary":"Bulk unassign members from a guardrail","description":"Unassign multiple organization members from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"member_user_ids":{"type":"array","description":"Array of member user IDs to unassign from the guardrail","required":true,"items":{"type":"string"}}}},"example":{"member_user_ids":[]}}}}}},"/guardrails/assignments/keys":{"get":{"tags":["Guardrails"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of records to return (max 100)","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/guardrails/list-all-key-assignments.md","api_endpoint":"https://openrouter.ai/api/v1/guardrails/assignments/keys"},"summary":"List all key assignments","description":"List all API key guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]}},"/guardrails/assignments/members":{"get":{"tags":["Guardrails"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of records to return (max 100)","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/guardrails/list-all-member-assignments.md","api_endpoint":"https://openrouter.ai/api/v1/guardrails/assignments/members"},"summary":"List all member assignments","description":"List all organization member guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]}},"/images":{"post":{"tags":["Images"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/images/generate-an-image.md","api_endpoint":"https://openrouter.ai/api/v1/images"},"summary":"Generate an image","description":"Generates an image from a text prompt via the image generation router","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"aspect_ratio":{"type":"string","description":"Normalized aspect ratio of the generated image. Providers clamp to their supported subset.","enum":["1:1","1:2","1:4","1:8","2:1","2:3","3:2","3:4","4:1","4:3","4:5","5:4","8:1","9:16","16:9","9:19.5","19.5:9","9:20","20:9","9:21","21:9","auto"]},"background":{"type":"string","description":"Background treatment. `transparent` requires an output_format that supports alpha (png or webp).","enum":["auto","transparent","opaque"]},"input_references":{"type":"array","description":"Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs.","items":{"type":"object","properties":{"type":{"type":"string","description":"Value","required":true,"enum":["image_url"]},"image_url":{"type":"object","description":"Value","required":true}}}},"model":{"type":"string","description":"The image generation model to use","required":true},"n":{"type":"number","description":"Upper bound on the number of images to generate (1-10). Providers may return fewer images, and providers that only support single-image generation reject n > 1."},"output_compression":{"type":"number","description":"Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob."},"output_format":{"type":"string","description":"Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`.","enum":["png","jpeg","webp","svg"]},"prompt":{"type":"string","description":"Text description of the desired image","required":true},"provider":{"type":"object","description":"Provider routing preferences and provider-specific passthrough configuration.","properties":{"allow_fallbacks":{"type":"boolean","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."},"ignore":{"type":"array","description":"List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."},"only":{"type":"array","description":"List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."},"options":{"type":"string","description":"Value"},"order":{"type":"array","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."},"sort":{"type":"string","description":"The provider sorting strategy (price, throughput, latency)","enum":["price","throughput","latency","exacto"]}}},"quality":{"type":"string","description":"Rendering quality. Providers without a quality knob ignore this.","enum":["auto","low","medium","high"]},"resolution":{"type":"string","description":"Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.","enum":["512","1K","2K","4K"]},"seed":{"type":"number","description":"If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers."},"size":{"type":"string","description":"Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. An explicit pixel size is authoritative: a mismatched `resolution` or `aspect_ratio` alongside it is rejected with a 400."},"stream":{"type":"boolean","description":"If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response."},"user":{"type":"string","description":"A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier."}}},"example":{"aspect_ratio":"","background":"","input_references":[],"model":"","n":"","output_compression":"","output_format":"","prompt":"","provider":{},"quality":"","resolution":"","seed":"","size":"","stream":"","user":""}}}}}},"/images/models":{"get":{"tags":["Images"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/images/list-image-generation-models.md","api_endpoint":"https://openrouter.ai/api/v1/images/models"},"summary":"List image generation models","description":"Lists every image generation model with its top-level supported-parameter superset and a URL to its full per-endpoint records.","security":[{"bearerAuth":[]}]}},"/images/models/{author}/{slug}/endpoints":{"get":{"tags":["Images"],"parameters":[{"name":"author","in":"path","description":"Model author/organization","required":true,"schema":{"type":"string","example":""}},{"name":"slug","in":"path","description":"Model slug","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/images/list-endpoints-for-an-image-model.md","api_endpoint":"https://openrouter.ai/api/v1/images/models/{author}/{slug}/endpoints"},"summary":"List endpoints for an image model","description":"Returns the full per-endpoint records for an image model: each endpoint's definitive supported parameters, pricing, and passthrough allowlist.","security":[{"bearerAuth":[]}]}},"/key":{"get":{"tags":["API Keys"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/api-keys/get-current-api-key.md","api_endpoint":"https://openrouter.ai/api/v1/key"},"summary":"Get current API key","description":"Get information on the API key associated with the current authentication session","security":[{"bearerAuth":[]}]}},"/keys":{"get":{"tags":["API Keys"],"parameters":[{"name":"include_disabled","in":"query","description":"Whether to include disabled API keys in the response","required":false,"schema":{"type":"boolean","example":""}},{"name":"offset","in":"query","description":"Number of API keys to skip for pagination","required":false,"schema":{"type":"number","example":""}},{"name":"workspace_id","in":"query","description":"Filter API keys by workspace ID. By default, keys in the default workspace are returned.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/api-keys/list-api-keys.md","api_endpoint":"https://openrouter.ai/api/v1/keys"},"summary":"List API keys","description":"List all API keys for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]},"post":{"tags":["API Keys"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/api-keys/create-a-new-api-key.md","api_endpoint":"https://openrouter.ai/api/v1/keys"},"summary":"Create a new API key","description":"Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys). The optional `external` object associates the key with a partner-defined user and lookup key.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"creator_user_id":{"type":"string","description":"Optional user ID of the key creator. Only meaningful for organization-owned keys where a specific member is creating the key."},"expires_at":{"type":"string","description":"Optional ISO 8601 UTC expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected."},"external":{"type":"object","description":"Optional partner-defined identity associated with the created API key.","properties":{"api_key":{"type":"string","description":"Optional partner-supplied API key with a minimum length of 32 characters and sufficient entropy. Stored as a SHA-256 hash and never returned."},"user":{"type":"string","description":"Partner's end-user identifier for attribution.","required":true}}},"include_byok_in_limit":{"type":"boolean","description":"Whether to include BYOK usage in the limit"},"limit":{"type":"number","description":"Optional spending limit for the API key in USD"},"limit_reset":{"type":"string","description":"Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday.","enum":["daily","weekly","monthly","None"]},"name":{"type":"string","description":"Name for the new API key","required":true},"workspace_id":{"type":"string","description":"The workspace to create the API key in. Defaults to the default workspace if not provided."}}},"example":{"creator_user_id":"","expires_at":"","external":{},"include_byok_in_limit":"","limit":"","limit_reset":"","name":"","workspace_id":""}}}}}},"/keys/{hash}":{"delete":{"tags":["API Keys"],"parameters":[{"name":"hash","in":"path","description":"The hash identifier of the API key to delete","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/api-keys/delete-an-api-key.md","api_endpoint":"https://openrouter.ai/api/v1/keys/{hash}"},"summary":"Delete an API key","description":"Delete an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}},"get":{"tags":["API Keys"],"parameters":[{"name":"hash","in":"path","description":"The hash identifier of the API key to retrieve","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/api-keys/get-a-single-api-key.md","api_endpoint":"https://openrouter.ai/api/v1/keys/{hash}"},"summary":"Get a single API key","description":"Get a single API key by hash. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]},"patch":{"tags":["API Keys"],"parameters":[{"name":"hash","in":"path","description":"The hash identifier of the API key to update","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/api-keys/update-an-api-key.md","api_endpoint":"https://openrouter.ai/api/v1/keys/{hash}"},"summary":"Update an API key","description":"Update an existing API key. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys).","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"disabled":{"type":"boolean","description":"Whether to disable the API key"},"include_byok_in_limit":{"type":"boolean","description":"Whether to include BYOK usage in the limit"},"limit":{"type":"number","description":"New spending limit for the API key in USD"},"limit_reset":{"type":"string","description":"New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday.","enum":["daily","weekly","monthly","None"]},"name":{"type":"string","description":"New name for the API key"}}},"example":{"disabled":"","include_byok_in_limit":"","limit":"","limit_reset":"","name":""}}}}}},"/messages":{"post":{"tags":["Anthropic Messages"],"parameters":[{"name":"X-OpenRouter-Metadata","in":"query","description":"Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["disabled","enabled"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/anthropic-messages/create-a-message.md","api_endpoint":"https://openrouter.ai/api/v1/messages"},"summary":"Create a message","description":"Creates a message using the Anthropic Messages API format. Supports text, images, PDFs, tools, and extended thinking.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"cache_control":{"type":"object","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. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.","properties":{"type":{"type":"string","description":"Value","required":true,"enum":["ephemeral"]},"ttl":{"type":"string","description":"Value","enum":["5m","1h"]}}},"context_management":{"type":"object","description":"Value","properties":{"edits":{"type":"array","description":"Value"}}},"fallbacks":{"type":"array","description":"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.","items":{"type":"object","properties":{"model":{"type":"string","description":"Value","required":true}}}},"max_tokens":{"type":"number","description":"Value"},"messages":{"type":"array","description":"Value","required":true,"items":{"type":"object","properties":{"clear_at":{"type":"string","description":"Value","enum":["next_user_message","never","None"]},"content":{"type":"string","description":"Value","required":true},"output_config":{"type":"object","description":"Value"},"role":{"type":"string","description":"Value","required":true,"enum":["user","assistant","system"]}}}},"metadata":{"type":"object","description":"Value","properties":{"user_id":{"type":"string","description":"Value"}}},"model":{"type":"string","description":"Value","required":true},"models":{"type":"array","description":"Value","items":{"type":"string"}},"output_config":{"type":"object","description":"Configuration for controlling output behavior. Supports the effort parameter and structured output format.","properties":{"effort":{"type":"string","description":"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`.","enum":["low","medium","high","xhigh","max","None"]},"format":{"type":"object","description":"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":{"type":"object","description":"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."}}},"plugins":{"type":"array","description":"Plugins you want to enable for this request, including their settings.","items":{"type":"string"}},"provider":{"type":"object","description":"When multiple model providers are available, optionally indicate your routing preference.","properties":{"allow_fallbacks":{"type":"boolean","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."},"data_collection":{"type":"string","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","None"]},"enforce_distillable_text":{"type":"boolean","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."},"ignore":{"type":"array","description":"List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."},"max_price":{"type":"object","description":"The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."},"only":{"type":"array","description":"List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."},"order":{"type":"array","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."},"preferred_max_latency":{"type":"number","description":"Value"},"preferred_min_throughput":{"type":"number","description":"Value"},"quantizations":{"type":"array","description":"A list of quantization levels to filter the provider by."},"require_parameters":{"type":"boolean","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."},"sort":{"type":"string","description":"The provider sorting strategy (price, throughput, latency)","enum":["price","throughput","latency","exacto"]},"zdr":{"type":"boolean","description":"Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used."}}},"route":{"type":"string","description":"**DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: \"fallback\" (maps to \"model\"), \"sort\" (maps to \"none\").","enum":["fallback","sort","None"]},"service_tier":{"type":"string","description":"Value"},"session_id":{"type":"string","description":"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 observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters."},"speed":{"type":"string","description":"Value"},"stop_sequences":{"type":"array","description":"Value","items":{"type":"string"}},"stop_server_tools_when":{"type":"array","description":"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 turn is made with tool calls disabled so the response ends with a natural-language answer instead of an unfinished tool call.","items":{"type":"string"}},"stream":{"type":"boolean","description":"Value"},"system":{"type":"string","description":"Value"},"temperature":{"type":"number","description":"Value"},"thinking":{"type":"string","description":"Value"},"tool_choice":{"type":"string","description":"Value"},"tools":{"type":"array","description":"Value","items":{"type":"object","properties":{"type":{"type":"string","description":"Value","enum":["custom"]},"cache_control":{"type":"object","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. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."},"defer_loading":{"type":"boolean","description":"Value"},"description":{"type":"string","description":"Value"},"input_schema":{"type":"object","description":"Value","required":true},"name":{"type":"string","description":"Value","required":true}}}},"top_k":{"type":"number","description":"Value"},"top_p":{"type":"number","description":"Value"},"trace":{"type":"object","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","description":"Value"},"parent_span_id":{"type":"string","description":"Value"},"span_name":{"type":"string","description":"Value"},"trace_id":{"type":"string","description":"Value"},"trace_name":{"type":"string","description":"Value"}}},"user":{"type":"string","description":"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 users. Maximum of 256 characters."}}},"example":{"cache_control":{},"context_management":{},"fallbacks":[],"max_tokens":"","messages":[],"metadata":{},"model":"","models":[],"output_config":{},"plugins":[],"provider":{},"route":"","service_tier":"","session_id":"","speed":"","stop_sequences":[],"stop_server_tools_when":[],"stream":"","system":"","temperature":"","thinking":"","tool_choice":"","tools":[],"top_k":"","top_p":"","trace":{},"user":""}}}}}},"/model/{author}/{slug}":{"get":{"tags":["Models"],"parameters":[{"name":"author","in":"path","description":"The author/organization of the model","required":true,"schema":{"type":"string","example":""}},{"name":"slug","in":"path","description":"The model slug, optionally including a variant suffix (e.g. gpt-4 or gpt-4:free)","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/models/get-a-model-by-its-slug.md","api_endpoint":"https://openrouter.ai/api/v1/model/{author}/{slug}"},"summary":"Get a model by its slug","description":"Returns full details for a single model identified by its author and slug (e.g. openai/gpt-4). Supports variant suffixes (e.g. openai/gpt-4:free) and resolves known slug aliases.","security":[{"bearerAuth":[]}]}},"/models":{"get":{"tags":["Models"],"parameters":[{"name":"category","in":"query","description":"Filter models by use case category","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["programming","roleplay","marketing","marketing/seo","technology","science","translation","legal","finance","health","trivia","academia"]}}},{"name":"arch","in":"query","description":"Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama).","required":false,"schema":{"type":"string","example":""}},{"name":"context","in":"query","description":"Minimum context length (tokens). Models with smaller context are excluded.","required":false,"schema":{"type":"number","example":""}},{"name":"distillable","in":"query","description":"Filter by distillation capability. \"true\" returns only distillable models, \"false\" excludes them.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["true","false"]}}},{"name":"input_modalities","in":"query","description":"Filter models by input modality. Comma-separated list of: text, image, audio, file.","required":false,"schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned","required":false,"schema":{"type":"number","example":""}},{"name":"max_age_days","in":"query","description":"Maximum model age in days since its creation date.","required":false,"schema":{"type":"number","example":""}},{"name":"max_agentic_index","in":"query","description":"Maximum Artificial Analysis agentic index.","required":false,"schema":{"type":"number","example":""}},{"name":"max_coding_index","in":"query","description":"Maximum Artificial Analysis coding index.","required":false,"schema":{"type":"number","example":""}},{"name":"max_intelligence_index","in":"query","description":"Maximum Artificial Analysis intelligence index.","required":false,"schema":{"type":"number","example":""}},{"name":"max_output_price","in":"query","description":"Maximum completion (output) price in $/M tokens.","required":false,"schema":{"type":"number","example":""}},{"name":"max_price","in":"query","description":"Maximum prompt price in $/M tokens.","required":false,"schema":{"type":"number","example":""}},{"name":"max_tool_success_rate","in":"query","description":"Maximum tool-calling success rate, as a fraction in [0, 1].","required":false,"schema":{"type":"number","example":""}},{"name":"min_age_days","in":"query","description":"Minimum model age in days since its creation date.","required":false,"schema":{"type":"number","example":""}},{"name":"min_agentic_index","in":"query","description":"Minimum Artificial Analysis agentic index.","required":false,"schema":{"type":"number","example":""}},{"name":"min_coding_index","in":"query","description":"Minimum Artificial Analysis coding index.","required":false,"schema":{"type":"number","example":""}},{"name":"min_intelligence_index","in":"query","description":"Minimum Artificial Analysis intelligence index.","required":false,"schema":{"type":"number","example":""}},{"name":"min_output_price","in":"query","description":"Minimum completion (output) price in $/M tokens.","required":false,"schema":{"type":"number","example":""}},{"name":"min_price","in":"query","description":"Minimum prompt price in $/M tokens.","required":false,"schema":{"type":"number","example":""}},{"name":"min_tool_success_rate","in":"query","description":"Minimum tool-calling success rate, as a fraction in [0, 1] (e.g. 0.9 = 90% of requests finishing with a tool_calls finish reason).","required":false,"schema":{"type":"number","example":""}},{"name":"model_authors","in":"query","description":"Filter models by the organization that created the model. Comma-separated list of author slugs.","required":false,"schema":{"type":"string","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned","required":false,"schema":{"type":"number","example":""}},{"name":"output_modalities","in":"query","description":"Filter models by output modality. Accepts a comma-separated list of modalities (text, image, embeddings, audio, video, rerank, speech, transcription) or \"all\" to include all models. Defaults to \"text\".","required":false,"schema":{"type":"string","example":""}},{"name":"providers","in":"query","description":"Filter models by hosting provider. Comma-separated list of provider names.","required":false,"schema":{"type":"string","example":""}},{"name":"q","in":"query","description":"Free-text search by model name or slug.","required":false,"schema":{"type":"string","example":""}},{"name":"region","in":"query","description":"Filter to models with endpoints in the given data region (\"eu\" or \"us\").","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["eu","us"]}}},{"name":"sort","in":"query","description":"Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["most-popular","newest","top-weekly","pricing-low-to-high","pricing-high-to-low","context-high-to-low","throughput-high-to-low","latency-low-to-high","intelligence-high-to-low","coding-high-to-low","agentic-high-to-low","design-arena-elo-high-to-low"]}}},{"name":"supported_parameters","in":"query","description":"Filter models by supported parameter (comma-separated)","required":false,"schema":{"type":"string","example":""}},{"name":"zdr","in":"query","description":"When set to \"true\", return only models with zero data retention endpoints.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["true"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/models/list-all-models-and-their-properties.md","api_endpoint":"https://openrouter.ai/api/v1/models"},"summary":"List all models and their properties","description":"List all models and their properties","security":[{"bearerAuth":[]}]}},"/models/{author}/{slug}/endpoints":{"get":{"tags":["Endpoints"],"parameters":[{"name":"author","in":"path","description":"The author/organization of the model","required":true,"schema":{"type":"string","example":""}},{"name":"slug","in":"path","description":"The model slug","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/endpoints/list-all-endpoints-for-a-model.md","api_endpoint":"https://openrouter.ai/api/v1/models/{author}/{slug}/endpoints"},"summary":"List all endpoints for a model","description":"List all endpoints for a model","security":[{"bearerAuth":[]}]}},"/models/count":{"get":{"tags":["Models"],"parameters":[{"name":"output_modalities","in":"query","description":"Filter models by output modality. Accepts a comma-separated list of modalities (text, image, embeddings, audio, video, rerank, speech, transcription) or \"all\" to include all models. Defaults to \"text\".","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/models/get-total-count-of-available-models.md","api_endpoint":"https://openrouter.ai/api/v1/models/count"},"summary":"Get total count of available models","description":"Get total count of available models","security":[{"bearerAuth":[]}]}},"/models/user":{"get":{"tags":["Models"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned","required":false,"schema":{"type":"number","example":""}},{"name":"output_modalities","in":"query","description":"Filter models by output modality. Accepts a comma-separated list of modalities (text, image, embeddings, audio, video, rerank, speech, transcription) or \"all\" to include all models. Defaults to \"text\".","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/models/list-models-filtered-by-user-provider-preferences-privacy-settings-and-guardrails.md","api_endpoint":"https://openrouter.ai/api/v1/models/user"},"summary":"List models filtered by user provider preferences, privacy settings, and guardrails","description":"List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). Returns text-output models by default; pass `output_modalities` (a comma-separated list of `text`, `image`, `embeddings`, `audio`, `video`, `rerank`, `speech`, `transcription`, or `all`) to include other modalities. If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region.","security":[{"bearerAuth":[]}]}},"/oauth/jwks":{"get":{"tags":["OAuth"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/oauth/openrouter-access-token-signing-keys.md","api_endpoint":"https://openrouter.ai/api/v1/oauth/jwks"},"summary":"OpenRouter access token signing keys","description":"RFC 7517 JWK Set containing the public keys OpenRouter signs access tokens with.","security":[{"bearerAuth":[]}]}},"/oauth/token":{"post":{"tags":["OAuth"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/oauth/exchange-a-workload-identity-token.md","api_endpoint":"https://openrouter.ai/api/v1/oauth/token"},"summary":"Exchange a workload identity token","description":"RFC 8693 token exchange. Presents a JWT from an issuer your organization trusts (Settings → Workload identity) and receives a short-lived OpenRouter access token that acts as the API key the matching federation policy targets.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"federation_policy_id":{"type":"string","description":"The federation policy to evaluate, from Settings → Workload identity. Binds the exchange to one organization.","required":true},"grant_type":{"type":"string","description":"Must be `urn:ietf:params:oauth:grant-type:token-exchange`.","required":true,"enum":["urn:ietf:params:oauth:grant-type:token-exchange"]},"requested_token_type":{"type":"string","description":"Optional; when present must be `urn:ietf:params:oauth:token-type:access_token`.","enum":["urn:ietf:params:oauth:token-type:access_token"]},"scope":{"type":"string","description":"Optional; only `inference` is available.","enum":["inference"]},"subject_token":{"type":"string","description":"The JWT issued by your identity provider.","required":true},"subject_token_type":{"type":"string","description":"Must be `urn:ietf:params:oauth:token-type:jwt`.","required":true,"enum":["urn:ietf:params:oauth:token-type:jwt"]}}},"example":{"federation_policy_id":"","grant_type":"","requested_token_type":"","scope":"","subject_token":"","subject_token_type":""}}}}}},"/observability/destinations":{"get":{"tags":["Observability"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of records to return (max 100)","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination","required":false,"schema":{"type":"number","example":""}},{"name":"workspace_id","in":"query","description":"Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace.","required":false,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/observability/list-observability-destinations.md","api_endpoint":"https://openrouter.ai/api/v1/observability/destinations"},"summary":"List observability destinations","description":"List the observability destinations configured for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace. Only destinations with stable release status are surfaced — destinations of other types are excluded. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]},"post":{"tags":["Observability"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/observability/create-an-observability-destination.md","api_endpoint":"https://openrouter.ai/api/v1/observability/destinations"},"summary":"Create an observability destination","description":"Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"type":{"type":"string","description":"The destination type. Only stable destination types are accepted.","required":true,"enum":["arize","braintrust","clickhouse","datadog","grafana","langfuse","langsmith","newrelic","opik","otel-collector","posthog","ramp","s3","sentry","snowflake","weave","webhook"]},"api_key_hashes":{"type":"array","description":"Optional allowlist of OpenRouter API key hashes whose traffic is forwarded. `null` or omitted means all keys. Must contain at least one hash if provided.","items":{"type":"string"}},"broadcast_generation_cost":{"type":"boolean","description":"When true, include cost and billing generation metadata."},"broadcast_generation_identity":{"type":"boolean","description":"When true, include identity generation metadata."},"broadcast_generation_request_context":{"type":"boolean","description":"When true, include request-context generation metadata."},"config":{"type":"object","description":"Provider-specific configuration. The shape depends on `type` and is validated server-side.","required":true,"properties":{}},"enabled":{"type":"boolean","description":"Whether this destination should be enabled immediately."},"filter_rules":{"type":"object","description":"Optional structured filter rules controlling which events are forwarded.","properties":{"enabled":{"type":"boolean","description":"Value"},"groups":{"type":"array","description":"Value","required":true}}},"name":{"type":"string","description":"Human-readable name for the destination.","required":true},"privacy_mode":{"type":"boolean","description":"When true, request/response bodies are not forwarded — only metadata."},"sampling_rate":{"type":"number","description":"Sampling rate between 0.0001 and 1 (1 = 100%)."},"workspace_id":{"type":"string","description":"Optional workspace ID. Defaults to the authenticated entity's default workspace."}}},"example":{"type":"","api_key_hashes":[],"broadcast_generation_cost":"","broadcast_generation_identity":"","broadcast_generation_request_context":"","config":{},"enabled":"","filter_rules":{},"name":"","privacy_mode":"","sampling_rate":"","workspace_id":""}}}}}},"/observability/destinations/{id}":{"delete":{"tags":["Observability"],"parameters":[{"name":"id","in":"path","description":"The destination ID (UUID).","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/observability/delete-an-observability-destination.md","api_endpoint":"https://openrouter.ai/api/v1/observability/destinations/{id}"},"summary":"Delete an observability destination","description":"Delete an existing observability destination. This performs a soft delete. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}},"get":{"tags":["Observability"],"parameters":[{"name":"id","in":"path","description":"The destination ID (UUID).","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/observability/get-an-observability-destination.md","api_endpoint":"https://openrouter.ai/api/v1/observability/destinations/{id}"},"summary":"Get an observability destination","description":"Fetch a single observability destination by its UUID. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]},"patch":{"tags":["Observability"],"parameters":[{"name":"id","in":"path","description":"The destination ID (UUID).","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/observability/update-an-observability-destination.md","api_endpoint":"https://openrouter.ai/api/v1/observability/destinations/{id}"},"summary":"Update an observability destination","description":"Update an existing observability destination. Only the fields provided in the request body are updated. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"api_key_hashes":{"type":"array","description":"Optional allowlist of OpenRouter API key hashes. `null` clears the filter (all keys). Omitting leaves the current value. Must contain at least one hash if provided.","items":{"type":"string"}},"broadcast_generation_cost":{"type":"boolean","description":"Whether to include cost and billing generation metadata."},"broadcast_generation_identity":{"type":"boolean","description":"Whether to include identity generation metadata."},"broadcast_generation_request_context":{"type":"boolean","description":"Whether to include request-context generation metadata."},"config":{"type":"object","description":"Provider-specific configuration fields to update. Masked values are ignored; unset fields keep their current value.","properties":{}},"enabled":{"type":"boolean","description":"Whether the destination is enabled."},"filter_rules":{"type":"string","description":"Value"},"name":{"type":"string","description":"Human-readable name for the destination."},"privacy_mode":{"type":"boolean","description":"When true, request/response bodies are not forwarded — only metadata."},"sampling_rate":{"type":"number","description":"Sampling rate between 0.0001 and 1 (1 = 100%)."}}},"example":{"api_key_hashes":[],"broadcast_generation_cost":"","broadcast_generation_identity":"","broadcast_generation_request_context":"","config":{},"enabled":"","filter_rules":"","name":"","privacy_mode":"","sampling_rate":""}}}}}},"/organization/members":{"get":{"tags":["Organization"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of records to return (max 100)","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/organization/list-organization-members.md","api_endpoint":"https://openrouter.ai/api/v1/organization/members"},"summary":"List organization members","description":"List all members of the organization associated with the authenticated management key. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]}},"/presets":{"get":{"tags":["Presets"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of records to return (max 100)","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/presets/list-presets.md","api_endpoint":"https://openrouter.ai/api/v1/presets"},"summary":"List presets","description":"Lists all presets for the authenticated user, ordered by most recently updated first.","security":[{"bearerAuth":[]}]}},"/presets/{slug}":{"get":{"tags":["Presets"],"parameters":[{"name":"slug","in":"path","description":"URL-safe slug identifying the preset.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/presets/get-a-preset.md","api_endpoint":"https://openrouter.ai/api/v1/presets/{slug}"},"summary":"Get a preset","description":"Retrieves a preset by its slug with its currently designated version inline.","security":[{"bearerAuth":[]}]}},"/presets/{slug}/chat/completions":{"post":{"tags":["Presets"],"parameters":[{"name":"slug","in":"path","description":"URL-safe slug identifying the preset. Created if it does not exist.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/presets/create-a-preset-from-a-chat-completions-request-body.md","api_endpoint":"https://openrouter.ai/api/v1/presets/{slug}/chat/completions"},"summary":"Create a preset from a chat-completions request body","description":"Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"cache_control":{"type":"object","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. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.","properties":{"type":{"type":"string","description":"Value","required":true,"enum":["ephemeral"]},"ttl":{"type":"string","description":"Value","enum":["5m","1h"]}}},"debug":{"type":"object","description":"Debug options for inspecting request transformations (streaming only)","properties":{"echo_upstream_body":{"type":"boolean","description":"If true, includes the transformed upstream request body in a debug chunk at the start of the stream. Only works with streaming mode."}}},"frequency_penalty":{"type":"number","description":"Frequency penalty (-2.0 to 2.0)"},"image_config":{"type":"object","description":"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.","properties":{}},"logit_bias":{"type":"object","description":"Token logit bias adjustments","properties":{}},"logprobs":{"type":"boolean","description":"Return log probabilities"},"max_completion_tokens":{"type":"number","description":"Maximum tokens in completion"},"max_tokens":{"type":"number","description":"Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16."},"messages":{"type":"array","description":"List of messages for the conversation","required":true,"items":{"type":"string"}},"metadata":{"type":"object","description":"Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)","properties":{}},"min_p":{"type":"number","description":"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."},"modalities":{"type":"array","description":"Output modalities for the response. Supported values are \"text\", \"image\", and \"audio\".","items":{"type":"string"}},"model":{"type":"string","description":"Model to use for completion"},"models":{"type":"array","description":"Models to use for completion","items":{"type":"string"}},"parallel_tool_calls":{"type":"boolean","description":"Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response."},"plugins":{"type":"array","description":"Plugins you want to enable for this request, including their settings.","items":{"type":"string"}},"prediction":{"type":"object","description":"Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance.","properties":{"type":{"type":"string","description":"Value","required":true,"enum":["content"]},"content":{"type":"string","description":"Value","required":true}}},"presence_penalty":{"type":"number","description":"Presence penalty (-2.0 to 2.0)"},"prompt_cache_key":{"type":"string","description":"Value"},"prompt_cache_options":{"type":"object","description":"Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.","properties":{"mode":{"type":"string","description":"Value","required":true,"enum":["explicit"]},"ttl":{"type":"string","description":"Value"}}},"provider":{"type":"object","description":"When multiple model providers are available, optionally indicate your routing preference.","properties":{"allow_fallbacks":{"type":"boolean","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."},"data_collection":{"type":"string","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","None"]},"enforce_distillable_text":{"type":"boolean","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."},"ignore":{"type":"array","description":"List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."},"max_price":{"type":"object","description":"The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."},"only":{"type":"array","description":"List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."},"order":{"type":"array","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."},"preferred_max_latency":{"type":"number","description":"Value"},"preferred_min_throughput":{"type":"number","description":"Value"},"quantizations":{"type":"array","description":"A list of quantization levels to filter the provider by."},"require_parameters":{"type":"boolean","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."},"sort":{"type":"string","description":"The provider sorting strategy (price, throughput, latency)","enum":["price","throughput","latency","exacto"]},"zdr":{"type":"boolean","description":"Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used."}}},"reasoning":{"type":"object","description":"Configuration options for reasoning models","properties":{"effort":{"type":"string","description":"Constrains effort on reasoning for reasoning models","enum":["max","xhigh","high","medium","low","minimal","none","None"]},"summary":{"type":"string","description":"Value","enum":["auto","concise","detailed","None"]}}},"reasoning_effort":{"type":"string","description":"Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ.","enum":["max","xhigh","high","medium","low","minimal","none","None"]},"repetition_penalty":{"type":"number","description":"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."},"response_format":{"type":"string","description":"Response format configuration"},"route":{"type":"string","description":"**DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: \"fallback\" (maps to \"model\"), \"sort\" (maps to \"none\").","enum":["fallback","sort","None"]},"seed":{"type":"number","description":"Random seed for deterministic outputs"},"service_tier":{"type":"string","description":"The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.","enum":["auto","default","fast","flex","priority","scale","None"]},"session_id":{"type":"string","description":"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 observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters."},"stop":{"type":"string","description":"Value"},"stop_server_tools_when":{"type":"array","description":"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 turn is made with tool calls disabled so the response ends with a natural-language answer instead of an unfinished tool call.","items":{"type":"string"}},"stream":{"type":"boolean","description":"Enable streaming response"},"stream_options":{"type":"object","description":"Streaming configuration options","properties":{"include_usage":{"type":"boolean","description":"Deprecated: This field has no effect. Full usage details are always included."}}},"temperature":{"type":"number","description":"Sampling temperature (0-2)"},"tool_choice":{"type":"string","description":"Value","enum":["none"]},"tools":{"type":"array","description":"Available tools for function calling","items":{"type":"object","properties":{"type":{"type":"string","description":"Value","required":true,"enum":["function"]},"cache_control":{"type":"string","description":"Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request."},"function":{"type":"object","description":"Function definition for tool calling","required":true}}}},"top_a":{"type":"number","description":"Consider only tokens with \"sufficiently high\" probabilities based on the probability of the most likely token. Not all providers support this parameter."},"top_k":{"type":"number","description":"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":{"type":"number","description":"Number of top log probabilities to return (0-20)"},"top_p":{"type":"number","description":"Nucleus sampling parameter (0-1)"},"trace":{"type":"object","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","description":"Value"},"parent_span_id":{"type":"string","description":"Value"},"span_name":{"type":"string","description":"Value"},"trace_id":{"type":"string","description":"Value"},"trace_name":{"type":"string","description":"Value"}}},"user":{"type":"string","description":"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, so provider policy blocks can affect the whole account."}}},"example":{"cache_control":{},"debug":{},"frequency_penalty":"","image_config":{},"logit_bias":{},"logprobs":"","max_completion_tokens":"","max_tokens":"","messages":[],"metadata":{},"min_p":"","modalities":[],"model":"","models":[],"parallel_tool_calls":"","plugins":[],"prediction":{},"presence_penalty":"","prompt_cache_key":"","prompt_cache_options":{},"provider":{},"reasoning":{},"reasoning_effort":"","repetition_penalty":"","response_format":"","route":"","seed":"","service_tier":"","session_id":"","stop":"","stop_server_tools_when":[],"stream":"","stream_options":{},"temperature":"","tool_choice":"","tools":[],"top_a":"","top_k":"","top_logprobs":"","top_p":"","trace":{},"user":""}}}}}},"/presets/{slug}/messages":{"post":{"tags":["Presets"],"parameters":[{"name":"slug","in":"path","description":"URL-safe slug identifying the preset. Created if it does not exist.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/presets/create-a-preset-from-a-messages-request-body.md","api_endpoint":"https://openrouter.ai/api/v1/presets/{slug}/messages"},"summary":"Create a preset from a messages request body","description":"Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"cache_control":{"type":"object","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. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.","properties":{"type":{"type":"string","description":"Value","required":true,"enum":["ephemeral"]},"ttl":{"type":"string","description":"Value","enum":["5m","1h"]}}},"context_management":{"type":"object","description":"Value","properties":{"edits":{"type":"array","description":"Value"}}},"fallbacks":{"type":"array","description":"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.","items":{"type":"object","properties":{"model":{"type":"string","description":"Value","required":true}}}},"max_tokens":{"type":"number","description":"Value"},"messages":{"type":"array","description":"Value","required":true,"items":{"type":"object","properties":{"clear_at":{"type":"string","description":"Value","enum":["next_user_message","never","None"]},"content":{"type":"string","description":"Value","required":true},"output_config":{"type":"object","description":"Value"},"role":{"type":"string","description":"Value","required":true,"enum":["user","assistant","system"]}}}},"metadata":{"type":"object","description":"Value","properties":{"user_id":{"type":"string","description":"Value"}}},"model":{"type":"string","description":"Value","required":true},"models":{"type":"array","description":"Value","items":{"type":"string"}},"output_config":{"type":"object","description":"Configuration for controlling output behavior. Supports the effort parameter and structured output format.","properties":{"effort":{"type":"string","description":"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`.","enum":["low","medium","high","xhigh","max","None"]},"format":{"type":"object","description":"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":{"type":"object","description":"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."}}},"plugins":{"type":"array","description":"Plugins you want to enable for this request, including their settings.","items":{"type":"string"}},"provider":{"type":"object","description":"When multiple model providers are available, optionally indicate your routing preference.","properties":{"allow_fallbacks":{"type":"boolean","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."},"data_collection":{"type":"string","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","None"]},"enforce_distillable_text":{"type":"boolean","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."},"ignore":{"type":"array","description":"List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."},"max_price":{"type":"object","description":"The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."},"only":{"type":"array","description":"List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."},"order":{"type":"array","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."},"preferred_max_latency":{"type":"number","description":"Value"},"preferred_min_throughput":{"type":"number","description":"Value"},"quantizations":{"type":"array","description":"A list of quantization levels to filter the provider by."},"require_parameters":{"type":"boolean","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."},"sort":{"type":"string","description":"The provider sorting strategy (price, throughput, latency)","enum":["price","throughput","latency","exacto"]},"zdr":{"type":"boolean","description":"Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used."}}},"route":{"type":"string","description":"**DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: \"fallback\" (maps to \"model\"), \"sort\" (maps to \"none\").","enum":["fallback","sort","None"]},"service_tier":{"type":"string","description":"Value"},"session_id":{"type":"string","description":"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 observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters."},"speed":{"type":"string","description":"Value"},"stop_sequences":{"type":"array","description":"Value","items":{"type":"string"}},"stop_server_tools_when":{"type":"array","description":"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 turn is made with tool calls disabled so the response ends with a natural-language answer instead of an unfinished tool call.","items":{"type":"string"}},"stream":{"type":"boolean","description":"Value"},"system":{"type":"string","description":"Value"},"temperature":{"type":"number","description":"Value"},"thinking":{"type":"string","description":"Value"},"tool_choice":{"type":"string","description":"Value"},"tools":{"type":"array","description":"Value","items":{"type":"object","properties":{"type":{"type":"string","description":"Value","enum":["custom"]},"cache_control":{"type":"object","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. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format."},"defer_loading":{"type":"boolean","description":"Value"},"description":{"type":"string","description":"Value"},"input_schema":{"type":"object","description":"Value","required":true},"name":{"type":"string","description":"Value","required":true}}}},"top_k":{"type":"number","description":"Value"},"top_p":{"type":"number","description":"Value"},"trace":{"type":"object","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","description":"Value"},"parent_span_id":{"type":"string","description":"Value"},"span_name":{"type":"string","description":"Value"},"trace_id":{"type":"string","description":"Value"},"trace_name":{"type":"string","description":"Value"}}},"user":{"type":"string","description":"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 users. Maximum of 256 characters."}}},"example":{"cache_control":{},"context_management":{},"fallbacks":[],"max_tokens":"","messages":[],"metadata":{},"model":"","models":[],"output_config":{},"plugins":[],"provider":{},"route":"","service_tier":"","session_id":"","speed":"","stop_sequences":[],"stop_server_tools_when":[],"stream":"","system":"","temperature":"","thinking":"","tool_choice":"","tools":[],"top_k":"","top_p":"","trace":{},"user":""}}}}}},"/presets/{slug}/responses":{"post":{"tags":["Presets"],"parameters":[{"name":"slug","in":"path","description":"URL-safe slug identifying the preset. Created if it does not exist.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/presets/create-a-preset-from-a-responses-request-body.md","api_endpoint":"https://openrouter.ai/api/v1/presets/{slug}/responses"},"summary":"Create a preset from a responses request body","description":"Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"text":{"type":"string","description":"Text output configuration including format and verbosity"},"background":{"type":"boolean","description":"Value"},"cache_control":{"type":"object","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. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.","properties":{"type":{"type":"string","description":"Value","required":true,"enum":["ephemeral"]},"ttl":{"type":"string","description":"Value","enum":["5m","1h"]}}},"debug":{"type":"object","description":"Debug options for inspecting request transformations (streaming only)","properties":{"echo_upstream_body":{"type":"boolean","description":"If true, includes the transformed upstream request body in a debug chunk at the start of the stream. Only works with streaming mode."}}},"frequency_penalty":{"type":"number","description":"Value"},"image_config":{"type":"object","description":"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.","properties":{}},"include":{"type":"array","description":"Value","items":{"type":"string"}},"input":{"type":"string","description":"Value"},"instructions":{"type":"string","description":"Value"},"max_output_tokens":{"type":"number","description":"Value"},"max_tool_calls":{"type":"number","description":"Maximum number of server-tool (e.g. `openrouter:web_search`) agent steps the model may take during a request. Defaults to 30, which is also the maximum. Ignored when `stop_server_tools_when` is set."},"metadata":{"type":"object","description":"Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed.","properties":{}},"modalities":{"type":"array","description":"Output modalities for the response. Supported values are \"text\" and \"image\".","items":{"type":"string"}},"model":{"type":"string","description":"Value"},"models":{"type":"array","description":"Value","items":{"type":"string"}},"parallel_tool_calls":{"type":"boolean","description":"Value"},"plugins":{"type":"array","description":"Plugins you want to enable for this request, including their settings.","items":{"type":"string"}},"presence_penalty":{"type":"number","description":"Value"},"previous_response_id":{"type":"string","description":"Not supported. The Responses API is stateless: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead."},"prompt":{"type":"object","description":"Value","properties":{"id":{"type":"string","description":"Value","required":true},"variables":{"type":"object","description":"Value"}}},"prompt_cache_key":{"type":"string","description":"Value"},"prompt_cache_options":{"type":"object","description":"Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.","properties":{"mode":{"type":"string","description":"Value","required":true,"enum":["explicit"]},"ttl":{"type":"string","description":"Value"}}},"provider":{"type":"object","description":"When multiple model providers are available, optionally indicate your routing preference.","properties":{"allow_fallbacks":{"type":"boolean","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."},"data_collection":{"type":"string","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","None"]},"enforce_distillable_text":{"type":"boolean","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."},"ignore":{"type":"array","description":"List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."},"max_price":{"type":"object","description":"The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."},"only":{"type":"array","description":"List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."},"order":{"type":"array","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."},"preferred_max_latency":{"type":"number","description":"Value"},"preferred_min_throughput":{"type":"number","description":"Value"},"quantizations":{"type":"array","description":"A list of quantization levels to filter the provider by."},"require_parameters":{"type":"boolean","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."},"sort":{"type":"string","description":"The provider sorting strategy (price, throughput, latency)","enum":["price","throughput","latency","exacto"]},"zdr":{"type":"boolean","description":"Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used."}}},"reasoning":{"type":"string","description":"Configuration for reasoning mode in the response"},"route":{"type":"string","description":"**DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: \"fallback\" (maps to \"model\"), \"sort\" (maps to \"none\").","enum":["fallback","sort","None"]},"safety_identifier":{"type":"string","description":"Recommended 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, so provider policy blocks can affect the whole account."},"service_tier":{"type":"string","description":"The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.","enum":["auto","default","fast","flex","priority","scale","None"]},"session_id":{"type":"string","description":"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 observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters."},"stop_server_tools_when":{"type":"array","description":"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 turn is made with tool calls disabled so the response ends with a natural-language answer instead of an unfinished tool call.","items":{"type":"string"}},"store":{"type":"boolean","description":"Value"},"stream":{"type":"boolean","description":"Value"},"temperature":{"type":"number","description":"Value"},"tool_choice":{"type":"string","description":"Value","enum":["auto"]},"tools":{"type":"array","description":"Value","items":{"type":"object","properties":{"type":{"type":"string","description":"Value","required":true,"enum":["web_search_preview"]},"engine":{"type":"string","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. \"perplexity\" uses the Perplexity Search API (raw ranked results).","enum":["native","exa","parallel","firecrawl","perplexity","auto"]},"filters":{"type":"object","description":"Value"},"max_results":{"type":"number","description":"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_uses":{"type":"number","description":"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 only to Anthropic (as `max_uses`); other native search providers have no equivalent parameter and ignore it."},"mode":{"type":"string","description":"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.","enum":["instant","fast","auto","deep-lite","deep","deep-reasoning","turbo","basic","advanced"]},"search_context_size":{"type":"string","description":"Size of the search context for web search tools","enum":["low","medium","high"]},"user_location":{"type":"object","description":"Value"}}}},"top_k":{"type":"number","description":"Value"},"top_logprobs":{"type":"number","description":"Value"},"top_p":{"type":"number","description":"Value"},"trace":{"type":"object","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","description":"Value"},"parent_span_id":{"type":"string","description":"Value"},"span_name":{"type":"string","description":"Value"},"trace_id":{"type":"string","description":"Value"},"trace_name":{"type":"string","description":"Value"}}},"truncation":{"type":"string","description":"Value","enum":["auto","disabled","None"]},"user":{"type":"string","description":"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 users. Maximum of 256 characters."}}},"example":{"text":"","background":"","cache_control":{},"debug":{},"frequency_penalty":"","image_config":{},"include":[],"input":"","instructions":"","max_output_tokens":"","max_tool_calls":"","metadata":{},"modalities":[],"model":"","models":[],"parallel_tool_calls":"","plugins":[],"presence_penalty":"","previous_response_id":"","prompt":{},"prompt_cache_key":"","prompt_cache_options":{},"provider":{},"reasoning":"","route":"","safety_identifier":"","service_tier":"","session_id":"","stop_server_tools_when":[],"store":"","stream":"","temperature":"","tool_choice":"","tools":[],"top_k":"","top_logprobs":"","top_p":"","trace":{},"truncation":"","user":""}}}}}},"/presets/{slug}/versions":{"get":{"tags":["Presets"],"parameters":[{"name":"slug","in":"path","description":"URL-safe slug identifying the preset.","required":true,"schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"Maximum number of records to return (max 100)","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/presets/list-versions-of-a-preset.md","api_endpoint":"https://openrouter.ai/api/v1/presets/{slug}/versions"},"summary":"List versions of a preset","description":"Lists all versions of a preset, ordered by version number ascending (oldest first).","security":[{"bearerAuth":[]}]}},"/presets/{slug}/versions/{version}":{"get":{"tags":["Presets"],"parameters":[{"name":"slug","in":"path","description":"URL-safe slug identifying the preset.","required":true,"schema":{"type":"string","example":""}},{"name":"version","in":"path","description":"Version number of the preset.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/presets/get-a-specific-version-of-a-preset.md","api_endpoint":"https://openrouter.ai/api/v1/presets/{slug}/versions/{version}"},"summary":"Get a specific version of a preset","description":"Retrieves a specific version of a preset by its slug and version number.","security":[{"bearerAuth":[]}]}},"/providers":{"get":{"tags":["Providers"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/providers/list-all-providers.md","api_endpoint":"https://openrouter.ai/api/v1/providers"},"summary":"List all providers","description":"List all providers","security":[{"bearerAuth":[]}]}},"/rerank":{"post":{"tags":["Rerank"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/rerank/submit-a-rerank-request.md","api_endpoint":"https://openrouter.ai/api/v1/rerank"},"summary":"Submit a rerank request","description":"Submits a rerank request to the rerank router","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"documents":{"type":"array","description":"The list of documents to rerank. Documents may be plain strings, or structured objects with `text` and/or `image` for multimodal models.","required":true,"items":{"type":"string"}},"model":{"type":"string","description":"The rerank model to use","required":true},"provider":{"type":"string","description":"Value"},"query":{"type":"string","description":"The search query to rerank documents against","required":true},"top_n":{"type":"number","description":"Number of most relevant documents to return"}}},"example":{"documents":[],"model":"","provider":"","query":"","top_n":""}}}}}},"/responses":{"post":{"tags":["Responses"],"parameters":[{"name":"X-OpenRouter-Metadata","in":"query","description":"Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility.","required":false,"schema":{"type":"string","example":"","items":{"type":"string","enum":["disabled","enabled"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/responses/create-a-response.md","api_endpoint":"https://openrouter.ai/api/v1/responses"},"summary":"Create a response","description":"Creates a streaming or non-streaming response using OpenResponses API format","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"text":{"type":"string","description":"Text output configuration including format and verbosity"},"background":{"type":"boolean","description":"Value"},"cache_control":{"type":"object","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. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.","properties":{"type":{"type":"string","description":"Value","required":true,"enum":["ephemeral"]},"ttl":{"type":"string","description":"Value","enum":["5m","1h"]}}},"debug":{"type":"object","description":"Debug options for inspecting request transformations (streaming only)","properties":{"echo_upstream_body":{"type":"boolean","description":"If true, includes the transformed upstream request body in a debug chunk at the start of the stream. Only works with streaming mode."}}},"frequency_penalty":{"type":"number","description":"Value"},"image_config":{"type":"object","description":"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.","properties":{}},"include":{"type":"array","description":"Value","items":{"type":"string"}},"input":{"type":"string","description":"Value"},"instructions":{"type":"string","description":"Value"},"max_output_tokens":{"type":"number","description":"Value"},"max_tool_calls":{"type":"number","description":"Maximum number of server-tool (e.g. `openrouter:web_search`) agent steps the model may take during a request. Defaults to 30, which is also the maximum. Ignored when `stop_server_tools_when` is set."},"metadata":{"type":"object","description":"Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed.","properties":{}},"modalities":{"type":"array","description":"Output modalities for the response. Supported values are \"text\" and \"image\".","items":{"type":"string"}},"model":{"type":"string","description":"Value"},"models":{"type":"array","description":"Value","items":{"type":"string"}},"parallel_tool_calls":{"type":"boolean","description":"Value"},"plugins":{"type":"array","description":"Plugins you want to enable for this request, including their settings.","items":{"type":"string"}},"presence_penalty":{"type":"number","description":"Value"},"previous_response_id":{"type":"string","description":"Not supported. The Responses API is stateless: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead."},"prompt":{"type":"object","description":"Value","properties":{"id":{"type":"string","description":"Value","required":true},"variables":{"type":"object","description":"Value"}}},"prompt_cache_key":{"type":"string","description":"Value"},"prompt_cache_options":{"type":"object","description":"Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.","properties":{"mode":{"type":"string","description":"Value","required":true,"enum":["explicit"]},"ttl":{"type":"string","description":"Value"}}},"provider":{"type":"object","description":"When multiple model providers are available, optionally indicate your routing preference.","properties":{"allow_fallbacks":{"type":"boolean","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."},"data_collection":{"type":"string","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","None"]},"enforce_distillable_text":{"type":"boolean","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."},"ignore":{"type":"array","description":"List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."},"max_price":{"type":"object","description":"The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."},"only":{"type":"array","description":"List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."},"order":{"type":"array","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."},"preferred_max_latency":{"type":"number","description":"Value"},"preferred_min_throughput":{"type":"number","description":"Value"},"quantizations":{"type":"array","description":"A list of quantization levels to filter the provider by."},"require_parameters":{"type":"boolean","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."},"sort":{"type":"string","description":"The provider sorting strategy (price, throughput, latency)","enum":["price","throughput","latency","exacto"]},"zdr":{"type":"boolean","description":"Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used."}}},"reasoning":{"type":"string","description":"Configuration for reasoning mode in the response"},"route":{"type":"string","description":"**DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: \"fallback\" (maps to \"model\"), \"sort\" (maps to \"none\").","enum":["fallback","sort","None"]},"safety_identifier":{"type":"string","description":"Recommended 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, so provider policy blocks can affect the whole account."},"service_tier":{"type":"string","description":"The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.","enum":["auto","default","fast","flex","priority","scale","None"]},"session_id":{"type":"string","description":"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 observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters."},"stop_server_tools_when":{"type":"array","description":"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 turn is made with tool calls disabled so the response ends with a natural-language answer instead of an unfinished tool call.","items":{"type":"string"}},"store":{"type":"boolean","description":"Value"},"stream":{"type":"boolean","description":"Value"},"temperature":{"type":"number","description":"Value"},"tool_choice":{"type":"string","description":"Value","enum":["auto"]},"tools":{"type":"array","description":"Value","items":{"type":"object","properties":{"type":{"type":"string","description":"Value","required":true,"enum":["web_search_preview"]},"engine":{"type":"string","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. \"perplexity\" uses the Perplexity Search API (raw ranked results).","enum":["native","exa","parallel","firecrawl","perplexity","auto"]},"filters":{"type":"object","description":"Value"},"max_results":{"type":"number","description":"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_uses":{"type":"number","description":"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 only to Anthropic (as `max_uses`); other native search providers have no equivalent parameter and ignore it."},"mode":{"type":"string","description":"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.","enum":["instant","fast","auto","deep-lite","deep","deep-reasoning","turbo","basic","advanced"]},"search_context_size":{"type":"string","description":"Size of the search context for web search tools","enum":["low","medium","high"]},"user_location":{"type":"object","description":"Value"}}}},"top_k":{"type":"number","description":"Value"},"top_logprobs":{"type":"number","description":"Value"},"top_p":{"type":"number","description":"Value"},"trace":{"type":"object","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","description":"Value"},"parent_span_id":{"type":"string","description":"Value"},"span_name":{"type":"string","description":"Value"},"trace_id":{"type":"string","description":"Value"},"trace_name":{"type":"string","description":"Value"}}},"truncation":{"type":"string","description":"Value","enum":["auto","disabled","None"]},"user":{"type":"string","description":"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 users. Maximum of 256 characters."}}},"example":{"text":"","background":"","cache_control":{},"debug":{},"frequency_penalty":"","image_config":{},"include":[],"input":"","instructions":"","max_output_tokens":"","max_tool_calls":"","metadata":{},"modalities":[],"model":"","models":[],"parallel_tool_calls":"","plugins":[],"presence_penalty":"","previous_response_id":"","prompt":{},"prompt_cache_key":"","prompt_cache_options":{},"provider":{},"reasoning":"","route":"","safety_identifier":"","service_tier":"","session_id":"","stop_server_tools_when":[],"store":"","stream":"","temperature":"","tool_choice":"","tools":[],"top_k":"","top_logprobs":"","top_p":"","trace":{},"truncation":"","user":""}}}}}},"/scim/group-mappings":{"get":{"tags":["SCIM"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of records to return (max 100)","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/scim/list-scim-group-mappings.md","api_endpoint":"https://openrouter.ai/api/v1/scim/group-mappings"},"summary":"List SCIM group mappings","description":"List SCIM group-to-workspace mappings for the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]},"post":{"tags":["SCIM"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/scim/create-a-scim-group-mapping.md","api_endpoint":"https://openrouter.ai/api/v1/scim/group-mappings"},"summary":"Create a SCIM group mapping","description":"Create a SCIM group-to-workspace role mapping. Creating a mapping that already exists with the same role succeeds and re-applies the mapping to the group members. Requesting a different role for an existing mapping returns 409. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"role":{"type":"string","description":"Value","required":true,"enum":["admin","member"]},"scim_group_id":{"type":"string","description":"Value","required":true},"workspace_id":{"type":"string","description":"Value","required":true}}},"example":{"role":"","scim_group_id":"","workspace_id":""}}}}}},"/scim/group-mappings/{id}":{"delete":{"tags":["SCIM"],"parameters":[{"name":"id","in":"path","description":"Value","required":true,"schema":{"type":"string","example":""}},{"name":"keep_members","in":"query","description":"Required. Whether to keep workspace members after deleting the mapping. `false` **removes** the members this mapping granted access to; `true` deletes the mapping while leaving membership intact as manually-managed. There is deliberately no default — omitting it returns `400` so the destructive path cannot be reached by accident. Mirrors the dashboard, whose `DeleteMappingSchema.keepMembers` is likewise required.","required":true,"schema":{"type":"string","example":"","items":{"type":"string","enum":["true","false"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/scim/delete-a-scim-group-mapping.md","api_endpoint":"https://openrouter.ai/api/v1/scim/group-mappings/{id}"},"summary":"Delete a SCIM group mapping","description":"Delete a SCIM group-to-workspace mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}},"get":{"tags":["SCIM"],"parameters":[{"name":"id","in":"path","description":"Value","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/scim/get-a-scim-group-mapping.md","api_endpoint":"https://openrouter.ai/api/v1/scim/group-mappings/{id}"},"summary":"Get a SCIM group mapping","description":"Get a SCIM group-to-workspace mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]},"patch":{"tags":["SCIM"],"parameters":[{"name":"id","in":"path","description":"Value","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/scim/update-a-scim-group-mapping.md","api_endpoint":"https://openrouter.ai/api/v1/scim/group-mappings/{id}"},"summary":"Update a SCIM group mapping","description":"Update a SCIM group mapping role. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"role":{"type":"string","description":"Value","required":true,"enum":["admin","member"]}}},"example":{"role":""}}}}}},"/scim/groups":{"get":{"tags":["SCIM"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of records to return (max 100)","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/scim/list-scim-groups.md","api_endpoint":"https://openrouter.ai/api/v1/scim/groups"},"summary":"List SCIM groups","description":"List SCIM groups for the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]}},"/videos":{"post":{"tags":["Video Generation"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/video-generation/submit-a-video-generation-request.md","api_endpoint":"https://openrouter.ai/api/v1/videos"},"summary":"Submit a video generation request","description":"Submits a video generation request and returns a polling URL to check status","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"aspect_ratio":{"type":"string","description":"Aspect ratio of the generated video","enum":["16:9","9:16","1:1","4:3","3:4","3:2","2:3","21:9","9:21"]},"callback_url":{"type":"string","description":"URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS."},"creativity":{"type":"number","description":"Creativity level for video upscaling models only. This parameter is not supported by video generation models."},"duration":{"type":"number","description":"Duration of the generated video in seconds"},"frame_images":{"type":"array","description":"Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame.","items":{"type":"string"}},"generate_audio":{"type":"boolean","description":"Whether to generate audio alongside the video. Defaults to the endpoint's generate_audio capability flag, false if not set."},"input_references":{"type":"array","description":"Reference assets to guide video generation. Accepts image, audio, and video references. Audio and video references are only honored by providers that support them (including BytePlus Seedance generation 2 and newer); other providers use image references and ignore the rest.","items":{"type":"string"}},"model":{"type":"string","description":"Value","required":true},"prompt":{"type":"string","description":"Text prompt describing the video to generate. Optional for models that support generating a video from image input alone; required by all other models."},"provider":{"type":"object","description":"Provider-specific passthrough configuration","properties":{"options":{"type":"string","description":"Value"}}},"resolution":{"type":"string","description":"Resolution of the generated video","enum":["480p","720p","768p","1080p","1K","2K","4K"]},"seed":{"type":"number","description":"If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers."},"size":{"type":"string","description":"Exact pixel dimensions of the generated video in \"WIDTHxHEIGHT\" format (e.g. \"1280x720\"). Interchangeable with resolution + aspect_ratio."},"upscale_factor":{"type":"number","description":"Upscale factor for video upscaling models only. This parameter is not supported by video generation models."}}},"example":{"aspect_ratio":"","callback_url":"","creativity":"","duration":"","frame_images":[],"generate_audio":"","input_references":[],"model":"","prompt":"","provider":{},"resolution":"","seed":"","size":"","upscale_factor":""}}}}}},"/videos/{jobId}":{"get":{"tags":["Video Generation"],"parameters":[{"name":"jobId","in":"path","description":"Value","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/video-generation/poll-video-generation-status.md","api_endpoint":"https://openrouter.ai/api/v1/videos/{jobId}"},"summary":"Poll video generation status","description":"Returns job status and content URLs when completed","security":[{"bearerAuth":[]}]}},"/videos/{jobId}/content":{"get":{"tags":["Video Generation"],"parameters":[{"name":"jobId","in":"path","description":"Value","required":true,"schema":{"type":"string","example":""}},{"name":"index","in":"query","description":"Value","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/video-generation/download-generated-video-content.md","api_endpoint":"https://openrouter.ai/api/v1/videos/{jobId}/content"},"summary":"Download generated video content","description":"Streams the generated video content from the upstream provider","security":[{"bearerAuth":[]}]}},"/videos/models":{"get":{"tags":["Video Generation"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/video-generation/list-all-video-generation-models.md","api_endpoint":"https://openrouter.ai/api/v1/videos/models"},"summary":"List all video generation models","description":"Returns a list of all available video generation models and their properties","security":[{"bearerAuth":[]}]}},"/workspaces":{"get":{"tags":["Workspaces"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of records to return (max 100)","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/workspaces/list-workspaces.md","api_endpoint":"https://openrouter.ai/api/v1/workspaces"},"summary":"List workspaces","description":"List all workspaces for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]},"post":{"tags":["Workspaces"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/workspaces/create-a-workspace.md","api_endpoint":"https://openrouter.ai/api/v1/workspaces"},"summary":"Create a workspace","description":"Create a new workspace for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"default_image_model":{"type":"string","description":"Default image model for this workspace"},"default_provider_sort":{"type":"string","description":"Default provider sort preference (price, throughput, latency, exacto)"},"default_text_model":{"type":"string","description":"Default text model for this workspace"},"description":{"type":"string","description":"Description of the workspace"},"io_logging_api_key_ids":{"type":"array","description":"Optional array of API key IDs to filter I/O logging","items":{"type":"number"}},"io_logging_sampling_rate":{"type":"number","description":"Sampling rate for I/O logging (0.0001-1)"},"is_data_discount_logging_enabled":{"type":"boolean","description":"Whether data discount logging is enabled"},"is_observability_broadcast_enabled":{"type":"boolean","description":"Whether broadcast is enabled"},"is_observability_io_logging_enabled":{"type":"boolean","description":"Whether private logging is enabled"},"name":{"type":"string","description":"Name for the new workspace","required":true},"slug":{"type":"string","description":"URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens)","required":true}}},"example":{"default_image_model":"","default_provider_sort":"","default_text_model":"","description":"","io_logging_api_key_ids":[],"io_logging_sampling_rate":"","is_data_discount_logging_enabled":"","is_observability_broadcast_enabled":"","is_observability_io_logging_enabled":"","name":"","slug":""}}}}}},"/workspaces/{id}":{"delete":{"tags":["Workspaces"],"parameters":[{"name":"id","in":"path","description":"The workspace ID (UUID) or slug","required":true,"schema":{"type":"string","example":""}},{"name":"confirm_default_workspace_deletion","in":"query","description":"Required to delete the default workspace. Deleting it permanently disables the account’s unscoped inference API keys (management/provisioning keys are retained) and its budgets, guardrails, classifiers, and broadcast destinations. Ignored for non-default workspaces.","required":false,"schema":{"type":"boolean","example":"","items":{"type":"string","enum":["true","false"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/workspaces/delete-a-workspace.md","api_endpoint":"https://openrouter.ai/api/v1/workspaces/{id}"},"summary":"Delete a workspace","description":"Delete an existing workspace. Workspaces with active API keys cannot be deleted; remove the keys first. Deleting the default workspace requires confirm_default_workspace_deletion=true. Deleting any workspace permanently deletes its budgets and guardrails and disables its classifiers and broadcast destinations. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}},"get":{"tags":["Workspaces"],"parameters":[{"name":"id","in":"path","description":"The workspace ID (UUID) or slug","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/workspaces/get-a-workspace.md","api_endpoint":"https://openrouter.ai/api/v1/workspaces/{id}"},"summary":"Get a workspace","description":"Get a single workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]},"patch":{"tags":["Workspaces"],"parameters":[{"name":"id","in":"path","description":"The workspace ID (UUID) or slug","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/workspaces/update-a-workspace.md","api_endpoint":"https://openrouter.ai/api/v1/workspaces/{id}"},"summary":"Update a workspace","description":"Update an existing workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"default_image_model":{"type":"string","description":"Default image model for this workspace"},"default_provider_sort":{"type":"string","description":"Default provider sort preference (price, throughput, latency, exacto)"},"default_text_model":{"type":"string","description":"Default text model for this workspace"},"description":{"type":"string","description":"New description for the workspace"},"io_logging_api_key_ids":{"type":"array","description":"Optional array of API key IDs to filter I/O logging","items":{"type":"number"}},"io_logging_sampling_rate":{"type":"number","description":"Sampling rate for I/O logging (0.0001-1)"},"is_data_discount_logging_enabled":{"type":"boolean","description":"Whether data discount logging is enabled"},"is_observability_broadcast_enabled":{"type":"boolean","description":"Whether broadcast is enabled"},"is_observability_io_logging_enabled":{"type":"boolean","description":"Whether private logging is enabled"},"name":{"type":"string","description":"New name for the workspace"},"slug":{"type":"string","description":"New URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens)"}}},"example":{"default_image_model":"","default_provider_sort":"","default_text_model":"","description":"","io_logging_api_key_ids":[],"io_logging_sampling_rate":"","is_data_discount_logging_enabled":"","is_observability_broadcast_enabled":"","is_observability_io_logging_enabled":"","name":"","slug":""}}}}}},"/workspaces/{id}/budgets":{"get":{"tags":["Workspaces"],"parameters":[{"name":"id","in":"path","description":"The workspace ID (UUID) or slug","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/workspaces/list-workspace-budgets.md","api_endpoint":"https://openrouter.ai/api/v1/workspaces/{id}/budgets"},"summary":"List workspace budgets","description":"List all budgets configured for a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]}},"/workspaces/{id}/budgets/{interval}":{"delete":{"tags":["Workspaces"],"parameters":[{"name":"id","in":"path","description":"The workspace ID (UUID) or slug","required":true,"schema":{"type":"string","example":""}},{"name":"interval","in":"path","description":"Budget reset interval. Use \"lifetime\" for a one-time budget that never resets.","required":true,"schema":{"type":"string","example":"","items":{"type":"string","enum":["daily","weekly","monthly","lifetime"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/workspaces/delete-a-workspace-budget.md","api_endpoint":"https://openrouter.ai/api/v1/workspaces/{id}/budgets/{interval}"},"summary":"Delete a workspace budget","description":"Remove the budget for a given interval. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}},"get":{"tags":["Workspaces"],"parameters":[{"name":"id","in":"path","description":"The workspace ID (UUID) or slug","required":true,"schema":{"type":"string","example":""}},{"name":"interval","in":"path","description":"Budget reset interval. Use \"lifetime\" for a one-time budget that never resets.","required":true,"schema":{"type":"string","example":"","items":{"type":"string","enum":["daily","weekly","monthly","lifetime"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/workspaces/get-a-workspace-budget.md","api_endpoint":"https://openrouter.ai/api/v1/workspaces/{id}/budgets/{interval}"},"summary":"Get a workspace budget","description":"Retrieve the budget for a given interval. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]},"put":{"tags":["Workspaces"],"parameters":[{"name":"id","in":"path","description":"The workspace ID (UUID) or slug","required":true,"schema":{"type":"string","example":""}},{"name":"interval","in":"path","description":"Budget reset interval. Use \"lifetime\" for a one-time budget that never resets.","required":true,"schema":{"type":"string","example":"","items":{"type":"string","enum":["daily","weekly","monthly","lifetime"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/workspaces/create-or-update-a-workspace-budget.md","api_endpoint":"https://openrouter.ai/api/v1/workspaces/{id}/budgets/{interval}"},"summary":"Create or update a workspace budget","description":"Create or update the budget for a given interval. Budget limits must strictly decrease as the interval narrows (lifetime > monthly > weekly > daily). The optional `include_byok_in_budgets` flag is a workspace-wide setting: when provided it applies to every budget interval for the workspace, not just the interval in this request. Note that a change made here is applied to budget enforcement immediately, but an already-open workspace settings page in the web dashboard may keep showing the previous value until it is reloaded. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"include_byok_in_budgets":{"type":"boolean","description":"Whether to include BYOK (bring-your-own-key) spend when enforcing the workspace's budgets. This is a workspace-wide setting: it applies to every budget interval (daily, weekly, monthly, and lifetime), not just the interval being upserted in this request. Omit to leave the current setting unchanged."},"limit_usd":{"type":"number","description":"Spending limit in USD. Must be greater than 0.","required":true}}},"example":{"include_byok_in_budgets":"","limit_usd":""}}}}}},"/workspaces/{id}/members":{"get":{"tags":["Workspaces"],"parameters":[{"name":"id","in":"path","description":"The workspace ID (UUID) or slug","required":true,"schema":{"type":"string","example":""}},{"name":"limit","in":"query","description":"Maximum number of records to return (max 100)","required":false,"schema":{"type":"number","example":""}},{"name":"offset","in":"query","description":"Number of records to skip for pagination","required":false,"schema":{"type":"number","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/workspaces/list-workspace-members.md","api_endpoint":"https://openrouter.ai/api/v1/workspaces/{id}/members"},"summary":"List workspace members","description":"List all members of a workspace. Returns paginated results. For the default workspace, returns all organization members (implicit membership). [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}]}},"/workspaces/{id}/members/add":{"post":{"tags":["Workspaces"],"parameters":[{"name":"id","in":"path","description":"The workspace ID (UUID) or slug","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/workspaces/bulk-add-members-to-a-workspace.md","api_endpoint":"https://openrouter.ai/api/v1/workspaces/{id}/members/add"},"summary":"Bulk add members to a workspace","description":"Add multiple organization members to a workspace. Members are assigned the same role they hold in the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"user_ids":{"type":"array","description":"List of user IDs to add to the workspace. Members are assigned the same role they hold in the organization.","required":true,"items":{"type":"string"}}}},"example":{"user_ids":[]}}}}}},"/workspaces/{id}/members/remove":{"post":{"tags":["Workspaces"],"parameters":[{"name":"id","in":"path","description":"The workspace ID (UUID) or slug","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://openrouter.ai/docs/api/api-reference/workspaces/bulk-remove-members-from-a-workspace.md","api_endpoint":"https://openrouter.ai/api/v1/workspaces/{id}/members/remove"},"summary":"Bulk remove members from a workspace","description":"Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. SCIM-managed members cannot be removed; changes must be made in your identity provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"user_ids":{"type":"array","description":"List of user IDs to remove from the workspace","required":true,"items":{"type":"string"}}}},"example":{"user_ids":[]}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"security":[{"bearerAuth":[]}]}