{ "id": "chatcmpl-8f3c2a1e9b7d4c6a", "object": "chat.completion", "created": 1792051200, "model": "claude-opus-5-5", "choices": [ { "index": 0, "message": {"role": "assistant", "content": "Hello! How can I help you today?"}, "finish_reason": "stop" } ], "usage": {"prompt_tokens": 8, "completion_tokens": 12, "total_tokens": 20}}
The body is an OpenAI Chat Completions request, whatever the provider: the gateway translates it for Anthropic, Google, Bedrock, Mistral and the others, and answers in OpenAI’s format. Point any OpenAI client at https://gateway.weflayr.com/v1 with an API key with the Gateway scope.
A model name (e.g. claude-opus-5-5, gpt-6-luna), as GET /v1/models lists them, or a routing strategy slug: strategy/<slug> for its latest version (strategy/<slug>:latest is the same), strategy/<slug>:<version> to pin one. Any other text after the : returns a 400 invalid_routing_strategy_version. Do not prefix the name with the provider (openai/gpt-6-luna is not found): set provider instead. A list of model names is tried in order (see fallback); a routing strategy cannot be in a list.
The conversation, as the OpenAI Chat Completions API writes it. A content part can mark a cache breakpoint with Anthropic’s cache_control or OpenAI’s prompt_cache_breakpoint, whatever the model: the gateway writes it the way the provider reads it.
Nucleus sampling: the model samples among the tokens making up this share of the probability. Removed by self-heal on models that refuse it, such as Claude Opus 4.7 and later.
none, minimal, low, medium, high, xhigh or max. A level the model does not take is replaced with the closest one it does if self-heal is on. Send it or reasoning, not both. Through a routing strategy, it wins over the effort the strategy sets.
A key grouping requests that share a prompt prefix, to improve prompt cache hits. Used by OpenAI, Azure, xAI, Mistral and the Bedrock models called through their Responses API (e.g. some of OpenAI’s or Kimi K3). Claude, Gemini and the other Bedrock models refuse it. Without one, the gateway sends these providers a key of its own per organization and model.
in_memory or 24h: how long OpenAI keeps the cached prompt prefix. Sent to OpenAI, Azure and Bedrock’s Responses API models; with self-heal on, removed for Claude, Gemini, the other Bedrock models and xAI, which have no such field. To set a lifetime on any model taking cache breakpoints, use the breakpoint’s ttl: self-heal moves it to the closest lifetime the provider offers.
auto drops the earliest messages when the prompt is longer than the model’s context, disabled (the default) refuses it.
The gateway reads these fields on top of the OpenAI ones and never sends them to the provider. With the OpenAI SDK, pass them in extra_body (Python) or as extra keys of the request object (Node.js).
Serve the model from this provider only. GET /v1/models lists the providers of each model. A list is tried in order. Omit to try every provider serving the model (see fallback). Returns a 400 if passed with a routing strategy.
Serve the model from this region only: GLOBAL, US, EU, or a provider’s own region (e.g. eu-west-1 on Bedrock). GET /v1/models lists the regions of each model. A list is tried in order. Omit to try every region serving the model: GLOBAL, then US, then EU. Returns a 400 if passed with a routing strategy.
What to do with a parameter the model does not take (Self-heal): on_with_warnings removes or replaces it and lists the change in weflayr_warnings, on does the same without the list, off sends the request unchanged. With a routing strategy, the default is on when the strategy has self-healing on, off otherwise.
Only needed with self_heal: "off", or for service_tier. With "off", these parameters are removed when the model does not take them instead of returning a 400: any of temperature, top_p, top_k, logprobs (with top_logprobs), n, stop, penalties (presence_penalty and frequency_penalty), seed, tool_choice, reasoning, cache_breakpoints, parallel_tool_calls, prompt_cache_settings (prompt_cache_retention and prompt_cache_options). service_tier is never removed by self_heal: list it here, whatever self_heal says, to have it removed when no provider of the model offers the tier (this changes the price of the call).
Which deployments (a model served by one provider in one region) are moved later in the list of deployments to try. A deployment is unavailable when it did not respond in the past 60 minutes, and unhealthy when more than 25% of its calls failed in the past 60 minutes (see model fallback). Whatever the value, an unavailable deployment is tried last.
default: an unhealthy deployment is tried after the other deployments of the same model.
unavailable: an unhealthy deployment keeps its place.
unhealthy: an unhealthy deployment is tried last, with the unavailable ones.
The gateway uses default by default. A call through a routing strategy uses the strategy’s Skip unavailable or unhealthy models setting instead, unless this field is set.
How many times the first deployment is called again after a timeout, a network failure or a provider server error, before the call falls back: {"enabled": false} falls back at once, {"enabled": true, "attempts": 3} calls it up to 3 more times (attempts from 1 to 10). By default, the gateway does not call it again and falls back at once. A call through a routing strategy uses the strategy’s Retry on error setting instead, unless this field is set.
Raw provider fields merged into the request sent to the provider, keyed by common (every provider), an API family (e.g. anthropic_messages, gemini_generate_content) or a provider (e.g. openai).
Weflayr’s own fields, never sent to the provider. They name who the call is for and what it does, so Weflayr can split your costs and revenue on the dashboards, find the calls a benchmark replays, and apply a routing strategy’s customer overrides.
The customer the call is made for. It joins your AI cost to your revenue, and selects the customer overrides of a routing strategy. Defaults to the OpenAI user field.
The feature the call belongs to, as {"feature_name": "support-chat"}. It also takes feature_run_uuid (any string, to group the calls of one feature run), customer_name and tags; the body’s weflayr values win over the header’s. Each value is at most 1024 bytes, longer is a 400, and a header that is not a JSON object is a 400 invalid_metadata_header. The SDKs set this header for you.
Mark cache breakpoints with OpenAI’s prompt_cache_breakpoint (with an optional ttl): it works on every provider, for every model that takes cache breakpoints, such as Claude, GPT-5.6 and later, Kimi, Qwen, GLM and Nova. Anthropic’s cache_control is accepted too. With self-heal on, the gateway removes the breakpoints on a model where they write no cache, and replaces a ttl the provider does not offer with the closest one it does: 5m or 1h on Claude, 30m or 12h on OpenAI and Azure.
An OpenAI Chat Completion object. When the gateway changed the request or a routing strategy setting, or moved the request to another deployment, the response also has weflayr_warnings, the list of changes.With "stream": true, the gateway answers with OpenAI’s server-sent events, ending with data: [DONE]. Warnings then come first, in a chunk with no choice.
{ "id": "chatcmpl-8f3c2a1e9b7d4c6a", "object": "chat.completion", "created": 1792051200, "model": "claude-opus-5-5", "choices": [ { "index": 0, "message": {"role": "assistant", "content": "Hello! How can I help you today?"}, "finish_reason": "stop" } ], "usage": {"prompt_tokens": 8, "completion_tokens": 12, "total_tokens": 20}}
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Weflayr Docs","description":"Weflayr: route every LLM call to the cheapest model that keeps your quality, and see your AI cost and margin per customer.","colors":{"primary":"#2E1B11","light":"#C7F04A","dark":"#0F0704"},"logo":{"light":"https://mintcdn.com/weflayr/jf99vD0W4dsGuj5S/images/logo-light-mode.svg?fit=max\u0026auto=format\u0026n=jf99vD0W4dsGuj5S\u0026q=85\u0026s=946f2cb0880dbdf0a0fbeaef912f21cd","dark":"https://mintcdn.com/weflayr/jf99vD0W4dsGuj5S/images/logo-dark-mode.svg?fit=max\u0026auto=format\u0026n=jf99vD0W4dsGuj5S\u0026q=85\u0026s=7b7356cb9bc85d3c21d94701fc3a4170","href":"/"},"favicon":"https://mintcdn.com/weflayr/5F8K-KIhlauIBT6x/images/favicon.svg?fit=max\u0026auto=format\u0026n=5F8K-KIhlauIBT6x\u0026q=85\u0026s=9f295bd67465b8cc7513661a806cb547","api":{"playground":{"display":"interactive"},"mdx":{"auth":{"method":"bearer"}}},"background":{"color":{"light":"#F9F5F1","dark":"#100C0A"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"For agents","icon":{"style":"regular","name":"robot"},"href":"https://docs.weflayr.com/for-agents"},{"anchor":"Talk to us","icon":{"style":"regular","name":"calendar"},"href":"https://calendly.com/noe-weflayr/30min"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"weflayr","hasAudioNarration":false,"actualSubdomain":"weflayr","customDomains":["docs.weflayr.com"],"gitSource":{"type":"github","owner":"weflayr","repo":"weflayr","deployBranch":"mintlify-doc","contentDirectory":"docs/mintlify_documentation","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6af3631b1f38dc5cafeaf1ff","clientVersion":"0.0.4102","searchFilterCounts":[{"language":"default","tag":"API reference","count":49},{"language":"default","tag":"Management","count":43},{"language":"default","tag":"Platform","count":15},{"language":"default","tag":"Get started","count":11},{"language":"default","tag":"Benchmarks","count":9},{"language":"default","tag":"SDKs","count":9},{"language":"default","tag":"Project","count":7},{"language":"default","tag":"Configure","count":7},{"language":"default","tag":"Routing strategies","count":6},{"language":"default","tag":"Evaluators","count":6}],"searchSettings":{"maxResults":10}},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":":root{--weflayr-font-sans: \"Helvetica Neue\", Helvetica, \"Segoe UI\", Arial, sans-serif;--weflayr-content: #201713;--weflayr-supportive: #68554b;--weflayr-line: #ece6df;--weflayr-surface: #ffffff;--weflayr-hover: rgb(74 61 54 / 0.08);--weflayr-focus: #a5988d;--weflayr-brand: #c7f04a;--weflayr-on-brand: #2e1b11}html.dark{--weflayr-content: #f9f5f1;--weflayr-supportive: #a5988d;--weflayr-line: #4a3d36;--weflayr-surface: #201713;--weflayr-hover: rgb(165 152 141 / 0.12);--weflayr-focus: #68554b}html,body{font-family:var(--weflayr-font-sans)}#content-area{color:var(--weflayr-content)}#content-area h1{font-size:1.875rem;line-height:2.375rem;letter-spacing:-0.02em}#content-area h2:not([data-component-part]){font-size:1.3125rem;line-height:1.75rem}#content-area h3:not([data-component-part]){font-size:1.0625rem;line-height:1.5rem}#sidebar{width:16rem}#sidebar a,#sidebar button{padding-top:0.25rem;padding-bottom:0.25rem}#sidebar a[aria-current=\"page\"],#sidebar button.text-primary{background-color:var(--weflayr-surface);box-shadow:inset 0 0 0 1px var(--weflayr-line);color:var(--weflayr-content)}#sidebar a:not([aria-current=\"page\"]):hover{background-color:var(--weflayr-hover)}.card{background-color:var(--weflayr-surface);border-color:var(--weflayr-line);border-radius:12px}.card:hover{border-color:var(--weflayr-focus)!important}.card [data-component-part=\"card-title\"]{color:var(--weflayr-content)}.card [data-component-part=\"card-content\"]{color:var(--weflayr-supportive)}.card [data-component-part=\"card-icon\"]>svg{background-color:var(--weflayr-on-brand)}html.dark .card [data-component-part=\"card-icon\"]>svg{background-color:var(--weflayr-brand)}#navbar .nav-logo{height:1.25rem}html.dark img[src*=\"/images/icons/\"]{filter:invert(1)}#sidebar svg[class*=\"bg-[color:CanvasText]\"]{background-color:black}html.dark #sidebar svg[class*=\"bg-[color:CanvasText]\"]{background-color:white}#sidebar .nav-anchor>div{box-shadow:none;background:none!important;padding:0;margin-right:0.75rem}"}],"page":{"pagePath":"api/gateway/chat-completions","slug":"/api/gateway/chat-completions","pageMetadata":{"title":"Chat completions","api":"POST https://gateway.weflayr.com/v1/chat/completions","description":"Call any model of any provider with the OpenAI Chat Completions format.","href":"/api/gateway/chat-completions"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Call any model of any provider with the OpenAI Chat Completions format.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Expandable,Heading,ParamField,Tab,Tabs}=_components;if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The body is an `,_jsx(_components.a,{href:`https://platform.openai.com/docs/api-reference/chat/create`,children:`OpenAI Chat Completions request`}),`, whatever the provider: the gateway translates it for Anthropic, Google, Bedrock, Mistral and the others, and answers in OpenAI’s format. Point any OpenAI client at `,_jsx(_components.code,{children:`https://gateway.weflayr.com/v1`}),` with an `,_jsx(_components.a,{href:`/product/api-keys`,children:`API key with the Gateway scope`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request body`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`OpenAI fields`,id:`openai-fields`,children:[_jsx(ParamField,{body:`model`,type:`string`,placeholder:`gpt-6-luna`,required:true,id:`param-model`,children:_jsxs(_components.p,{children:[`A model name (e.g. `,_jsx(_components.code,{children:`claude-opus-5-5`}),`, `,_jsx(_components.code,{children:`gpt-6-luna`}),`), as `,_jsx(_components.a,{href:`/api/gateway/models`,children:_jsx(_components.code,{children:`GET /v1/models`})}),` lists them, or a `,_jsx(_components.a,{href:`/product/routing-strategies`,children:`routing strategy`}),` slug: `,_jsx(_components.code,{children:`strategy/\u003cslug>`}),` for its latest version (`,_jsx(_components.code,{children:`strategy/\u003cslug>:latest`}),` is the same), `,_jsx(_components.code,{children:`strategy/\u003cslug>:\u003cversion>`}),` to pin one. Any other text after the `,_jsx(_components.code,{children:`:`}),` returns a 400 `,_jsx(_components.code,{children:`invalid_routing_strategy_version`}),`. Do not prefix the name with the provider (`,_jsx(_components.code,{children:`openai/gpt-6-luna`}),` is not found): set `,_jsx(_components.code,{children:`provider`}),` instead. A list of model names is tried in order (see `,_jsx(_components.a,{href:`/concepts/fallback-and-model-health`,children:`fallback`}),`); a routing strategy cannot be in a list.`]})}),_jsxs(ParamField,{body:`messages`,type:`object[]`,required:true,id:`param-messages`,children:[_jsxs(_components.p,{children:[`The conversation, as the `,_jsx(_components.a,{href:`https://platform.openai.com/docs/api-reference/chat/create#chat-create-messages`,children:`OpenAI Chat Completions API`}),` writes it. A content part can mark a cache breakpoint with Anthropic’s `,_jsx(_components.code,{children:`cache_control`}),` or OpenAI’s `,_jsx(_components.code,{children:`prompt_cache_breakpoint`}),`, whatever the model: the gateway writes it the way the provider reads it.`]}),_jsxs(Expandable,{title:`message`,children:[_jsx(ParamField,{body:`role`,type:`string`,placeholder:`user`,required:true,id:`param-role`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`system`}),`, `,_jsx(_components.code,{children:`developer`}),`, `,_jsx(_components.code,{children:`user`}),`, `,_jsx(_components.code,{children:`assistant`}),` or `,_jsx(_components.code,{children:`tool`}),`.`]})}),_jsx(ParamField,{body:`content`,type:`string`,placeholder:`Hello`,required:true,id:`param-content`,children:_jsx(_components.p,{children:`The message’s text, or a list of content parts.`})})]})]}),_jsx(ParamField,{body:`max_completion_tokens`,type:`integer`,id:`param-max-completion-tokens`,children:_jsxs(_components.p,{children:[`The most tokens the answer can have, reasoning tokens included. The deprecated `,_jsx(_components.code,{children:`max_tokens`}),` is read too; send one or the other.`]})}),_jsx(ParamField,{body:`temperature`,type:`number`,id:`param-temperature`,children:_jsx(_components.p,{children:`The sampling temperature.`})}),_jsx(ParamField,{body:`top_p`,type:`number`,id:`param-top-p`,children:_jsx(_components.p,{children:`Nucleus sampling: the model samples among the tokens making up this share of the probability. Removed by self-heal on models that refuse it, such as Claude Opus 4.7 and later.`})}),_jsx(ParamField,{body:`top_k`,type:`integer`,id:`param-top-k`,children:_jsx(_components.p,{children:`The model samples among this many most likely tokens. Removed by self-heal on OpenAI, Azure and xAI, which have no such field.`})}),_jsx(ParamField,{body:`stop`,type:`string`,id:`param-stop`,children:_jsx(_components.p,{children:`Text, or a list of texts, that ends the answer when the model writes it. Removed by self-heal on OpenAI, Azure and xAI.`})}),_jsx(ParamField,{body:`presence_penalty`,type:`number`,id:`param-presence-penalty`,children:_jsxs(_components.p,{children:[`Lowers the odds of tokens already in the answer. Removed by self-heal on OpenAI, Azure, xAI, Anthropic and Bedrock, like `,_jsx(_components.code,{children:`frequency_penalty`}),`.`]})}),_jsx(ParamField,{body:`frequency_penalty`,type:`number`,id:`param-frequency-penalty`,children:_jsx(_components.p,{children:`Lowers the odds of tokens by how often they already appear in the answer.`})}),_jsx(ParamField,{body:`seed`,type:`integer`,id:`param-seed`,children:_jsx(_components.p,{children:`Makes sampling repeatable where the provider supports it. Removed by self-heal on OpenAI, Azure, xAI, Anthropic and Bedrock.`})}),_jsx(ParamField,{body:`n`,type:`integer`,default:`1`,id:`param-n`,children:_jsx(_components.p,{children:`The number of answers to write. Above 1, removed by self-heal on OpenAI, Azure, xAI, Anthropic and Bedrock.`})}),_jsx(ParamField,{body:`logprobs`,type:`boolean`,id:`param-logprobs`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` returns the log probability of each answer token. Removed by self-heal on Anthropic, Bedrock and xAI.`]})}),_jsx(ParamField,{body:`top_logprobs`,type:`integer`,id:`param-top-logprobs`,children:_jsxs(_components.p,{children:[`The number of most likely tokens to return at each position, with their log probabilities. Needs `,_jsx(_components.code,{children:`logprobs: true`}),`.`]})}),_jsx(ParamField,{body:`tools`,type:`object[]`,id:`param-tools`,children:_jsxs(_components.p,{children:[`The function tools the model may call (`,_jsx(_components.code,{children:`type: \"function\"`}),`, with its `,_jsx(_components.code,{children:`name`}),`, `,_jsx(_components.code,{children:`description`}),`, `,_jsx(_components.code,{children:`parameters`}),` and `,_jsx(_components.code,{children:`strict`}),`).`]})}),_jsx(ParamField,{body:`tool_choice`,type:`string`,id:`param-tool-choice`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`auto`}),`, `,_jsx(_components.code,{children:`required`}),` or `,_jsx(_components.code,{children:`none`}),`, or a function to call (`,_jsx(_components.code,{children:`{\"type\": \"function\", \"function\": {\"name\": \"...\"}}`}),`).`]})}),_jsx(ParamField,{body:`parallel_tool_calls`,type:`boolean`,id:`param-parallel-tool-calls`,children:_jsx(_components.p,{children:`Whether the model may call several tools in one turn.`})}),_jsx(ParamField,{body:`web_search_options`,type:`object`,id:`param-web-search-options`,children:_jsxs(_components.p,{children:[`Lets the model search the web (`,_jsx(_components.code,{children:`search_context_size`}),`, `,_jsx(_components.code,{children:`user_location`}),`), on the providers that run a web search.`]})}),_jsx(ParamField,{body:`response_format`,type:`object`,id:`param-response-format`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`{\"type\": \"text\"}`}),`, `,_jsx(_components.code,{children:`{\"type\": \"json_object\"}`}),`, or `,_jsx(_components.code,{children:`{\"type\": \"json_schema\", \"json_schema\": {\"name\": \"...\", \"schema\": {...}, \"strict\": true}}`}),` for a structured output.`]})}),_jsx(ParamField,{body:`reasoning_effort`,type:`string`,id:`param-reasoning-effort`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`none`}),`, `,_jsx(_components.code,{children:`minimal`}),`, `,_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`medium`}),`, `,_jsx(_components.code,{children:`high`}),`, `,_jsx(_components.code,{children:`xhigh`}),` or `,_jsx(_components.code,{children:`max`}),`. A level the model does not take is replaced with the closest one it does if `,_jsx(_components.a,{href:`/concepts/self-heal`,children:`self-heal`}),` is on. Send it or `,_jsx(_components.code,{children:`reasoning`}),`, not both. Through a routing strategy, it wins over the `,_jsx(_components.a,{href:`/product/routing-strategies#what-your-call-sends-wins`,children:`effort the strategy sets`}),`.`]})}),_jsxs(ParamField,{body:`reasoning`,type:`object`,id:`param-reasoning`,children:[_jsxs(_components.p,{children:[`How much the model thinks before it answers, with more control than `,_jsx(_components.code,{children:`reasoning_effort`}),`.`]}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`effort`,type:`string`,id:`param-effort`,children:_jsxs(_components.p,{children:[`The same levels as `,_jsx(_components.code,{children:`reasoning_effort`}),`.`]})}),_jsx(ParamField,{body:`max_tokens`,type:`integer`,id:`param-max-tokens`,children:_jsxs(_components.p,{children:[`A thinking budget in tokens, in place of `,_jsx(_components.code,{children:`effort`}),`.`]})}),_jsx(ParamField,{body:`enabled`,type:`boolean`,id:`param-enabled`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`false`}),` turns thinking off.`]})}),_jsx(ParamField,{body:`exclude`,type:`boolean`,id:`param-exclude`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` leaves the reasoning out of the answer.`]})})]})]}),_jsx(ParamField,{body:`service_tier`,type:`string`,id:`param-service-tier`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`auto`}),`, `,_jsx(_components.code,{children:`default`}),`, `,_jsx(_components.code,{children:`flex`}),` or `,_jsx(_components.code,{children:`priority`}),`. `,_jsx(_components.code,{children:`flex`}),` and `,_jsx(_components.code,{children:`priority`}),` keep only the providers that offer that tier.`]})}),_jsx(ParamField,{body:`user`,type:`string`,id:`param-user`,children:_jsx(_components.p,{children:`An id of your end user, passed to the provider.`})}),_jsx(ParamField,{body:`stream`,type:`boolean`,default:`false`,id:`param-stream`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` streams the answer as server-sent events (see `,_jsx(_components.a,{href:`#response`,children:`Response`}),`).`]})}),_jsx(ParamField,{body:`stream_options`,type:`object`,id:`param-stream-options`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`include_usage`}),`: `,_jsx(_components.code,{children:`true`}),` adds a last chunk with the token usage. `,_jsx(_components.code,{children:`include_obfuscation`}),`: `,_jsx(_components.code,{children:`false`}),` leaves out the padding OpenAI adds to each streamed chunk.`]})}),_jsx(ParamField,{body:`prompt_cache_key`,type:`string`,id:`param-prompt-cache-key`,children:_jsx(_components.p,{children:`A key grouping requests that share a prompt prefix, to improve prompt cache hits. Used by OpenAI, Azure, xAI, Mistral and the Bedrock models called through their Responses API (e.g. some of OpenAI’s or Kimi K3). Claude, Gemini and the other Bedrock models refuse it. Without one, the gateway sends these providers a key of its own per organization and model.`})}),_jsx(ParamField,{body:`prompt_cache_retention`,type:`string`,id:`param-prompt-cache-retention`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`in_memory`}),` or `,_jsx(_components.code,{children:`24h`}),`: how long OpenAI keeps the cached prompt prefix. Sent to OpenAI, Azure and Bedrock’s Responses API models; with self-heal on, removed for Claude, Gemini, the other Bedrock models and xAI, which have no such field. To set a lifetime on any model taking cache breakpoints, use the breakpoint’s `,_jsx(_components.code,{children:`ttl`}),`: self-heal moves it to the closest lifetime the provider offers.`]})}),_jsx(ParamField,{body:`prompt_cache_options`,type:`object`,id:`param-prompt-cache-options`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`{\"mode\": \"explicit\"}`}),` turns off GPT-5.6+‘s implicit cache, so only your breakpoints are cached. Sent and removed like `,_jsx(_components.code,{children:`prompt_cache_retention`}),`.`]})}),_jsx(ParamField,{body:`safety_identifier`,type:`string`,id:`param-safety-identifier`,children:_jsx(_components.p,{children:`A stable id of your end user, hashed, which the provider uses to detect abuse.`})}),_jsx(ParamField,{body:`max_tool_calls`,type:`integer`,id:`param-max-tool-calls`,children:_jsx(_components.p,{children:`The most built-in tool calls the model can make in one answer.`})}),_jsx(ParamField,{body:`truncation`,type:`string`,id:`param-truncation`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`auto`}),` drops the earliest messages when the prompt is longer than the model’s context, `,_jsx(_components.code,{children:`disabled`}),` (the default) refuses it.`]})})]}),_jsxs(Tab,{title:`Weflayr fields`,id:`weflayr-fields`,children:[_jsxs(_components.p,{children:[`The gateway reads these fields on top of the OpenAI ones and never sends them to the provider. With the OpenAI SDK, pass them in `,_jsx(_components.code,{children:`extra_body`}),` (Python) or as extra keys of the request object (Node.js).`]}),_jsx(ParamField,{body:`provider`,type:`string | list[string]`,id:`param-provider`,children:_jsxs(_components.p,{children:[`Serve the model from this provider only. `,_jsx(_components.a,{href:`/api/gateway/models`,children:_jsx(_components.code,{children:`GET /v1/models`})}),` lists the providers of each model. A list is tried in order. Omit to try every provider serving the model (see `,_jsx(_components.a,{href:`/concepts/fallback-and-model-health`,children:`fallback`}),`). Returns a 400 if passed with a routing strategy.`]})}),_jsx(ParamField,{body:`region`,type:`string | list[string]`,id:`param-region`,children:_jsxs(_components.p,{children:[`Serve the model from this region only: `,_jsx(_components.code,{children:`GLOBAL`}),`, `,_jsx(_components.code,{children:`US`}),`, `,_jsx(_components.code,{children:`EU`}),`, or a provider’s own region (e.g. `,_jsx(_components.code,{children:`eu-west-1`}),` on Bedrock). `,_jsx(_components.a,{href:`/api/gateway/models`,children:_jsx(_components.code,{children:`GET /v1/models`})}),` lists the regions of each model. A list is tried in order. Omit to try every region serving the model: `,_jsx(_components.code,{children:`GLOBAL`}),`, then `,_jsx(_components.code,{children:`US`}),`, then `,_jsx(_components.code,{children:`EU`}),`. Returns a 400 if passed with a routing strategy.`]})}),_jsx(ParamField,{body:`self_heal`,type:`\"on_with_warnings\" | \"on\" | \"off\"`,default:`on_with_warnings`,id:`param-self-heal`,children:_jsxs(_components.p,{children:[`What to do with a parameter the model does not take (`,_jsx(_components.a,{href:`/concepts/self-heal`,children:`Self-heal`}),`): `,_jsx(_components.code,{children:`on_with_warnings`}),` removes or replaces it and lists the change in `,_jsx(_components.code,{children:`weflayr_warnings`}),`, `,_jsx(_components.code,{children:`on`}),` does the same without the list, `,_jsx(_components.code,{children:`off`}),` sends the request unchanged. With a routing strategy, the default is `,_jsx(_components.code,{children:`on`}),` when the strategy has self-healing on, `,_jsx(_components.code,{children:`off`}),` otherwise.`]})}),_jsx(ParamField,{body:`drop_inputs_if_unsupported`,type:`list[string]`,id:`param-drop-inputs-if-unsupported`,children:_jsxs(_components.p,{children:[`Only needed with `,_jsx(_components.code,{children:`self_heal: \"off\"`}),`, or for `,_jsx(_components.code,{children:`service_tier`}),`. With `,_jsx(_components.code,{children:`\"off\"`}),`, these parameters are removed when the model does not take them instead of returning a 400: any of `,_jsx(_components.code,{children:`temperature`}),`, `,_jsx(_components.code,{children:`top_p`}),`, `,_jsx(_components.code,{children:`top_k`}),`, `,_jsx(_components.code,{children:`logprobs`}),` (with `,_jsx(_components.code,{children:`top_logprobs`}),`), `,_jsx(_components.code,{children:`n`}),`, `,_jsx(_components.code,{children:`stop`}),`, `,_jsx(_components.code,{children:`penalties`}),` (`,_jsx(_components.code,{children:`presence_penalty`}),` and `,_jsx(_components.code,{children:`frequency_penalty`}),`), `,_jsx(_components.code,{children:`seed`}),`, `,_jsx(_components.code,{children:`tool_choice`}),`, `,_jsx(_components.code,{children:`reasoning`}),`, `,_jsx(_components.code,{children:`cache_breakpoints`}),`, `,_jsx(_components.code,{children:`parallel_tool_calls`}),`, `,_jsx(_components.code,{children:`prompt_cache_settings`}),` (`,_jsx(_components.code,{children:`prompt_cache_retention`}),` and `,_jsx(_components.code,{children:`prompt_cache_options`}),`). `,_jsx(_components.code,{children:`service_tier`}),` is never removed by `,_jsx(_components.code,{children:`self_heal`}),`: list it here, whatever `,_jsx(_components.code,{children:`self_heal`}),` says, to have it removed when no provider of the model offers the tier (this changes the price of the call).`]})}),_jsxs(ParamField,{body:`fallback_on_other_deployment_condition`,type:`\"default\" | \"unavailable\" | \"unhealthy\"`,id:`param-fallback-on-other-deployment-condition`,children:[_jsxs(_components.p,{children:[`Which deployments (a model served by one provider in one region) are moved later in the list of deployments to try. A deployment is unavailable when it did not respond in the past 60 minutes, and unhealthy when more than 25% of its calls failed in the past 60 minutes (see `,_jsx(_components.a,{href:`/concepts/fallback-and-model-health`,children:`model fallback`}),`). Whatever the value, an unavailable deployment is tried last.`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`default`}),`: an unhealthy deployment is tried after the other deployments of the same model.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`unavailable`}),`: an unhealthy deployment keeps its place.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`unhealthy`}),`: an unhealthy deployment is tried last, with the unavailable ones.`]}),`\n`]}),_jsxs(_components.p,{children:[`The gateway uses `,_jsx(_components.code,{children:`default`}),` by default. A call through a `,_jsx(_components.a,{href:`/product/routing-strategies#what-your-call-sends-wins`,children:`routing strategy`}),` uses the strategy’s `,_jsx(_components.strong,{children:`Skip unavailable or unhealthy models`}),` setting instead, unless this field is set.`]})]}),_jsx(ParamField,{body:`retry_on_error`,type:`object`,id:`param-retry-on-error`,children:_jsxs(_components.p,{children:[`How many times the first deployment is called again after a timeout, a network failure or a provider server error, before the call falls back: `,_jsx(_components.code,{children:`{\"enabled\": false}`}),` falls back at once, `,_jsx(_components.code,{children:`{\"enabled\": true, \"attempts\": 3}`}),` calls it up to 3 more times (`,_jsx(_components.code,{children:`attempts`}),` from 1 to 10). By default, the gateway does not call it again and falls back at once. A call through a `,_jsx(_components.a,{href:`/product/routing-strategies#what-your-call-sends-wins`,children:`routing strategy`}),` uses the strategy’s `,_jsx(_components.strong,{children:`Retry on error`}),` setting instead, unless this field is set.`]})}),_jsx(ParamField,{body:`provider_options`,type:`object`,id:`param-provider-options`,children:_jsxs(_components.p,{children:[`Raw provider fields merged into the request sent to the provider, keyed by `,_jsx(_components.code,{children:`common`}),` (every provider), an API family (e.g. `,_jsx(_components.code,{children:`anthropic_messages`}),`, `,_jsx(_components.code,{children:`gemini_generate_content`}),`) or a provider (e.g. `,_jsx(_components.code,{children:`openai`}),`).`]})}),_jsxs(ParamField,{body:`weflayr`,type:`object`,id:`param-weflayr`,children:[_jsxs(_components.p,{children:[`Weflayr’s own fields, never sent to the provider. They name who the call is for and what it does, so Weflayr can split your costs and revenue on the dashboards, find the calls a `,_jsx(_components.a,{href:`/product/model-benchmarks`,children:`benchmark`}),` replays, and apply a `,_jsx(_components.a,{href:`/product/routing-strategies`,children:`routing strategy`}),`’s customer overrides.`]}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`customer_name`,type:`string`,id:`param-customer-name`,children:_jsxs(_components.p,{children:[`The customer the call is made for. It joins your AI cost to your `,_jsx(_components.a,{href:`/product/cost-and-revenue`,children:`revenue`}),`, and selects the customer `,_jsx(_components.a,{href:`/product/routing-strategies`,children:`overrides`}),` of a routing strategy. Defaults to the OpenAI `,_jsx(_components.code,{children:`user`}),` field.`]})}),_jsx(ParamField,{body:`call_name`,type:`string`,id:`param-call-name`,children:_jsxs(_components.p,{children:[`The name of this LLM call inside its feature, e.g. `,_jsx(_components.code,{children:`summarize_ticket`}),`. A `,_jsx(_components.a,{href:`/product/model-benchmarks`,children:`benchmark`}),` is set up per call name.`]})}),_jsx(ParamField,{body:`tags`,type:`{string: string}`,id:`param-tags`,children:_jsxs(_components.p,{children:[`Your own dimensions to filter on, e.g. `,_jsx(_components.code,{children:`{\"environment\": \"production\"}`}),`. At most 64, with keys of 1 to 128 bytes and values of at most 1,024 bytes.`]})}),_jsx(ParamField,{body:`store_message_content`,type:`boolean`,default:`true`,id:`param-store-message-content`,children:_jsxs(_components.p,{children:[`Keep the prompt and the answer. Set `,_jsx(_components.code,{children:`false`}),` to keep only tokens, cost and latency. Benchmarks need the content.`]})})]})]}),_jsx(ParamField,{header:`x-weflayr-metadata`,type:`JSON object`,id:`param-x-weflayr-metadata`,children:_jsxs(_components.p,{children:[`The feature the call belongs to, as `,_jsx(_components.code,{children:`{\"feature_name\": \"support-chat\"}`}),`. It also takes `,_jsx(_components.code,{children:`feature_run_uuid`}),` (any string, to group the calls of one feature run), `,_jsx(_components.code,{children:`customer_name`}),` and `,_jsx(_components.code,{children:`tags`}),`; the body’s `,_jsx(_components.code,{children:`weflayr`}),` values win over the header’s. Each value is at most 1024 bytes, longer is a 400, and a header that is not a JSON object is a 400 `,_jsx(_components.code,{children:`invalid_metadata_header`}),`. The `,_jsx(_components.a,{href:`/sdks/gateway-metadata`,children:`SDKs`}),` set this header for you.`]})})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`cache-breakpoints`,children:`Cache breakpoints`}),`\n`,_jsxs(_components.p,{children:[`Mark cache breakpoints with OpenAI’s `,_jsx(_components.code,{children:`prompt_cache_breakpoint`}),` (with an optional `,_jsx(_components.code,{children:`ttl`}),`): it works on every provider, for every model that takes cache breakpoints, such as Claude, GPT-5.6 and later, Kimi, Qwen, GLM and Nova. Anthropic’s `,_jsx(_components.code,{children:`cache_control`}),` is accepted too. With self-heal on, the gateway removes the breakpoints on a model where they write no cache, and replaces a `,_jsx(_components.code,{children:`ttl`}),` the provider does not offer with the closest one it does: `,_jsx(_components.code,{children:`5m`}),` or `,_jsx(_components.code,{children:`1h`}),` on Claude, `,_jsx(_components.code,{children:`30m`}),` or `,_jsx(_components.code,{children:`12h`}),` on OpenAI and Azure.`]}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`An OpenAI Chat Completion object. When the gateway changed the request or a routing strategy setting, or moved the request to another deployment, the response also has `,_jsx(_components.code,{children:`weflayr_warnings`}),`, the list of changes.`]}),`\n`,_jsxs(_components.p,{children:[`With `,_jsx(_components.code,{children:`\"stream\": true`}),`, the gateway answers with OpenAI’s server-sent events, ending with `,_jsx(_components.code,{children:`data: [DONE]`}),`. Warnings then come first, in a chunk with no choice.`]}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/api/gateway/errors`,children:`Errors`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Chat completions","api":"POST https://gateway.weflayr.com/v1/chat/completions","description":"Call any model of any provider with the OpenAI Chat Completions format.","href":"/api/gateway/chat-completions"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,ParamField,RequestExample,ResponseExample,Tab,Tabs}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The body is an `,_jsx(_components.a,{href:`https://platform.openai.com/docs/api-reference/chat/create`,children:`OpenAI Chat Completions request`}),`, whatever the provider: the gateway translates it for Anthropic, Google, Bedrock, Mistral and the others, and answers in OpenAI’s format. Point any OpenAI client at `,_jsx(_components.code,{children:`https://gateway.weflayr.com/v1`}),` with an `,_jsx(_components.a,{href:`/product/api-keys`,children:`API key with the Gateway scope`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request body`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`OpenAI fields`,id:`openai-fields`,children:[_jsx(ParamField,{body:`model`,type:`string`,placeholder:`gpt-6-luna`,required:true,id:`param-model`,children:_jsxs(_components.p,{children:[`A model name (e.g. `,_jsx(_components.code,{children:`claude-opus-5-5`}),`, `,_jsx(_components.code,{children:`gpt-6-luna`}),`), as `,_jsx(_components.a,{href:`/api/gateway/models`,children:_jsx(_components.code,{children:`GET /v1/models`})}),` lists them, or a `,_jsx(_components.a,{href:`/product/routing-strategies`,children:`routing strategy`}),` slug: `,_jsx(_components.code,{children:`strategy/\u003cslug>`}),` for its latest version (`,_jsx(_components.code,{children:`strategy/\u003cslug>:latest`}),` is the same), `,_jsx(_components.code,{children:`strategy/\u003cslug>:\u003cversion>`}),` to pin one. Any other text after the `,_jsx(_components.code,{children:`:`}),` returns a 400 `,_jsx(_components.code,{children:`invalid_routing_strategy_version`}),`. Do not prefix the name with the provider (`,_jsx(_components.code,{children:`openai/gpt-6-luna`}),` is not found): set `,_jsx(_components.code,{children:`provider`}),` instead. A list of model names is tried in order (see `,_jsx(_components.a,{href:`/concepts/fallback-and-model-health`,children:`fallback`}),`); a routing strategy cannot be in a list.`]})}),_jsxs(ParamField,{body:`messages`,type:`object[]`,required:true,id:`param-messages`,children:[_jsxs(_components.p,{children:[`The conversation, as the `,_jsx(_components.a,{href:`https://platform.openai.com/docs/api-reference/chat/create#chat-create-messages`,children:`OpenAI Chat Completions API`}),` writes it. A content part can mark a cache breakpoint with Anthropic’s `,_jsx(_components.code,{children:`cache_control`}),` or OpenAI’s `,_jsx(_components.code,{children:`prompt_cache_breakpoint`}),`, whatever the model: the gateway writes it the way the provider reads it.`]}),_jsxs(Expandable,{title:`message`,children:[_jsx(ParamField,{body:`role`,type:`string`,placeholder:`user`,required:true,id:`param-role`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`system`}),`, `,_jsx(_components.code,{children:`developer`}),`, `,_jsx(_components.code,{children:`user`}),`, `,_jsx(_components.code,{children:`assistant`}),` or `,_jsx(_components.code,{children:`tool`}),`.`]})}),_jsx(ParamField,{body:`content`,type:`string`,placeholder:`Hello`,required:true,id:`param-content`,children:_jsx(_components.p,{children:`The message’s text, or a list of content parts.`})})]})]}),_jsx(ParamField,{body:`max_completion_tokens`,type:`integer`,id:`param-max-completion-tokens`,children:_jsxs(_components.p,{children:[`The most tokens the answer can have, reasoning tokens included. The deprecated `,_jsx(_components.code,{children:`max_tokens`}),` is read too; send one or the other.`]})}),_jsx(ParamField,{body:`temperature`,type:`number`,id:`param-temperature`,children:_jsx(_components.p,{children:`The sampling temperature.`})}),_jsx(ParamField,{body:`top_p`,type:`number`,id:`param-top-p`,children:_jsx(_components.p,{children:`Nucleus sampling: the model samples among the tokens making up this share of the probability. Removed by self-heal on models that refuse it, such as Claude Opus 4.7 and later.`})}),_jsx(ParamField,{body:`top_k`,type:`integer`,id:`param-top-k`,children:_jsx(_components.p,{children:`The model samples among this many most likely tokens. Removed by self-heal on OpenAI, Azure and xAI, which have no such field.`})}),_jsx(ParamField,{body:`stop`,type:`string`,id:`param-stop`,children:_jsx(_components.p,{children:`Text, or a list of texts, that ends the answer when the model writes it. Removed by self-heal on OpenAI, Azure and xAI.`})}),_jsx(ParamField,{body:`presence_penalty`,type:`number`,id:`param-presence-penalty`,children:_jsxs(_components.p,{children:[`Lowers the odds of tokens already in the answer. Removed by self-heal on OpenAI, Azure, xAI, Anthropic and Bedrock, like `,_jsx(_components.code,{children:`frequency_penalty`}),`.`]})}),_jsx(ParamField,{body:`frequency_penalty`,type:`number`,id:`param-frequency-penalty`,children:_jsx(_components.p,{children:`Lowers the odds of tokens by how often they already appear in the answer.`})}),_jsx(ParamField,{body:`seed`,type:`integer`,id:`param-seed`,children:_jsx(_components.p,{children:`Makes sampling repeatable where the provider supports it. Removed by self-heal on OpenAI, Azure, xAI, Anthropic and Bedrock.`})}),_jsx(ParamField,{body:`n`,type:`integer`,default:`1`,id:`param-n`,children:_jsx(_components.p,{children:`The number of answers to write. Above 1, removed by self-heal on OpenAI, Azure, xAI, Anthropic and Bedrock.`})}),_jsx(ParamField,{body:`logprobs`,type:`boolean`,id:`param-logprobs`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` returns the log probability of each answer token. Removed by self-heal on Anthropic, Bedrock and xAI.`]})}),_jsx(ParamField,{body:`top_logprobs`,type:`integer`,id:`param-top-logprobs`,children:_jsxs(_components.p,{children:[`The number of most likely tokens to return at each position, with their log probabilities. Needs `,_jsx(_components.code,{children:`logprobs: true`}),`.`]})}),_jsx(ParamField,{body:`tools`,type:`object[]`,id:`param-tools`,children:_jsxs(_components.p,{children:[`The function tools the model may call (`,_jsx(_components.code,{children:`type: \"function\"`}),`, with its `,_jsx(_components.code,{children:`name`}),`, `,_jsx(_components.code,{children:`description`}),`, `,_jsx(_components.code,{children:`parameters`}),` and `,_jsx(_components.code,{children:`strict`}),`).`]})}),_jsx(ParamField,{body:`tool_choice`,type:`string`,id:`param-tool-choice`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`auto`}),`, `,_jsx(_components.code,{children:`required`}),` or `,_jsx(_components.code,{children:`none`}),`, or a function to call (`,_jsx(_components.code,{children:`{\"type\": \"function\", \"function\": {\"name\": \"...\"}}`}),`).`]})}),_jsx(ParamField,{body:`parallel_tool_calls`,type:`boolean`,id:`param-parallel-tool-calls`,children:_jsx(_components.p,{children:`Whether the model may call several tools in one turn.`})}),_jsx(ParamField,{body:`web_search_options`,type:`object`,id:`param-web-search-options`,children:_jsxs(_components.p,{children:[`Lets the model search the web (`,_jsx(_components.code,{children:`search_context_size`}),`, `,_jsx(_components.code,{children:`user_location`}),`), on the providers that run a web search.`]})}),_jsx(ParamField,{body:`response_format`,type:`object`,id:`param-response-format`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`{\"type\": \"text\"}`}),`, `,_jsx(_components.code,{children:`{\"type\": \"json_object\"}`}),`, or `,_jsx(_components.code,{children:`{\"type\": \"json_schema\", \"json_schema\": {\"name\": \"...\", \"schema\": {...}, \"strict\": true}}`}),` for a structured output.`]})}),_jsx(ParamField,{body:`reasoning_effort`,type:`string`,id:`param-reasoning-effort`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`none`}),`, `,_jsx(_components.code,{children:`minimal`}),`, `,_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`medium`}),`, `,_jsx(_components.code,{children:`high`}),`, `,_jsx(_components.code,{children:`xhigh`}),` or `,_jsx(_components.code,{children:`max`}),`. A level the model does not take is replaced with the closest one it does if `,_jsx(_components.a,{href:`/concepts/self-heal`,children:`self-heal`}),` is on. Send it or `,_jsx(_components.code,{children:`reasoning`}),`, not both. Through a routing strategy, it wins over the `,_jsx(_components.a,{href:`/product/routing-strategies#what-your-call-sends-wins`,children:`effort the strategy sets`}),`.`]})}),_jsxs(ParamField,{body:`reasoning`,type:`object`,id:`param-reasoning`,children:[_jsxs(_components.p,{children:[`How much the model thinks before it answers, with more control than `,_jsx(_components.code,{children:`reasoning_effort`}),`.`]}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`effort`,type:`string`,id:`param-effort`,children:_jsxs(_components.p,{children:[`The same levels as `,_jsx(_components.code,{children:`reasoning_effort`}),`.`]})}),_jsx(ParamField,{body:`max_tokens`,type:`integer`,id:`param-max-tokens`,children:_jsxs(_components.p,{children:[`A thinking budget in tokens, in place of `,_jsx(_components.code,{children:`effort`}),`.`]})}),_jsx(ParamField,{body:`enabled`,type:`boolean`,id:`param-enabled`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`false`}),` turns thinking off.`]})}),_jsx(ParamField,{body:`exclude`,type:`boolean`,id:`param-exclude`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` leaves the reasoning out of the answer.`]})})]})]}),_jsx(ParamField,{body:`service_tier`,type:`string`,id:`param-service-tier`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`auto`}),`, `,_jsx(_components.code,{children:`default`}),`, `,_jsx(_components.code,{children:`flex`}),` or `,_jsx(_components.code,{children:`priority`}),`. `,_jsx(_components.code,{children:`flex`}),` and `,_jsx(_components.code,{children:`priority`}),` keep only the providers that offer that tier.`]})}),_jsx(ParamField,{body:`user`,type:`string`,id:`param-user`,children:_jsx(_components.p,{children:`An id of your end user, passed to the provider.`})}),_jsx(ParamField,{body:`stream`,type:`boolean`,default:`false`,id:`param-stream`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` streams the answer as server-sent events (see `,_jsx(_components.a,{href:`#response`,children:`Response`}),`).`]})}),_jsx(ParamField,{body:`stream_options`,type:`object`,id:`param-stream-options`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`include_usage`}),`: `,_jsx(_components.code,{children:`true`}),` adds a last chunk with the token usage. `,_jsx(_components.code,{children:`include_obfuscation`}),`: `,_jsx(_components.code,{children:`false`}),` leaves out the padding OpenAI adds to each streamed chunk.`]})}),_jsx(ParamField,{body:`prompt_cache_key`,type:`string`,id:`param-prompt-cache-key`,children:_jsx(_components.p,{children:`A key grouping requests that share a prompt prefix, to improve prompt cache hits. Used by OpenAI, Azure, xAI, Mistral and the Bedrock models called through their Responses API (e.g. some of OpenAI’s or Kimi K3). Claude, Gemini and the other Bedrock models refuse it. Without one, the gateway sends these providers a key of its own per organization and model.`})}),_jsx(ParamField,{body:`prompt_cache_retention`,type:`string`,id:`param-prompt-cache-retention`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`in_memory`}),` or `,_jsx(_components.code,{children:`24h`}),`: how long OpenAI keeps the cached prompt prefix. Sent to OpenAI, Azure and Bedrock’s Responses API models; with self-heal on, removed for Claude, Gemini, the other Bedrock models and xAI, which have no such field. To set a lifetime on any model taking cache breakpoints, use the breakpoint’s `,_jsx(_components.code,{children:`ttl`}),`: self-heal moves it to the closest lifetime the provider offers.`]})}),_jsx(ParamField,{body:`prompt_cache_options`,type:`object`,id:`param-prompt-cache-options`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`{\"mode\": \"explicit\"}`}),` turns off GPT-5.6+‘s implicit cache, so only your breakpoints are cached. Sent and removed like `,_jsx(_components.code,{children:`prompt_cache_retention`}),`.`]})}),_jsx(ParamField,{body:`safety_identifier`,type:`string`,id:`param-safety-identifier`,children:_jsx(_components.p,{children:`A stable id of your end user, hashed, which the provider uses to detect abuse.`})}),_jsx(ParamField,{body:`max_tool_calls`,type:`integer`,id:`param-max-tool-calls`,children:_jsx(_components.p,{children:`The most built-in tool calls the model can make in one answer.`})}),_jsx(ParamField,{body:`truncation`,type:`string`,id:`param-truncation`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`auto`}),` drops the earliest messages when the prompt is longer than the model’s context, `,_jsx(_components.code,{children:`disabled`}),` (the default) refuses it.`]})})]}),_jsxs(Tab,{title:`Weflayr fields`,id:`weflayr-fields`,children:[_jsxs(_components.p,{children:[`The gateway reads these fields on top of the OpenAI ones and never sends them to the provider. With the OpenAI SDK, pass them in `,_jsx(_components.code,{children:`extra_body`}),` (Python) or as extra keys of the request object (Node.js).`]}),_jsx(ParamField,{body:`provider`,type:`string | list[string]`,id:`param-provider`,children:_jsxs(_components.p,{children:[`Serve the model from this provider only. `,_jsx(_components.a,{href:`/api/gateway/models`,children:_jsx(_components.code,{children:`GET /v1/models`})}),` lists the providers of each model. A list is tried in order. Omit to try every provider serving the model (see `,_jsx(_components.a,{href:`/concepts/fallback-and-model-health`,children:`fallback`}),`). Returns a 400 if passed with a routing strategy.`]})}),_jsx(ParamField,{body:`region`,type:`string | list[string]`,id:`param-region`,children:_jsxs(_components.p,{children:[`Serve the model from this region only: `,_jsx(_components.code,{children:`GLOBAL`}),`, `,_jsx(_components.code,{children:`US`}),`, `,_jsx(_components.code,{children:`EU`}),`, or a provider’s own region (e.g. `,_jsx(_components.code,{children:`eu-west-1`}),` on Bedrock). `,_jsx(_components.a,{href:`/api/gateway/models`,children:_jsx(_components.code,{children:`GET /v1/models`})}),` lists the regions of each model. A list is tried in order. Omit to try every region serving the model: `,_jsx(_components.code,{children:`GLOBAL`}),`, then `,_jsx(_components.code,{children:`US`}),`, then `,_jsx(_components.code,{children:`EU`}),`. Returns a 400 if passed with a routing strategy.`]})}),_jsx(ParamField,{body:`self_heal`,type:`\"on_with_warnings\" | \"on\" | \"off\"`,default:`on_with_warnings`,id:`param-self-heal`,children:_jsxs(_components.p,{children:[`What to do with a parameter the model does not take (`,_jsx(_components.a,{href:`/concepts/self-heal`,children:`Self-heal`}),`): `,_jsx(_components.code,{children:`on_with_warnings`}),` removes or replaces it and lists the change in `,_jsx(_components.code,{children:`weflayr_warnings`}),`, `,_jsx(_components.code,{children:`on`}),` does the same without the list, `,_jsx(_components.code,{children:`off`}),` sends the request unchanged. With a routing strategy, the default is `,_jsx(_components.code,{children:`on`}),` when the strategy has self-healing on, `,_jsx(_components.code,{children:`off`}),` otherwise.`]})}),_jsx(ParamField,{body:`drop_inputs_if_unsupported`,type:`list[string]`,id:`param-drop-inputs-if-unsupported`,children:_jsxs(_components.p,{children:[`Only needed with `,_jsx(_components.code,{children:`self_heal: \"off\"`}),`, or for `,_jsx(_components.code,{children:`service_tier`}),`. With `,_jsx(_components.code,{children:`\"off\"`}),`, these parameters are removed when the model does not take them instead of returning a 400: any of `,_jsx(_components.code,{children:`temperature`}),`, `,_jsx(_components.code,{children:`top_p`}),`, `,_jsx(_components.code,{children:`top_k`}),`, `,_jsx(_components.code,{children:`logprobs`}),` (with `,_jsx(_components.code,{children:`top_logprobs`}),`), `,_jsx(_components.code,{children:`n`}),`, `,_jsx(_components.code,{children:`stop`}),`, `,_jsx(_components.code,{children:`penalties`}),` (`,_jsx(_components.code,{children:`presence_penalty`}),` and `,_jsx(_components.code,{children:`frequency_penalty`}),`), `,_jsx(_components.code,{children:`seed`}),`, `,_jsx(_components.code,{children:`tool_choice`}),`, `,_jsx(_components.code,{children:`reasoning`}),`, `,_jsx(_components.code,{children:`cache_breakpoints`}),`, `,_jsx(_components.code,{children:`parallel_tool_calls`}),`, `,_jsx(_components.code,{children:`prompt_cache_settings`}),` (`,_jsx(_components.code,{children:`prompt_cache_retention`}),` and `,_jsx(_components.code,{children:`prompt_cache_options`}),`). `,_jsx(_components.code,{children:`service_tier`}),` is never removed by `,_jsx(_components.code,{children:`self_heal`}),`: list it here, whatever `,_jsx(_components.code,{children:`self_heal`}),` says, to have it removed when no provider of the model offers the tier (this changes the price of the call).`]})}),_jsxs(ParamField,{body:`fallback_on_other_deployment_condition`,type:`\"default\" | \"unavailable\" | \"unhealthy\"`,id:`param-fallback-on-other-deployment-condition`,children:[_jsxs(_components.p,{children:[`Which deployments (a model served by one provider in one region) are moved later in the list of deployments to try. A deployment is unavailable when it did not respond in the past 60 minutes, and unhealthy when more than 25% of its calls failed in the past 60 minutes (see `,_jsx(_components.a,{href:`/concepts/fallback-and-model-health`,children:`model fallback`}),`). Whatever the value, an unavailable deployment is tried last.`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`default`}),`: an unhealthy deployment is tried after the other deployments of the same model.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`unavailable`}),`: an unhealthy deployment keeps its place.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`unhealthy`}),`: an unhealthy deployment is tried last, with the unavailable ones.`]}),`\n`]}),_jsxs(_components.p,{children:[`The gateway uses `,_jsx(_components.code,{children:`default`}),` by default. A call through a `,_jsx(_components.a,{href:`/product/routing-strategies#what-your-call-sends-wins`,children:`routing strategy`}),` uses the strategy’s `,_jsx(_components.strong,{children:`Skip unavailable or unhealthy models`}),` setting instead, unless this field is set.`]})]}),_jsx(ParamField,{body:`retry_on_error`,type:`object`,id:`param-retry-on-error`,children:_jsxs(_components.p,{children:[`How many times the first deployment is called again after a timeout, a network failure or a provider server error, before the call falls back: `,_jsx(_components.code,{children:`{\"enabled\": false}`}),` falls back at once, `,_jsx(_components.code,{children:`{\"enabled\": true, \"attempts\": 3}`}),` calls it up to 3 more times (`,_jsx(_components.code,{children:`attempts`}),` from 1 to 10). By default, the gateway does not call it again and falls back at once. A call through a `,_jsx(_components.a,{href:`/product/routing-strategies#what-your-call-sends-wins`,children:`routing strategy`}),` uses the strategy’s `,_jsx(_components.strong,{children:`Retry on error`}),` setting instead, unless this field is set.`]})}),_jsx(ParamField,{body:`provider_options`,type:`object`,id:`param-provider-options`,children:_jsxs(_components.p,{children:[`Raw provider fields merged into the request sent to the provider, keyed by `,_jsx(_components.code,{children:`common`}),` (every provider), an API family (e.g. `,_jsx(_components.code,{children:`anthropic_messages`}),`, `,_jsx(_components.code,{children:`gemini_generate_content`}),`) or a provider (e.g. `,_jsx(_components.code,{children:`openai`}),`).`]})}),_jsxs(ParamField,{body:`weflayr`,type:`object`,id:`param-weflayr`,children:[_jsxs(_components.p,{children:[`Weflayr’s own fields, never sent to the provider. They name who the call is for and what it does, so Weflayr can split your costs and revenue on the dashboards, find the calls a `,_jsx(_components.a,{href:`/product/model-benchmarks`,children:`benchmark`}),` replays, and apply a `,_jsx(_components.a,{href:`/product/routing-strategies`,children:`routing strategy`}),`’s customer overrides.`]}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`customer_name`,type:`string`,id:`param-customer-name`,children:_jsxs(_components.p,{children:[`The customer the call is made for. It joins your AI cost to your `,_jsx(_components.a,{href:`/product/cost-and-revenue`,children:`revenue`}),`, and selects the customer `,_jsx(_components.a,{href:`/product/routing-strategies`,children:`overrides`}),` of a routing strategy. Defaults to the OpenAI `,_jsx(_components.code,{children:`user`}),` field.`]})}),_jsx(ParamField,{body:`call_name`,type:`string`,id:`param-call-name`,children:_jsxs(_components.p,{children:[`The name of this LLM call inside its feature, e.g. `,_jsx(_components.code,{children:`summarize_ticket`}),`. A `,_jsx(_components.a,{href:`/product/model-benchmarks`,children:`benchmark`}),` is set up per call name.`]})}),_jsx(ParamField,{body:`tags`,type:`{string: string}`,id:`param-tags`,children:_jsxs(_components.p,{children:[`Your own dimensions to filter on, e.g. `,_jsx(_components.code,{children:`{\"environment\": \"production\"}`}),`. At most 64, with keys of 1 to 128 bytes and values of at most 1,024 bytes.`]})}),_jsx(ParamField,{body:`store_message_content`,type:`boolean`,default:`true`,id:`param-store-message-content`,children:_jsxs(_components.p,{children:[`Keep the prompt and the answer. Set `,_jsx(_components.code,{children:`false`}),` to keep only tokens, cost and latency. Benchmarks need the content.`]})})]})]}),_jsx(ParamField,{header:`x-weflayr-metadata`,type:`JSON object`,id:`param-x-weflayr-metadata`,children:_jsxs(_components.p,{children:[`The feature the call belongs to, as `,_jsx(_components.code,{children:`{\"feature_name\": \"support-chat\"}`}),`. It also takes `,_jsx(_components.code,{children:`feature_run_uuid`}),` (any string, to group the calls of one feature run), `,_jsx(_components.code,{children:`customer_name`}),` and `,_jsx(_components.code,{children:`tags`}),`; the body’s `,_jsx(_components.code,{children:`weflayr`}),` values win over the header’s. Each value is at most 1024 bytes, longer is a 400, and a header that is not a JSON object is a 400 `,_jsx(_components.code,{children:`invalid_metadata_header`}),`. The `,_jsx(_components.a,{href:`/sdks/gateway-metadata`,children:`SDKs`}),` set this header for you.`]})})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`cache-breakpoints`,children:`Cache breakpoints`}),`\n`,_jsxs(_components.p,{children:[`Mark cache breakpoints with OpenAI’s `,_jsx(_components.code,{children:`prompt_cache_breakpoint`}),` (with an optional `,_jsx(_components.code,{children:`ttl`}),`): it works on every provider, for every model that takes cache breakpoints, such as Claude, GPT-5.6 and later, Kimi, Qwen, GLM and Nova. Anthropic’s `,_jsx(_components.code,{children:`cache_control`}),` is accepted too. With self-heal on, the gateway removes the breakpoints on a model where they write no cache, and replaces a `,_jsx(_components.code,{children:`ttl`}),` the provider does not offer with the closest one it does: `,_jsx(_components.code,{children:`5m`}),` or `,_jsx(_components.code,{children:`1h`}),` on Claude, `,_jsx(_components.code,{children:`30m`}),` or `,_jsx(_components.code,{children:`12h`}),` on OpenAI and Azure.`]}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`An OpenAI Chat Completion object. When the gateway changed the request or a routing strategy setting, or moved the request to another deployment, the response also has `,_jsx(_components.code,{children:`weflayr_warnings`}),`, the list of changes.`]}),`\n`,_jsxs(_components.p,{children:[`With `,_jsx(_components.code,{children:`\"stream\": true`}),`, the gateway answers with OpenAI’s server-sent events, ending with `,_jsx(_components.code,{children:`data: [DONE]`}),`. Warnings then come first, in a chunk with no choice.`]}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/api/gateway/errors`,children:`Errors`}),`.`]}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`Python`,numberOfLines:`11`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://gateway.weflayr.com/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cWEFLAYR_API_KEY>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`completion `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.chat.completions.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"claude-opus-5-5\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` messages`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` max_completion_tokens`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`256`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` extra_headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"x-weflayr-metadata\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{\"feature_name\": \"support-chat\"}'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` extra_body`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"weflayr\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"customer_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"acme\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"call_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"answer_question\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Node.js`,numberOfLines:`13`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` require`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'openai'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`baseURL:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://gateway.weflayr.com/v1'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apiKey:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '\u003cWEFLAYR_API_KEY>'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` completion`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chat`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'claude-opus-5-5'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` messages:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [{ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Hello'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` max_completion_tokens:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 256`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` weflayr:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`customer_name:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'acme'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`call_name:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'answer_question'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'x-weflayr-metadata'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`feature_name:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'support-chat'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }) } },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`10`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://gateway.weflayr.com/v1/chat/completions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$WEFLAYR_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-weflayr-metadata: {\"feature_name\": \"support-chat\"}'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"claude-opus-5-5\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"max_completion_tokens\": 256,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"weflayr\": {\"customer_name\": \"acme\", \"call_name\": \"answer_question\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})})]}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`200`,numberOfLines:`14`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`14`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chatcmpl-8f3c2a1e9b7d4c6a\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chat.completion\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"created\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1792051200`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"claude-opus-5-5\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"choices\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"index\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello! How can I help you today?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"finish_reason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stop\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"usage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"prompt_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"completion_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`12`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"total_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`20`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Chat completions","api":"POST https://gateway.weflayr.com/v1/chat/completions","description":"Call any model of any provider with the OpenAI Chat Completions format.","href":"/api/gateway/chat-completions"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Request body","slug":"request-body","depth":2,"children":[]},{"title":"Cache breakpoints","slug":"cache-breakpoints","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Errors","slug":"errors","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"Python","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"python\">\u003ccode language=\"python\" numberOfLines=\"11\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">from\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> openai \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">import\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> OpenAI\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">client \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> OpenAI(\u003c/span>\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\">base_url\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://gateway.weflayr.com/v1\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\">api_key\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u0026#x3C;WEFLAYR_API_KEY>\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">completion \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> client.chat.completions.create(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> model\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"claude-opus-5-5\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> messages\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">[{\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"role\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"user\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"content\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Hello\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> max_completion_tokens\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">256\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> extra_headers\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"x-weflayr-metadata\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'{\"feature_name\": \"support-chat\"}'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">},\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> extra_body\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"weflayr\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"customer_name\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"acme\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"call_name\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"answer_question\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}},\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Node.js","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"javascript\">\u003ccode language=\"javascript\" numberOfLines=\"13\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> OpenAI\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> require\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'openai'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> client\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\"> new\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> OpenAI\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">({ \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">baseURL:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'https://gateway.weflayr.com/v1'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">apiKey:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '\u0026#x3C;WEFLAYR_API_KEY>'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> });\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> completion\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> client\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">chat\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">completions\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">create\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> model:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'claude-opus-5-5'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> messages:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> [{ \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">role:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'user'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">content:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Hello'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> max_completion_tokens:\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\"> 256\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> weflayr:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">customer_name:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'acme'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">call_name:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'answer_question'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">headers:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'x-weflayr-metadata'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> JSON\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">stringify\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">({ \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">feature_name:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'support-chat'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }) } },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"10\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://gateway.weflayr.com/v1/chat/completions\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization: Bearer \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">$WEFLAYR_API_KEY\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type: application/json\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'x-weflayr-metadata: {\"feature_name\": \"support-chat\"}'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -d\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"model\": \"claude-opus-5-5\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"max_completion_tokens\": 256,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"weflayr\": {\"customer_name\": \"acme\", \"call_name\": \"answer_question\"}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"200","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"14\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"chatcmpl-8f3c2a1e9b7d4c6a\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"object\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"chat.completion\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"created\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">1792051200\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"model\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"claude-opus-5-5\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"choices\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"index\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"message\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\">\"role\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"assistant\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\">\"content\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Hello! How can I help you today?\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">},\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"finish_reason\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"stop\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"usage\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\">\"prompt_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">8\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\">\"completion_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">12\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\">\"total_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">20\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Chat completions","path":"/v1/chat/completions","servers":[{"url":"https://gateway.weflayr.com"}],"method":"post","request":{"security":[{"title":"Bearer Auth","parameters":{"header":{"Authorization":{"type":"http","scheme":"bearer","description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token."}},"query":{},"cookie":{}}}],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{}},"response":{},"deprecated":false}},"jsLinks":[],"subdomain":"weflayr","siteName":"Weflayr Docs","title":"Chat completions - Weflayr Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-10T06:25:25.050Z","originalFileLocation":"api/gateway/chat-completions.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Call any model of any provider with the OpenAI Chat Completions format.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Weflayr Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/weflayr/WfwX99VEbh4c__vK/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/weflayr/WfwX99VEbh4c__vK/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/weflayr/WfwX99VEbh4c__vK/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/weflayr/WfwX99VEbh4c__vK/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/weflayr/WfwX99VEbh4c__vK/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/weflayr/WfwX99VEbh4c__vK/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/weflayr/WfwX99VEbh4c__vK/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/weflayr/WfwX99VEbh4c__vK/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/weflayr/WfwX99VEbh4c__vK/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Chat completions - Weflayr Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Call any model of any provider with the OpenAI Chat Completions format.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Weflayr Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.weflayr.com/api/gateway/chat-completions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://weflayr.mintlify.site/_mintlify/api/og/v2?division=Gateway\u0026amp;title=Chat+completions\u0026amp;description=Call+any+model+of+any+provider+with+the+OpenAI+Chat+Completions+format.\u0026amp;theme=4f4324149ad1615461e5eea4\u0026amp;signature=565c14e392cd34933151d3f70116ed8c339e88b5e6340252cb2f5e1fd8b34f13\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Chat completions - Weflayr Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Call any model of any provider with the OpenAI Chat Completions format.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://weflayr.mintlify.site/_mintlify/api/og/v2?division=Gateway\u0026amp;title=Chat+completions\u0026amp;description=Call+any+model+of+any+provider+with+the+OpenAI+Chat+Completions+format.\u0026amp;theme=4f4324149ad1615461e5eea4\u0026amp;signature=565c14e392cd34933151d3f70116ed8c339e88b5e6340252cb2f5e1fd8b34f13\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/weflayr/WfwX99VEbh4c__vK/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Weflayr Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2E1B11\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.weflayr.com/api/gateway/chat-completions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api/gateway/chat-completions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.weflayr.com/#organization\",\"name\":\"Weflayr Docs\",\"url\":\"https://docs.weflayr.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/weflayr/jf99vD0W4dsGuj5S/images/logo-light-mode.svg?fit=max\u0026auto=format\u0026n=jf99vD0W4dsGuj5S\u0026q=85\u0026s=946f2cb0880dbdf0a0fbeaef912f21cd\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.weflayr.com#website\",\"name\":\"Weflayr Docs\",\"url\":\"https://docs.weflayr.com\",\"publisher\":{\"@id\":\"https://docs.weflayr.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.weflayr.com/api/gateway/chat-completions#webpage\",\"url\":\"https://docs.weflayr.com/api/gateway/chat-completions\",\"name\":\"Chat completions\",\"description\":\"Call any model of any provider with the OpenAI Chat Completions format.\",\"dateModified\":\"2026-11-10T06:25:25.050Z\",\"isPartOf\":{\"@id\":\"https://docs.weflayr.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.weflayr.com/api/gateway/chat-completions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.weflayr.com/api/gateway/chat-completions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Gateway\",\"item\":\"https://docs.weflayr.com/api/gateway/responses\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Chat completions\",\"item\":\"https://docs.weflayr.com/api/gateway/chat-completions\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.weflayr.com/api/gateway/chat-completions#apireference\",\"headline\":\"Chat completions\",\"name\":\"Chat completions\",\"description\":\"Call any model of any provider with the OpenAI Chat Completions format.\",\"url\":\"https://docs.weflayr.com/api/gateway/chat-completions\",\"mainEntityOfPage\":{\"@id\":\"https://docs.weflayr.com/api/gateway/chat-completions#webpage\"},\"dateModified\":\"2026-11-10T06:25:25.050Z\",\"publisher\":{\"@id\":\"https://docs.weflayr.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.weflayr.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Weflayr Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Weflayr Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api/gateway/chat-completions.md","siteName":"Weflayr Docs","nav":{"global":{"anchors":[{"anchor":"For agents","icon":{"style":"regular","name":"robot"},"href":"https://docs.weflayr.com/for-agents"},{"anchor":"Talk to us","icon":{"style":"regular","name":"calendar"},"href":"https://calendly.com/noe-weflayr/30min"}]},"tabs":[{"tab":"Get started","pages":[{"title":"Get started","href":""}]},{"tab":"How it works","pages":[{"title":"How it works","href":"/concepts/benchmark-driven-routing"}]},{"tab":"SDKs","pages":[{"title":"SDKs","href":"/sdks/python"}]},{"tab":"API reference","groups":[{"group":"Get started","pages":[{"title":"API reference","sidebarTitle":"Introduction","icon":"https://mintlify.s3.us-west-1.amazonaws.com/weflayr/images/icons/book.svg","href":"/api/introduction"}]},{"group":"Gateway","pages":[{"title":"Responses","api":"POST https://gateway.weflayr.com/v1/responses","description":"Call any model of any provider with the OpenAI Responses format.","href":"/api/gateway/responses"},{"title":"Chat completions","api":"POST https://gateway.weflayr.com/v1/chat/completions","href":"/api/gateway/chat-completions"},{"title":"Embeddings","api":"POST https://gateway.weflayr.com/v1/embeddings","description":"Embed text with the embedding models of OpenAI, Azure, Mistral and Alibaba, with the OpenAI Embeddings format.","href":"/api/gateway/embeddings"},{"title":"Models","api":"GET https://gateway.weflayr.com/v1/models","href":"/api/gateway/models"},{"title":"Errors","icon":"https://mintlify.s3.us-west-1.amazonaws.com/weflayr/images/icons/alert-triangle.svg","href":"/api/gateway/errors"}]},{"group":"Management","pages":[{"group":"Dashboard data","icon":"/images/icons/chart-line.svg","pages":[{"title":"Get costs","api":"POST https://app.weflayr.com/api/costs/","href":"/api/management/get-costs"},{"title":"Get margin","api":"POST https://app.weflayr.com/api/margin/","href":"/api/management/get-margin"},{"title":"Get performance","api":"POST https://app.weflayr.com/api/performance/","href":"/api/management/get-performance"}]},{"group":"Revenue","icon":"/images/icons/currency-dollar.svg","pages":[{"title":"Set revenue","api":"POST https://app.weflayr.com/api/revenue/","href":"/api/management/set-revenue"},{"title":"Get revenue","api":"GET https://app.weflayr.com/api/revenue/","href":"/api/management/get-revenue"},{"title":"Delete revenue","api":"DELETE https://app.weflayr.com/api/revenue/","href":"/api/management/delete-revenue"}]},{"group":"Key metrics","icon":"/images/icons/target.svg","pages":[{"title":"Set key metrics","api":"POST https://app.weflayr.com/api/key-metrics/","href":"/api/management/set-key-metrics"},{"title":"Get key metrics","api":"GET https://app.weflayr.com/api/key-metrics/","href":"/api/management/get-key-metrics"},{"title":"Delete key metrics","api":"DELETE https://app.weflayr.com/api/key-metrics/","href":"/api/management/delete-key-metrics"}]},{"group":"Customer tags","icon":"/images/icons/tags.svg","pages":[{"title":"Set customer tags","api":"POST https://app.weflayr.com/api/customer-tags/","href":"/api/management/set-customer-tags"},{"title":"Get customer tags","api":"GET https://app.weflayr.com/api/customer-tags/","href":"/api/management/get-customer-tags"},{"title":"Delete customer tags","api":"DELETE https://app.weflayr.com/api/customer-tags/","href":"/api/management/delete-customer-tags"}]},{"group":"Calls","icon":"/images/icons/list.svg","pages":[{"title":"Get calls","api":"GET https://app.weflayr.com/api/calls/","href":"/api/management/get-calls"}]},{"group":"Evaluators","icon":"/images/icons/flask.svg","pages":[{"title":"Get evaluators","api":"GET https://app.weflayr.com/api/evaluators/","href":"/api/management/get-evaluators"},{"title":"Get evaluator","api":"GET https://app.weflayr.com/api/evaluator/","href":"/api/management/get-evaluator"},{"title":"Set evaluator","api":"POST https://app.weflayr.com/api/evaluators/","href":"/api/management/set-evaluator"},{"title":"Delete evaluator","api":"DELETE https://app.weflayr.com/api/evaluators/","href":"/api/management/delete-evaluator"},{"title":"Generate evaluators","api":"POST https://app.weflayr.com/api/evaluator-generation/","href":"/api/management/generate-evaluators"},{"title":"Test evaluator","api":"POST https://app.weflayr.com/api/evaluator-test/","href":"/api/management/test-evaluator"}]},{"group":"Benchmarks","icon":"/images/icons/chart-bar.svg","pages":[{"title":"Get benchmark candidates","api":"POST https://app.weflayr.com/api/benchmark-candidates/","href":"/api/management/get-benchmark-candidates"},{"title":"Get benchmarks","api":"GET https://app.weflayr.com/api/benchmarks/","href":"/api/management/get-benchmarks"},{"title":"Get benchmark","api":"GET https://app.weflayr.com/api/benchmark/","href":"/api/management/get-benchmark"},{"title":"Set benchmark","api":"POST https://app.weflayr.com/api/benchmarks/","href":"/api/management/set-benchmark"},{"title":"Delete benchmark","api":"DELETE https://app.weflayr.com/api/benchmarks/","href":"/api/management/delete-benchmark"},{"title":"Get benchmark examples","api":"GET https://app.weflayr.com/api/benchmark-examples/","href":"/api/management/get-benchmark-examples"},{"title":"Start or resume benchmark","api":"POST https://app.weflayr.com/api/benchmark-start/","href":"/api/management/start-or-resume-benchmark"},{"title":"Stop benchmark","api":"POST https://app.weflayr.com/api/benchmark-stop/","href":"/api/management/stop-benchmark"},{"title":"Import past data","api":"POST https://app.weflayr.com/api/past-data-imports/","href":"/api/management/import-past-data"}]},{"group":"Routing strategies","icon":"/images/icons/route.svg","pages":[{"title":"Get routing strategies","api":"GET https://app.weflayr.com/api/routing-strategies/","href":"/api/management/get-routing-strategies"},{"title":"Get routing strategy","api":"GET https://app.weflayr.com/api/routing-strategy/","href":"/api/management/get-routing-strategy"},{"title":"Set routing strategy","api":"POST https://app.weflayr.com/api/routing-strategies/","href":"/api/management/set-routing-strategy"},{"title":"Archive routing strategy","api":"POST https://app.weflayr.com/api/routing-strategy-archive/","href":"/api/management/archive-routing-strategy"},{"title":"Restore routing strategy","api":"POST https://app.weflayr.com/api/routing-strategy-restore/","href":"/api/management/restore-routing-strategy"},{"title":"Get routing strategy results","api":"GET https://app.weflayr.com/api/routing-strategy-results/","href":"/api/management/get-routing-strategy-results"}]},{"group":"Project","icon":"/images/icons/folder.svg","pages":[{"title":"Get project","api":"GET https://app.weflayr.com/api/project/","href":"/api/management/get-project"},{"title":"Get API key info","api":"GET https://app.weflayr.com/api/api-key/","href":"/api/management/get-api-key-info"},{"title":"Get tags","api":"GET https://app.weflayr.com/api/tags/","href":"/api/management/get-tags"},{"title":"Get models","api":"GET https://app.weflayr.com/api/models/","href":"/api/management/get-models"},{"title":"Get providers","api":"GET https://app.weflayr.com/api/providers/","href":"/api/management/get-providers"},{"title":"Get customers","api":"GET https://app.weflayr.com/api/customers/","href":"/api/management/get-customers"},{"title":"Get features","api":"GET https://app.weflayr.com/api/features/","href":"/api/management/get-features"}]},{"title":"MCP server","href":"/api/management/mcp-server"},{"title":"Errors","icon":"https://mintlify.s3.us-west-1.amazonaws.com/weflayr/images/icons/alert-triangle.svg","href":"/api/management/errors"}]}]},{"tab":"Platform","pages":[{"title":"Platform","href":"/product/model-benchmarks"}]}]},"basePath":"","title":"Chat completions - Weflayr Docs","buildId":"dpl_596ePT575z4qnAFksq1biRW97aLY","deploymentId":"dpl_596ePT575z4qnAFksq1biRW97aLY","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-C9Wu0MeN.js","utils-jWgu-6Qf.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DBD8f9qn.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-BGuX1ui5.js","snippetPresets-Evy63nQB.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BQHO1lnV.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-B6C8m-t_.js","shallow-BG4cT0fH.js","getApiPlaygroundDisplay-CgEPrE-D.js","CodeSnippet-CU8JyZ9N.js","CodeSnippets-BnxHU32T.js","Page-D6S0Yh6q.js","getPastedJson-CwiYOonh.js","icon-DYDpWmDf.js","MethodPill-C-J-l7_c.js","DuplicateIcon-B6ARwg9w.js","createIcon-Dsv4MtDq.js","DynamicMarkdown-CtasenyM.js","SectionHeading-YNcgYwjB.js","axios-vUo_bRtp.js"]}