Connect any HTTP service to the AI Gateway for centralized authentication, access control, and tracing.
Custom Endpoints let you register arbitrary HTTP services in the AI Gateway and route traffic through them. Unlike integrations that target a specific provider API (OpenAI, Anthropic, and so on), Custom Endpoints accept any HTTP upstream—internal REST APIs, Azure Speech Services, bespoke ML services, or third-party endpoints—while keeping a single entry point for your applications.Use Custom Endpoints when you want one TrueFoundry API key for callers, per-endpoint access control, and full tracing without distributing upstream credentials to every client. The AI Gateway acts as a transparent proxy: it forwards the HTTP method, path, query string, headers, and body to your upstream base URL without translating payloads.Upstream credentials and extra headers are configured once on the model account or integration; the AI Gateway injects them on every upstream request automatically.Multiple endpoints under the same account can also be pooled behind a single aggregated endpoint with weight or priority routing — useful for increasing aggregate concurrency past one backend’s limits, or for primary/backup failover. See Load balancing across endpoints.
Example integrations
Several providers that aren’t first-class integrations in the AI Gateway are connected through Custom Endpoints. Use these ready-made guides as references when wiring up your own upstream:
CoreWeave (W&B Inference)
Proxy CoreWeave models served via W&B Inference’s OpenAI-compatible API.
PipeShift
Route to PipeShift’s OpenAI-compatible chat completions API.
SiliconFlow
Route to SiliconFlow’s OpenAI-compatible chat completions API.
io.net
Call io.net Intelligence open-source models through the AI Gateway.
Resemble AI
Proxy Resemble AI text-to-speech synthesis requests.
Route to SCX.ai’s OpenAI-compatible chat completions API.
Setup
AI Gateway — Models — open the Custom Endpoints tab
1
Create a Custom Endpoint model account
From the TrueFoundry dashboard, go to AI Gateway → Models, open the Custom Endpoints tab, and click Add Custom Endpoint.In the wizard, complete Configure Account: Name (required), optional Endpoint Type (None, Azure Speech Service, or Other), and optional Header Auth at the account level so integrations can inherit the same default upstream authentication. Use Continue to Endpoints when ready.To turn the account into a load-balanced pool, expand Advanced and set Routing Type to Weight or Priority, then enter a Slug. The slug becomes the second URL segment for the aggregated endpoint (/proxy-api/<account-name>/<slug>/<upstream-path>). Leave Routing Type as None for the standard per-endpoint flow. See Load balancing across endpoints.
On the Endpoints wizard step, add or edit an endpoint integration (Add Endpoint from the list view works the same flow).Set Display Name and Base URL (the upstream origin — must not end with a trailing slash; see configuration reference). Optionally enable Custom Headers, Header Auth (per-endpoint upstream credentials), or TLS Settings.If the account has Routing Type set, a Load Balancing Config group appears on each endpoint with Weight (weight mode) or Priority (priority mode), plus Fallback Status Codes and Fallback Candidate. See Per-endpoint load balancing fields.
Call the AI Gateway using the pattern below. Replace GATEWAY_BASE_URL, providerAccountName, and endpointName with your values, and append any path that should be joined to the integration Base URL.
Callers only need a TrueFoundry API key for the AI Gateway. Upstream authentication is applied by the AI Gateway from your model account and integration settings—you do not pass upstream secrets from client code.
Usage code snippet — Python example with proxy-api URL
The wizard also includes an Access Control step after Endpoints (who can use this model account), consistent with other AI Gateway providers — see Gateway access control.
The same manifest fields are available through the TrueFoundry CLI (tfy apply) if you configure model accounts without the dashboard.
Endpoint structure
Requests use this URL shape (query parameters are forwarded unchanged):
Name of your Custom Endpoint model account (lowercase letters, digits, hyphens; 3–32 characters)
endpointName
Integration Display Name used in the URL (letters, digits, -, _, .; no spaces; 2–62 characters; cannot start with a digit)
upstream-path
Path appended to the integration’s Base URL
query-params
Optional; passed through to the upstream as-is
Provider account and integration names must satisfy the patterns above when created. If your HTTP client requires encoding for certain characters in the path segment, URL-encode endpointName accordingly.
Authentication
Gateway authentication — Same as other AI Gateway routes: send Authorization: Bearer <TrueFoundry API key> (or your deployment’s documented gateway auth).Upstream authentication — Configure Header Auth (header name/value pairs used as upstream credentials) and optional Custom Headers on the model account and/or each integration. The AI Gateway adds these to the proxied request; callers never see upstream keys.
If an integration has no Header Auth, the AI Gateway uses the model account’s Header Auth when present. Setting Header Auth on an integration replaces the account default for that endpoint only.
Upstream services that expect Bearer or HTTP Basic credentials still use Header Auth: you store the exact header name and value the upstream expects (often Authorization). Examples:Bearer token
Header
Value
Authorization
Bearer <your-upstream-access-token>
Enter the same Header name and value in the integration’s Header Auth (or account-level Header Auth).To use a TrueFoundry secret at either level, store the complete header value (for example, Bearer <token>) in the secret and enter only its tfy-secret://tenant:group:KEY reference as the Header Auth value. References resolve automatically; Bearer tfy-secret://... does not resolve.Username and password (HTTP Basic)Basic authentication sends a single Authorization header whose value is Basic followed by the Base64 encoding of username:password (UTF-8), with no newline inside that string.
Build the string username:password (colon between user and password).
Base64-encode it (standard Base64, padding as needed).
Set Header Auth to Authorization = Basic <encoded-result>.
Example (compute once, paste the header value into the AI Gateway):
import base64user = "myuser"password = "mypass"token = base64.b64encode(f"{user}:{password}".encode("utf-8")).decode("ascii")# token is e.g. "bXl1c2VyOm15cGFzcw=="print(f'Authorization: Basic {token}')
Equivalent one-liners:
# macOS / Linux — prints the Base64 segment (prefix with `Basic ` for the full header value)printf '%s' 'myuser:mypass' | base64
Paste Authorization = Basic <output-from-above> into Header Auth in the UI.API key in a custom header (e.g. Azure Speech)
Header
Value
Ocp-Apim-Subscription-Key
<subscription-key>
Load balancing across endpoints
Pool multiple endpoints under the same model account behind a single aggregated URL to raise aggregate concurrency or to run a primary/backup topology. Typical uses include scaling out replicas of an internal API, fanning out across multiple regional deployments of the same HTTP service, or combining several Azure Speech subscriptions to lift the per-subscription request limit.
How it works
Set routing_type (weight or priority) and a slug on the model account, and add a loadbalancing_config to each endpoint integration.
Call the pool at {GATEWAY_BASE_URL}/proxy-api/{providerAccountName}/{slug}/{upstream-path}. The slug replaces the single endpointName segment.
Per-endpoint URLs continue to work alongside the slug URL — useful for testing one upstream in isolation.
For each request, the AI Gateway picks an endpoint, proxies the call, and on a response whose status is listed in fallback_status_codes (or on a network error) retries the next eligible endpoint. Repeated failures cool an endpoint down across requests automatically.
Access is checked at the model account level in aggregated mode — per-endpoint authorized_subjects lists are not consulted.
The dashboard’s “usage code snippet” helper is only generated for individual endpoints, not for the load-balanced slug endpoint. Build the request URL yourself using the template below — gateway authentication and upstream auth injection work exactly like the per-endpoint flow.Template: {GATEWAY_BASE_URL}/proxy-api/{providerAccountName}/{slug}/{upstream-path}
{slug} is the account’s Slug (not an endpoint’s Display Name).
{upstream-path} is appended to the chosen endpoint’s base_url, identical to the per-endpoint flow.
You can copy the snippet from any individual endpoint as a starting point and replace the endpoint name segment with the slug.
Configuration structure
The following YAML shows the complete shape of a load-balanced custom endpoint model account. The same fields are available in the dashboard form editor.
type: provider-account/custom-endpointname: my-endpoint-pool # URL segment 1; lowercase, 3-32 charsendpoint_type: other # optional: azure-speech-service | other (tracking only)routing_type: weight # weight | priority (omit for per-endpoint only)slug: pool # required when routing_type is set; URL segment 2auth_data: # optional account-level default upstream auth type: header headers: Authorization: "Bearer <UPSTREAM_TOKEN>"integrations: - type: integration/model/custom-endpoint name: endpoint-a # target id at runtime: my-endpoint-pool/endpoint-a base_url: https://a.internal.example.com/v1 # no trailing slash loadbalancing_config: weight: 60 # weight mode: 0-100; all weights must sum to 100 fallback_status_codes: ["429", "500", "502", "503"] fallback_candidate: true headers: X-Env: prod # auth_data and tls_settings can also be set per endpoint and override the account defaults - type: integration/model/custom-endpoint name: endpoint-b base_url: https://b.internal.example.com/v1 loadbalancing_config: weight: 40 fallback_candidate: true
Per-endpoint load balancing fields
Field
Type
Description
weight
int (0-100)
Traffic share, weight mode only. Weights across all endpoints must sum to 100.
priority
int (≥ 0)
Priority, priority mode only. Lower number = higher priority; 0 is highest.
fallback_status_codes
string[]
Upstream HTTP statuses that trigger a fallback to the next endpoint. Default: ["401", "403", "404", "408", "429", "500", "502", "503"].
fallback_candidate
bool
If false, the endpoint never receives fallback traffic from another endpoint — it is only used when picked as the primary. Default: true.
metadata_match
map[string]string
Optional. Restrict the endpoint to requests whose resolved metadata matches all key-value pairs. Endpoints without metadata_match always stay eligible.
Validation rules: setting routing_type requires slug and at least 2 endpoints. In weight mode, every endpoint needs a weight and the sum across endpoints must equal 100. In priority mode, every endpoint needs a priority. Without routing_type, slug and loadbalancing_config are ignored.
Weight-based routing
Distributes requests across endpoints in proportion to their weight. Best for spreading load across multiple equivalent backends to raise aggregate concurrency.
Example: pool multiple Azure Speech subscriptions for higher throughput
A single Azure Speech subscription has a fixed per-resource concurrency. Combining several subscriptions or regions behind one slug endpoint multiplies the headroom and lets the AI Gateway fail over on 429.
The pool is called at {GATEWAY_BASE_URL}/proxy-api/azure-speech-pool/tts/v1 — same SSML body and X-Microsoft-OutputFormat header as the single-endpoint example in Use cases, only the URL changes.
Priority-based routing
Routes every request to the highest-priority healthy endpoint (0 is highest) and falls back to the next on failure. Best for primary/backup topologies.
Every request goes to primary while it is healthy; when it returns a fallback status code or is in cooldown, the AI Gateway tries backup.
Metadata-based target filtering
You can constrain an endpoint to only receive traffic when request metadata matches specific key-value pairs using metadata_match under its loadbalancing_config. This works the same way as on virtual model targets.The AI Gateway evaluates resolved metadata (not just raw request headers). Metadata can come from:
Request metadata header — x-tfy-metadata (JSON object with string keys and values)
Virtual account tags — when using a virtual account, its tags are included in metadata
Default gateway metadata — configured at the AI Gateway level (commonly used in self-hosted setups)
SaaS gateway location metadata — tfy_gateway_region and tfy_gateway_zone are automatically added by the SaaS gateway based on which region handled the request
For each endpoint:
If metadata_match is not set (or empty), the endpoint always stays eligible.
If metadata_match is set, all configured pairs must match exactly (AND semantics).
Filtering happens before weight/priority ordering and cooldown are computed, so only matching endpoints participate in routing for that request.
only search-shared remains eligible because search-us does not match.
For routing by SaaS gateway region using tfy_gateway_region / tfy_gateway_zone, see the virtual model example — the same pattern applies, just put metadata_match under each integration’s loadbalancing_config.
If no endpoint matches the request metadata, the AI Gateway returns 404 with an error indicating that none of the configured endpoints matched metadata_match conditions. Always include at least one endpoint without metadata_match as a catch-all, or ensure your metadata rules cover all possible values.
Fallback and health
fallback_status_codes — Upstream statuses that cause the AI Gateway to stop on the current endpoint and try the next eligible one in the pool. Statuses outside this list propagate to the caller immediately. Default: ["401", "403", "404", "408", "429", "500", "502", "503"].
fallback_candidate — When false, the endpoint is excluded from receiving fallback traffic from other endpoints; it is only used when selected as its own primary by the routing strategy.
Network errors (timeouts, connection failures) always roll over to the next endpoint regardless of fallback_status_codes.
Automatic cooldown — Repeated failures (401, 403, 429, 5xx) within a short rolling window mark an endpoint unhealthy. Healthy endpoints are tried first; if every endpoint is in cooldown the AI Gateway still tries them as a last resort. Recovery is automatic once errors age out of the window.
Compared to Virtual Models, custom endpoints use the same weight/priority concepts and the same metadata_match routing, but in a different shape: routing is configured on the account with routing_type + slug, targets are implicit (every endpoint under the account), and each endpoint carries its own loadbalancing_config. There is no routing_config / load_balance_targets array, no latency-based routing, and no sticky_routing, sla_cutoff, retry attempts/delay, or override_params.
Use cases
import requests# Integration Base URL should be like https://<region>.tts.speech.microsoft.com/cognitiveservices (no trailing slash).# Append only the REST suffix — here `v1` for SSML — so the upstream becomes …/cognitiveservices/v1url = "{GATEWAY_BASE_URL}/proxy-api/{providerAccountName}/{endpointName}/v1"headers = { "Authorization": "Bearer your-truefoundry-api-key", "Content-Type": "application/ssml+xml", "X-Microsoft-OutputFormat": "audio-16khz-128kbitrate-mono-mp3",}ssml = """<speak version='1.0' xml:lang='en-US'> <voice xml:lang='en-US' xml:gender='Female' name='en-US-JennyNeural'> Hello from the AI Gateway. </voice></speak>"""response = requests.post(url, headers=headers, data=ssml.encode("utf-8"))response.raise_for_status()# Response body is binary audio from the upstream service.open("output.mp3", "wb").write(response.content)
Unique account identifier (lowercase letters, digits, hyphens; 3–32 characters); used in the AI Gateway URL as providerAccountName
Endpoint Type
Optional: azure-speech-service or other (used for tracking / defaults in the product)
Routing Type
Optional: weight or priority. Turns the account into a load-balanced pool. Leave unset for the standard per-endpoint flow. See Load balancing across endpoints
Slug
Required when Routing Type is set. Pattern: letters, digits, -, _, .; 2–62 characters; cannot start with a digit. Becomes the second URL segment for the aggregated endpoint (/proxy-api/<account>/<slug>/<upstream-path>)
Header Auth
Optional default upstream auth: header-based credentials (type: header plus a Headers map), applied when an integration has no Header Auth of its own
Identifies the endpoint in the UI and in the URL as endpointName (pattern: letters, digits, -, _, .; no spaces; cannot start with a digit)
Base URL
HTTPS (or HTTP) origin without a trailing slash; the AI Gateway appends upstream-path from the request
Custom Headers
Optional key/value headers merged into every upstream request (often under Advanced)
Header Auth
Optional upstream credentials as header key/value pairs; when set, replaces provider-account Header Auth for this integration
TLS Settings
Optional Reject Unauthorized toggle and optional Custom CA Certificates text for upstream TLS verification
Load Balancing Config
Required on every endpoint when the parent account has Routing Type set. See Per-endpoint load balancing fields for the sub-field reference
Access Control
Optional authorized_subjects for per-subject allow lists — commonly edited via API or manifest rather than the default UI. Not consulted when calling the account’s aggregated slug URL (access is checked at the provider-account level)
Tracing
All traffic through Custom Endpoints is traced with span type CustomEndpoint on the AI Gateway trace / root span. To browse requests in the dashboard, see Request Logging. For general tracing concepts (traces, spans, attributes), see the LLM tracing overview.Aggregated (load-balanced) requests carry extra attributes on the same span so you can see which pooled endpoint served each request and how often fallback occurred:
Attribute
Meaning
custom_proxy_routing_type
weight or priority
custom_proxy_slug
The account slug used in the request URL
custom_proxy_endpoint_name
The endpoint that actually served the request
custom_proxy_target_was_cooled_down
true if the request had to use an endpoint in cooldown (all targets unhealthy)
loadbalance_target_attempt_count
Number of endpoints attempted before success or final failure
loadbalance_first_target
First endpoint tried for this request
loadbalance_final_target
Endpoint that produced the final response
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"TrueFoundry Docs","description":"TrueFoundry documentation — enterprise-grade AI Gateway combining LLM, MCP, and Agent Gateways to connect, monitor, and govern agentic AI applications across providers from a unified control plane.","colors":{"primary":"#4f46e5","light":"#4f46e5","dark":"#4f46e5"},"logo":{"light":"https://mintcdn.com/truefoundry/e2uUimEwX30qkWxc/logo/light.svg?fit=max\u0026auto=format\u0026n=e2uUimEwX30qkWxc\u0026q=85\u0026s=6068d83664aeda0239bec2422657dd20","dark":"https://mintcdn.com/truefoundry/e2uUimEwX30qkWxc/logo/dark.svg?fit=max\u0026auto=format\u0026n=e2uUimEwX30qkWxc\u0026q=85\u0026s=c1cb26554a546d84500b40f7057bece8"},"favicon":"https://mintcdn.com/truefoundry/6bbtTt95c1iCcyph/favicon.svg?fit=max\u0026auto=format\u0026n=6bbtTt95c1iCcyph\u0026q=85\u0026s=f55bde34214b38034126d05b08ea16c7","appearance":{"default":"light"},"background":{"decoration":"grid"},"navbar":{"links":[{"href":"https://www.truefoundry.com/book-demo","label":"Book Demo"},{"href":"https://www.truefoundry.com/blog","label":"Blog"}],"primary":{"type":"button","label":"Sign Up","href":"https://www.truefoundry.com/register"}},"footer":{"socials":{"x":"https://twitter.com/truefoundry","linkedin":"https://in.linkedin.com/company/truefoundry"}},"seo":{"metatags":{"og:type":"website","og:site_name":"TrueFoundry Docs","og:image":"https://assets.production.truefoundry.com/logo.svg","og:description":"TrueFoundry offers an enterprise-grade AI Gateway combining LLM, MCP, and Agent Gateways—empowering businesses to connect, monitor, and govern agentic AI applications across providers from a unified control plane.","description":"TrueFoundry offers an enterprise-grade AI Gateway combining LLM, MCP, and Agent Gateways—empowering businesses to connect, monitor, and govern agentic AI applications across providers from a unified control plane."}},"icons":{"library":"fontawesome"},"styling":{"codeblocks":"dark","latex":true},"integrations":{"ga4":{"measurementId":"G-BSSG699JC1"}},"contextual":{"options":["copy","view","chatgpt","claude","mcp","cursor","vscode"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"truefoundry","hasAudioNarration":false,"actualSubdomain":"truefoundry","customDomains":["www.truefoundry.com"],"gitSource":{"type":"github","owner":"truefoundry","repo":"docs-mintlify","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b0c91d8da8a0476f24da09e","clientVersion":"0.0.4347","searchFilterCounts":[{"language":"default","tag":"AI Gateway","count":253},{"language":"default","tag":"API Reference","count":202},{"language":"default","tag":"Platform","count":198},{"language":"default","tag":"Integrations","count":138},{"language":"default","tag":"LLM Gateway","count":118},{"language":"default","tag":"AI Deployment","count":109},{"language":"default","tag":"Integrate Models","count":51},{"language":"default","tag":"Guardrails and Security","count":48},{"language":"default","tag":"Observability","count":47},{"language":"default","tag":"MCP Servers","count":44}]},"assistantConfig":{"enableAskAiButton":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@truefoundry.com","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"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":"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":"site-roles","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":"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":"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":"turbopuffer-dual-write","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":"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},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".line-highlight{background:rgb(var(--primary-light)/.7)!important}.tfy-cat-anchor{scroll-margin-top:6rem;margin-block:1.75rem}.line-highlight:before{background:rgb(var(--primary-light)/.7)!important}.line-highlight:after{background:rgb(var(--primary-light)/.7)!important}"}]}
{"page":{"pagePath":"docs/ai-gateway/custom-endpoints","slug":"/docs/ai-gateway/custom-endpoints","pageMetadata":{"title":"Custom Endpoints","sidebarTitle":"Custom Endpoints","description":"Connect any HTTP service to the AI Gateway for centralized authentication, access control, and tracing.","href":"/docs/ai-gateway/custom-endpoints"},"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: \"Connect any HTTP service to the AI Gateway for centralized authentication, access control, and tracing.\"\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`,h5:`h5`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Accordion,Card,CardGroup,CodeBlock,CodeGroup,Frame,Heading,Info,Mermaid,Note,OptimizedImage,Step,Steps,Table,Tip,Warning}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Mermaid)_missingMdxReference(`Mermaid`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Custom Endpoints`}),` let you register arbitrary HTTP services in the AI Gateway and route traffic through them. Unlike integrations that target a specific provider API (OpenAI, Anthropic, and so on), Custom Endpoints accept `,_jsx(_components.strong,{children:`any HTTP upstream`}),`—internal REST APIs, Azure Speech Services, bespoke ML services, or third-party endpoints—while keeping a single entry point for your applications.`]}),`\n`,_jsxs(_components.p,{children:[`Use Custom Endpoints when you want `,_jsx(_components.strong,{children:`one TrueFoundry API key`}),` for callers, `,_jsx(_components.strong,{children:`per-endpoint access control`}),`, and `,_jsx(_components.strong,{children:`full tracing`}),` without distributing upstream credentials to every client. The AI Gateway acts as a `,_jsx(_components.strong,{children:`transparent proxy`}),`: it forwards the HTTP method, path, query string, headers, and body to your upstream base URL without translating payloads.`]}),`\n`,_jsxs(_components.p,{children:[`Upstream credentials and extra headers are configured once on the model account or integration; the AI Gateway `,_jsx(_components.strong,{children:`injects`}),` them on every upstream request automatically.`]}),`\n`,_jsxs(_components.p,{children:[`Multiple endpoints under the same account can also be pooled behind a `,_jsx(_components.strong,{children:`single aggregated endpoint`}),` with weight or priority routing — useful for increasing aggregate concurrency past one backend’s limits, or for primary/backup failover. See `,_jsx(_components.a,{href:`#load-balancing-across-endpoints`,children:`Load balancing across endpoints`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`example-integrations`,children:`Example integrations`}),`\n`,_jsx(_components.p,{children:`Several providers that aren’t first-class integrations in the AI Gateway are connected through Custom Endpoints. Use these ready-made guides as references when wiring up your own upstream:`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`CoreWeave (W\u0026B Inference)`,href:`/docs/ai-gateway/coreweave-models`,children:_jsx(_components.p,{children:`Proxy CoreWeave models served via W\u0026B Inference’s OpenAI-compatible API.`})}),_jsx(Card,{title:`PipeShift`,href:`/docs/ai-gateway/pipeshift`,children:_jsx(_components.p,{children:`Route to PipeShift’s OpenAI-compatible chat completions API.`})}),_jsx(Card,{title:`SiliconFlow`,href:`/docs/ai-gateway/siliconflow`,children:_jsx(_components.p,{children:`Route to SiliconFlow’s OpenAI-compatible chat completions API.`})}),_jsx(Card,{title:`io.net`,href:`/docs/ai-gateway/io-net`,children:_jsx(_components.p,{children:`Call io.net Intelligence open-source models through the AI Gateway.`})}),_jsx(Card,{title:`Resemble AI`,href:`/docs/ai-gateway/resemble-ai`,children:_jsx(_components.p,{children:`Proxy Resemble AI text-to-speech synthesis requests.`})}),_jsx(Card,{title:`Ringg.AI`,href:`/docs/ai-gateway/ringg-ai`,children:_jsx(_components.p,{children:`Proxy Ringg.AI Parrot speech-to-text transcription requests.`})}),_jsx(Card,{title:`Crusoe`,href:`/docs/ai-gateway/crusoe`,children:_jsx(_components.p,{children:`Proxy Crusoe Managed Inference OpenAI-compatible models.`})}),_jsx(Card,{title:`Jev (TypeSafe)`,href:`/docs/ai-gateway/jev`,children:_jsx(_components.p,{children:`Call TypeSafe’s Jev model through the AI Gateway.`})}),_jsx(Card,{title:`SCX.ai`,href:`/docs/ai-gateway/scx-ai`,children:_jsx(_components.p,{children:`Route to SCX.ai’s OpenAI-compatible chat completions API.`})})]}),`\n`,_jsx(Heading,{level:`3`,id:`setup`,children:`Setup`}),`\n`,_jsx(Frame,{caption:`AI Gateway — Models — open the Custom Endpoints tab`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-overview.png?fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=ab6bc1ff725c3f2a1a1b853fb449ec90`,alt:`Custom Endpoints tab with endpoint groups and Add Custom Endpoint`,\"data-og-width\":`2968`,width:`2968`,\"data-og-height\":`800`,height:`800`,\"data-path\":`images/docs/custom-endpoints-overview.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-overview.png?w=280\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=07a2f0bee98e9fc162ee6959bd4493c1 280w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-overview.png?w=560\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=94183278d034e5e71e746b12c2341908 560w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-overview.png?w=840\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=5cfcaa7a947da4f9e8d1a5b27ea22399 840w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-overview.png?w=1100\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=3dc0196c7ddb383e00b24f66e480d630 1100w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-overview.png?w=1650\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=61fde0b32abaf3e0f2d32b4cd71ae432 1650w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-overview.png?w=2500\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=c037cc27cacc7e4f21b75f2533909757 2500w`})}),`\n`,_jsxs(Steps,{children:[_jsxs(Step,{title:`Create a Custom Endpoint model account`,children:[_jsxs(_components.p,{children:[`From the TrueFoundry dashboard, go to `,_jsx(_components.strong,{children:`AI Gateway`}),` → `,_jsx(_components.strong,{children:`Models`}),`, open the `,_jsx(_components.strong,{children:`Custom Endpoints`}),` tab, and click `,_jsx(_components.strong,{children:`Add Custom Endpoint`}),`.`]}),_jsxs(_components.p,{children:[`In the wizard, complete `,_jsx(_components.strong,{children:`Configure Account`}),`: `,_jsx(_components.strong,{children:`Name`}),` (required), optional `,_jsx(_components.strong,{children:`Endpoint Type`}),` (`,_jsx(_components.strong,{children:`None`}),`, `,_jsx(_components.strong,{children:`Azure Speech Service`}),`, or `,_jsx(_components.strong,{children:`Other`}),`), and optional `,_jsx(_components.strong,{children:`Header Auth`}),` at the account level so integrations can inherit the same default upstream authentication. Use `,_jsx(_components.strong,{children:`Continue to Endpoints`}),` when ready.`]}),_jsxs(_components.p,{children:[`To turn the account into a load-balanced pool, expand `,_jsx(_components.strong,{children:`Advanced`}),` and set `,_jsx(_components.strong,{children:`Routing Type`}),` to `,_jsx(_components.code,{children:`Weight`}),` or `,_jsx(_components.code,{children:`Priority`}),`, then enter a `,_jsx(_components.strong,{children:`Slug`}),`. The slug becomes the second URL segment for the aggregated endpoint (`,_jsx(_components.code,{children:`/proxy-api/\u003caccount-name>/\u003cslug>/\u003cupstream-path>`}),`). Leave Routing Type as `,_jsx(_components.code,{children:`None`}),` for the standard per-endpoint flow. See `,_jsx(_components.a,{href:`#load-balancing-across-endpoints`,children:`Load balancing across endpoints`}),`.`]}),_jsx(Frame,{caption:`Configure Account — Name, Endpoint Type, optional Header Auth`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-provider-account.png?fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=59bcccf025299af41dc0ae8268c4a8e4`,alt:`Setup Custom Endpoint Account wizard — Configure Account step`,\"data-og-width\":`2082`,width:`2082`,\"data-og-height\":`1476`,height:`1476`,\"data-path\":`images/docs/custom-endpoints-provider-account.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-provider-account.png?w=280\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=be77401e143dd3eb7605865eab28c574 280w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-provider-account.png?w=560\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=9a09a2a03bb92684b35f8aa31e9d2508 560w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-provider-account.png?w=840\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=733b37760486f692f258b24856aa54cc 840w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-provider-account.png?w=1100\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=0bc79753097c1f3aeadc730c6fad3ad8 1100w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-provider-account.png?w=1650\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=87bcd2de8fb03d577e1b537a2a4a7313 1650w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-provider-account.png?w=2500\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=eea1cfd57bdaef361f9cc45ac5a3e1ef 2500w`})})]}),_jsxs(Step,{title:`Add an integration (endpoint)`,children:[_jsxs(_components.p,{children:[`On the `,_jsx(_components.strong,{children:`Endpoints`}),` wizard step, add or edit an endpoint integration (`,_jsx(_components.strong,{children:`Add Endpoint`}),` from the list view works the same flow).`]}),_jsxs(_components.p,{children:[`Set `,_jsx(_components.strong,{children:`Display Name`}),` and `,_jsx(_components.strong,{children:`Base URL`}),` (the upstream origin — `,_jsx(_components.strong,{children:`must not`}),` end with a trailing slash; see configuration reference). Optionally enable `,_jsx(_components.strong,{children:`Custom Headers`}),`, `,_jsx(_components.strong,{children:`Header Auth`}),` (per-endpoint upstream credentials), or `,_jsx(_components.strong,{children:`TLS Settings`}),`.`]}),_jsxs(_components.p,{children:[`If the account has `,_jsx(_components.strong,{children:`Routing Type`}),` set, a `,_jsx(_components.strong,{children:`Load Balancing Config`}),` group appears on each endpoint with `,_jsx(_components.strong,{children:`Weight`}),` (weight mode) or `,_jsx(_components.strong,{children:`Priority`}),` (priority mode), plus `,_jsx(_components.strong,{children:`Fallback Status Codes`}),` and `,_jsx(_components.strong,{children:`Fallback Candidate`}),`. See `,_jsx(_components.a,{href:`#per-endpoint-load-balancing-fields`,children:`Per-endpoint load balancing fields`}),`.`]}),_jsx(Frame,{caption:`Endpoints step — Display Name, Base URL, Custom Headers, Header Auth, TLS Settings`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-integration-form.png?fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=8f859f9395d282908245b2e70deb7823`,alt:`Setup Custom Endpoint Account wizard — Endpoints step with integration fields`,\"data-og-width\":`1538`,width:`1538`,\"data-og-height\":`1476`,height:`1476`,\"data-path\":`images/docs/custom-endpoints-integration-form.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-integration-form.png?w=280\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=51125d1903fec75f605cdccc430892b8 280w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-integration-form.png?w=560\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=63198ec1caaf83b4abdda73ee0c4a939 560w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-integration-form.png?w=840\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=84d26cca9de168324357001a11e854e9 840w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-integration-form.png?w=1100\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=c15041d40c778afe3ca9913b0c3806a9 1100w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-integration-form.png?w=1650\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=3f6aa6a1f26a7d780a867a27c80bd110 1650w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-integration-form.png?w=2500\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=4ac4bb9a87021ae4b7266c580ad4a0cc 2500w`})})]}),_jsxs(Step,{title:`Make a request`,children:[_jsxs(_components.p,{children:[`Call the AI Gateway using the pattern below. Replace `,_jsx(_components.code,{children:`GATEWAY_BASE_URL`}),`, `,_jsx(_components.code,{children:`providerAccountName`}),`, and `,_jsx(_components.code,{children:`endpointName`}),` with your values, and append any path that should be joined to the integration `,_jsx(_components.strong,{children:`Base URL`}),`.`]}),_jsx(CodeBlock,{filename:``,lines:`true`,numberOfLines:`14`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`url = `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{GATEWAY_BASE_URL}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`/proxy-api/`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{providerAccountName}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`/`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{endpointName}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`/your/upstream/path\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`headers = {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer your-truefoundry-api-key\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`body = {`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"key\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"value\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response = requests.post(url, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`headers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=headers, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`json`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=body)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(response.status_code)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(response.text)`})]}),`\n`]})})}),_jsx(Note,{children:_jsxs(_components.p,{children:[`Callers only need a `,_jsx(_components.strong,{children:`TrueFoundry API key`}),` for the AI Gateway. Upstream authentication is applied by the AI Gateway from your model account and integration settings—you do not pass upstream secrets from client code.`]})}),_jsx(Frame,{caption:`Usage code snippet — Python example with proxy-api URL`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-code-snippet.png?fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=40e3ff124893501091cb9fd7a798d05d`,alt:`Usage code snippet modal showing Python Requests example for a custom endpoint`,\"data-og-width\":`2674`,width:`2674`,\"data-og-height\":`1476`,height:`1476`,\"data-path\":`images/docs/custom-endpoints-code-snippet.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-code-snippet.png?w=280\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=e151b14bad3c90af1ec359d0b1786512 280w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-code-snippet.png?w=560\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=ec8d9d6143a18c38dda3900a3a1c3456 560w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-code-snippet.png?w=840\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=4843b4b987974f15deec2645fead7ec7 840w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-code-snippet.png?w=1100\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=cf17af5092bcea0a07e857149389be7e 1100w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-code-snippet.png?w=1650\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=0fe8531e20a69b7abd10c37579ee39bc 1650w, https://mintcdn.com/truefoundry/M3W5ATCqy1JrWCi9/images/docs/custom-endpoints-code-snippet.png?w=2500\u0026fit=max\u0026auto=format\u0026n=M3W5ATCqy1JrWCi9\u0026q=85\u0026s=72999a784bc60c8074229bda88c49c79 2500w`})})]})]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`The wizard also includes an `,_jsx(_components.strong,{children:`Access Control`}),` step after `,_jsx(_components.strong,{children:`Endpoints`}),` (who can use this model account), consistent with other AI Gateway providers — see `,_jsx(_components.a,{href:`/docs/ai-gateway/gateway-access-control`,children:`Gateway access control`}),`.`]})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`The same manifest fields are available through the `,_jsx(_components.strong,{children:`TrueFoundry CLI`}),` (`,_jsx(_components.code,{children:`tfy apply`}),`) if you configure model accounts without the dashboard.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`endpoint-structure`,children:`Endpoint structure`}),`\n`,_jsx(_components.p,{children:`Requests use this URL shape (query parameters are forwarded unchanged):`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`{GATEWAY_BASE_URL}/proxy-api/{providerAccountName}/{endpointName}/{upstream-path}?{query-params}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Segment`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`providerAccountName`})}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`Name`}),` of your Custom Endpoint model account (lowercase letters, digits, hyphens; 3–32 characters)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`endpointName`})}),_jsxs(_components.td,{children:[`Integration `,_jsx(_components.strong,{children:`Display Name`}),` used in the URL (letters, digits, `,_jsx(_components.code,{children:`-`}),`, `,_jsx(_components.code,{children:`_`}),`, `,_jsx(_components.code,{children:`.`}),`; no spaces; 2–62 characters; cannot start with a digit)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`upstream-path`})}),_jsxs(_components.td,{children:[`Path appended to the integration’s `,_jsx(_components.strong,{children:`Base URL`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`query-params`})}),_jsx(_components.td,{children:`Optional; passed through to the upstream as-is`})]})]})]}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`Provider account and integration names must satisfy the patterns above when created. If your HTTP client requires encoding for certain characters in the path segment, URL-encode `,_jsx(_components.code,{children:`endpointName`}),` accordingly.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`authentication`,children:`Authentication`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Gateway authentication`}),` — Same as other AI Gateway routes: send `,_jsx(_components.code,{children:`Authorization: Bearer \u003cTrueFoundry API key>`}),` (or your deployment’s documented gateway auth).`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Upstream authentication`}),` — Configure `,_jsx(_components.strong,{children:`Header Auth`}),` (header name/value pairs used as upstream credentials) and optional `,_jsx(_components.strong,{children:`Custom Headers`}),` on the model account and/or each integration. The AI Gateway adds these to the proxied request; callers never see upstream keys.`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`If an integration has `,_jsx(_components.strong,{children:`no`}),` Header Auth, the AI Gateway uses the model account’s Header Auth when present. Setting Header Auth on an integration `,_jsx(_components.strong,{children:`replaces`}),` the account default for that endpoint only.`]})}),`\n`,_jsxs(_components.p,{children:[`Upstream services that expect `,_jsx(_components.strong,{children:`Bearer`}),` or `,_jsx(_components.strong,{children:`HTTP Basic`}),` credentials still use Header Auth: you store the `,_jsx(_components.strong,{children:`exact header name and value`}),` the upstream expects (often `,_jsx(_components.code,{children:`Authorization`}),`). Examples:`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Bearer token`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Header`}),_jsx(_components.th,{children:`Value`})]})}),_jsx(_components.tbody,{children:_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Authorization`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Bearer \u003cyour-upstream-access-token>`})})]})})]}),`\n`,_jsxs(_components.p,{children:[`Enter the same `,_jsx(_components.strong,{children:`Header`}),` name and `,_jsx(_components.strong,{children:`value`}),` in the integration’s Header Auth (or account-level Header Auth).`]}),`\n`,_jsxs(_components.p,{children:[`To use a TrueFoundry secret at either level, store the complete header value (for example, `,_jsx(_components.code,{children:`Bearer \u003ctoken>`}),`) in the secret and enter only its `,_jsx(_components.code,{children:`tfy-secret://tenant:group:KEY`}),` reference as the Header Auth value. References resolve automatically; `,_jsx(_components.code,{children:`Bearer tfy-secret://...`}),` does not resolve.`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Username and password (HTTP Basic)`})}),`\n`,_jsxs(_components.p,{children:[`Basic authentication sends a single `,_jsx(_components.code,{children:`Authorization`}),` header whose value is `,_jsx(_components.code,{children:`Basic `}),` followed by the `,_jsx(_components.strong,{children:`Base64 encoding`}),` of `,_jsx(_components.code,{children:`username:password`}),` (UTF-8), with `,_jsx(_components.strong,{children:`no`}),` newline inside that string.`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Build the string `,_jsx(_components.code,{children:`username:password`}),` (colon between user and password).`]}),`\n`,_jsx(_components.li,{children:`Base64-encode it (standard Base64, padding as needed).`}),`\n`,_jsxs(_components.li,{children:[`Set Header Auth to `,_jsx(_components.code,{children:`Authorization`}),` = `,_jsx(_components.code,{children:`Basic \u003cencoded-result>`}),`.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`Example (compute once, paste the header value into the AI Gateway):`}),`\n`,_jsx(CodeBlock,{filename:``,lines:`true`,numberOfLines:`7`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` base64`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`user = `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"myuser\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`password = `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"mypass\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`token = base64.b64encode(`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`user`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`:`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`password`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.encode(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"utf-8\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)).decode(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"ascii\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# token is e.g. \"bXl1c2VyOm15cGFzcw==\"`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'Authorization: Basic `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`token`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Equivalent one-liners:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:\"# macOS / Linux — prints the Base64 segment (prefix with `Basic ` for the full header value)\"})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`printf`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '%s'`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 'myuser:mypass'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` | `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`base64`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Paste `,_jsx(_components.strong,{children:`Authorization`}),` = `,_jsx(_components.code,{children:`Basic \u003coutput-from-above>`}),` into Header Auth in the UI.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`API key in a custom header`}),` (e.g. Azure Speech)`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Header`}),_jsx(_components.th,{children:`Value`})]})}),_jsx(_components.tbody,{children:_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Ocp-Apim-Subscription-Key`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`\u003csubscription-key>`})})]})})]}),`\n`,_jsx(Heading,{level:`3`,id:`load-balancing-across-endpoints`,children:`Load balancing across endpoints`}),`\n`,_jsxs(_components.p,{children:[`Pool multiple endpoints under the same model account behind a `,_jsx(_components.strong,{children:`single aggregated URL`}),` to raise aggregate concurrency or to run a primary/backup topology. Typical uses include scaling out replicas of an internal API, fanning out across multiple regional deployments of the same HTTP service, or combining several Azure Speech subscriptions to lift the per-subscription request limit.`]}),`\n`,_jsx(Mermaid,{chart:`flowchart LR\n App[Your application] --> Slug[\"/proxy-api/account/slug/...\"]\n Slug --> GW[AI Gateway]\n GW --> E1[\"account/endpoint-a\"]\n GW --> E2[\"account/endpoint-b\"]\n GW --> E3[\"account/endpoint-c\"]`}),`\n`,_jsx(Heading,{level:`4`,id:`how-it-works`,children:`How it works`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Set `,_jsx(_components.code,{children:`routing_type`}),` (`,_jsx(_components.code,{children:`weight`}),` or `,_jsx(_components.code,{children:`priority`}),`) and a `,_jsx(_components.code,{children:`slug`}),` on the `,_jsx(_components.strong,{children:`model account`}),`, and add a `,_jsx(_components.code,{children:`loadbalancing_config`}),` to each endpoint integration.`]}),`\n`,_jsxs(_components.li,{children:[`Call the pool at `,_jsx(_components.code,{children:`{GATEWAY_BASE_URL}/proxy-api/{providerAccountName}/{slug}/{upstream-path}`}),`. The slug replaces the single `,_jsx(_components.code,{children:`endpointName`}),` segment.`]}),`\n`,_jsx(_components.li,{children:`Per-endpoint URLs continue to work alongside the slug URL — useful for testing one upstream in isolation.`}),`\n`,_jsxs(_components.li,{children:[`For each request, the AI Gateway picks an endpoint, proxies the call, and on a response whose status is listed in `,_jsx(_components.code,{children:`fallback_status_codes`}),` (or on a network error) retries the next eligible endpoint. Repeated failures cool an endpoint down across requests automatically.`]}),`\n`,_jsxs(_components.li,{children:[`Access is checked at the `,_jsx(_components.strong,{children:`model account`}),` level in aggregated mode — per-endpoint `,_jsx(_components.code,{children:`authorized_subjects`}),` lists are not consulted.`]}),`\n`]}),`\n`,_jsxs(Note,{children:[_jsxs(_components.p,{children:[`The dashboard’s “usage code snippet” helper is only generated for `,_jsx(_components.strong,{children:`individual endpoints`}),`, not for the load-balanced slug endpoint. Build the request URL yourself using the template below — gateway authentication and upstream auth injection work exactly like the per-endpoint flow.`]}),_jsxs(_components.p,{children:[`Template: `,_jsx(_components.code,{children:`{GATEWAY_BASE_URL}/proxy-api/{providerAccountName}/{slug}/{upstream-path}`})]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`{slug}`}),` is the account’s `,_jsx(_components.strong,{children:`Slug`}),` (not an endpoint’s Display Name).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`{upstream-path}`}),` is appended to the chosen endpoint’s `,_jsx(_components.code,{children:`base_url`}),`, identical to the per-endpoint flow.`]}),`\n`,_jsx(_components.li,{children:`You can copy the snippet from any individual endpoint as a starting point and replace the endpoint name segment with the slug.`}),`\n`]})]}),`\n`,_jsx(Heading,{level:`4`,id:`configuration-structure`,children:`Configuration structure`}),`\n`,_jsx(_components.p,{children:`The following YAML shows the complete shape of a load-balanced custom endpoint model account. The same fields are available in the dashboard form editor.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`29`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`29`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`provider-account/custom-endpoint`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`my-endpoint-pool`}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` # URL segment 1; lowercase, 3-32 chars`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`endpoint_type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`other`}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` # optional: azure-speech-service | other (tracking only)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`routing_type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`weight`}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` # weight | priority (omit for per-endpoint only)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`slug`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`pool`}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` # required when routing_type is set; URL segment 2`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`auth_data`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# optional account-level default upstream auth`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`header`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` headers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` Authorization`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer \u003cUPSTREAM_TOKEN>\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`integrations`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`integration/model/custom-endpoint`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`endpoint-a`}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` # target id at runtime: my-endpoint-pool/endpoint-a`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` base_url`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`https://a.internal.example.com/v1`}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` # no trailing slash`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` loadbalancing_config`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` weight`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`60`}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` # weight mode: 0-100; all weights must sum to 100`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` fallback_status_codes`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"429\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"500\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"502\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"503\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` fallback_candidate`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` headers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` X-Env`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`prod`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` # auth_data and tls_settings can also be set per endpoint and override the account defaults`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`integration/model/custom-endpoint`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`endpoint-b`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` base_url`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`https://b.internal.example.com/v1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` loadbalancing_config`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` weight`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`40`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` fallback_candidate`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`]})})}),`\n`,_jsx(_components.h5,{children:`Per-endpoint load balancing fields`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`weight`})}),_jsx(_components.td,{children:`int (0-100)`}),_jsxs(_components.td,{children:[`Traffic share, `,_jsx(_components.strong,{children:`weight mode only`}),`. Weights across all endpoints must sum to 100.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`priority`})}),_jsx(_components.td,{children:`int (≥ 0)`}),_jsxs(_components.td,{children:[`Priority, `,_jsx(_components.strong,{children:`priority mode only`}),`. Lower number = higher priority; `,_jsx(_components.code,{children:`0`}),` is highest.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`fallback_status_codes`})}),_jsx(_components.td,{children:`string[]`}),_jsxs(_components.td,{children:[`Upstream HTTP statuses that trigger a fallback to the next endpoint. Default: `,_jsx(_components.code,{children:`[\"401\", \"403\", \"404\", \"408\", \"429\", \"500\", \"502\", \"503\"]`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`fallback_candidate`})}),_jsx(_components.td,{children:`bool`}),_jsxs(_components.td,{children:[`If `,_jsx(_components.code,{children:`false`}),`, the endpoint never receives fallback traffic from another endpoint — it is only used when picked as the primary. Default: `,_jsx(_components.code,{children:`true`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`metadata_match`})}),_jsx(_components.td,{children:`map[string]string`}),_jsxs(_components.td,{children:[`Optional. Restrict the endpoint to requests whose `,_jsx(_components.a,{href:`#metadata-based-target-filtering`,children:`resolved metadata`}),` matches `,_jsx(_components.strong,{children:`all`}),` key-value pairs. Endpoints without `,_jsx(_components.code,{children:`metadata_match`}),` always stay eligible.`]})]})]})]}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`Validation rules: setting `,_jsx(_components.code,{children:`routing_type`}),` requires `,_jsx(_components.code,{children:`slug`}),` and `,_jsx(_components.strong,{children:`at least 2 endpoints`}),`. In weight mode, every endpoint needs a `,_jsx(_components.code,{children:`weight`}),` and the sum across endpoints must equal `,_jsx(_components.strong,{children:`100`}),`. In priority mode, every endpoint needs a `,_jsx(_components.code,{children:`priority`}),`. Without `,_jsx(_components.code,{children:`routing_type`}),`, `,_jsx(_components.code,{children:`slug`}),` and `,_jsx(_components.code,{children:`loadbalancing_config`}),` are ignored.`]})}),`\n`,_jsx(Heading,{level:`4`,id:`weight-based-routing`,children:`Weight-based routing`}),`\n`,_jsxs(_components.p,{children:[`Distributes requests across endpoints in proportion to their `,_jsx(_components.code,{children:`weight`}),`. Best for spreading load across multiple equivalent backends to raise aggregate concurrency.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`provider-account/custom-endpoint`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`orders-api-pool`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`routing_type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`weight`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`slug`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`orders`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`integrations`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`integration/model/custom-endpoint`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`replica-1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` base_url`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`https://orders-1.internal.example.com`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` loadbalancing_config`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` weight`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`50`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`integration/model/custom-endpoint`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`replica-2`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` base_url`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`https://orders-2.internal.example.com`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` loadbalancing_config`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` weight`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`50`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Call the pool:`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,lines:`true`,numberOfLines:`11`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--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:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`url = `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{GATEWAY_BASE_URL}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`/proxy-api/orders-api-pool/orders/api/v1/orders\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`headers = {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer your-truefoundry-api-key\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response = requests.post(url, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`headers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=headers, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`json`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`={`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"customer_id\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"cust_123\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"limit\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`10`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`})`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(response.status_code, response.json())`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`curl`,lines:`true`,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"{GATEWAY_BASE_URL}/proxy-api/orders-api-pool/orders/api/v1/orders\"`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer your-truefoundry-api-key\"`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '{\"customer_id\": \"cust_123\", \"limit\": 10}'`})]}),`\n`]})})})]}),`\n`,_jsxs(Accordion,{title:`Example: pool multiple Azure Speech subscriptions for higher throughput`,id:`example-pool-multiple-azure-speech-subscriptions-for-higher-throughput`,children:[_jsxs(_components.p,{children:[`A single Azure Speech subscription has a fixed per-resource concurrency. Combining several subscriptions or regions behind one slug endpoint multiplies the headroom and lets the AI Gateway fail over on `,_jsx(_components.code,{children:`429`}),`.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`24`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`24`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`provider-account/custom-endpoint`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`azure-speech-pool`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`endpoint_type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`azure-speech-service`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`routing_type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`weight`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`slug`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`tts`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`integrations`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`integration/model/custom-endpoint`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`eastus2`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` base_url`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`https://eastus2.tts.speech.microsoft.com/cognitiveservices`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` auth_data`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`header`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` headers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` Ocp-Apim-Subscription-Key`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cKEY_A>\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` loadbalancing_config`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` weight`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`70`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`integration/model/custom-endpoint`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`westus2`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` base_url`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`https://westus2.tts.speech.microsoft.com/cognitiveservices`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` auth_data`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`header`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` headers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` Ocp-Apim-Subscription-Key`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cKEY_B>\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` loadbalancing_config`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` weight`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`30`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`The pool is called at `,_jsx(_components.code,{children:`{GATEWAY_BASE_URL}/proxy-api/azure-speech-pool/tts/v1`}),` — same SSML body and `,_jsx(_components.code,{children:`X-Microsoft-OutputFormat`}),` header as the single-endpoint example in `,_jsx(_components.a,{href:`#use-cases`,children:`Use cases`}),`, only the URL changes.`]})]}),`\n`,_jsx(Heading,{level:`4`,id:`priority-based-routing`,children:`Priority-based routing`}),`\n`,_jsxs(_components.p,{children:[`Routes every request to the `,_jsx(_components.strong,{children:`highest-priority healthy endpoint`}),` (`,_jsx(_components.code,{children:`0`}),` is highest) and falls back to the next on failure. Best for primary/backup topologies.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`provider-account/custom-endpoint`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`search-pool`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`routing_type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`priority`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`slug`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`search`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`integrations`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`integration/model/custom-endpoint`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`primary`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` base_url`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`https://search-primary.internal.example.com`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` loadbalancing_config`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` priority`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` fallback_status_codes`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"429\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"500\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"502\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"503\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`integration/model/custom-endpoint`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`backup`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` base_url`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`https://search-backup.internal.example.com`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` loadbalancing_config`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` priority`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Every request goes to `,_jsx(_components.code,{children:`primary`}),` while it is healthy; when it returns a fallback status code or is in cooldown, the AI Gateway tries `,_jsx(_components.code,{children:`backup`}),`.`]}),`\n`,_jsx(Heading,{level:`4`,id:`metadata-based-target-filtering`,children:`Metadata-based target filtering`}),`\n`,_jsxs(_components.p,{children:[`You can constrain an endpoint to only receive traffic when request metadata matches specific key-value pairs using `,_jsx(_components.code,{children:`metadata_match`}),` under its `,_jsx(_components.code,{children:`loadbalancing_config`}),`. This works the same way as on `,_jsx(_components.a,{href:`/docs/ai-gateway/virtual-model#metadata-based-target-filtering`,children:`virtual model targets`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`The AI Gateway evaluates `,_jsx(_components.strong,{children:`resolved metadata`}),` (not just raw request headers). Metadata can come from:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Request metadata header`}),` — `,_jsx(_components.code,{children:`x-tfy-metadata`}),` (JSON object with string keys and values)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Virtual account tags`}),` — when using a virtual account, its tags are included in metadata`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Default gateway metadata`}),` — configured at the AI Gateway level (commonly used in self-hosted setups)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`SaaS gateway location metadata`}),` — `,_jsx(_components.code,{children:`tfy_gateway_region`}),` and `,_jsx(_components.code,{children:`tfy_gateway_zone`}),` are automatically added by the SaaS gateway based on which region handled the request`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`For each endpoint:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`If `,_jsx(_components.code,{children:`metadata_match`}),` is not set (or empty), the endpoint always stays eligible.`]}),`\n`,_jsxs(_components.li,{children:[`If `,_jsx(_components.code,{children:`metadata_match`}),` is set, `,_jsx(_components.strong,{children:`all`}),` configured pairs must match exactly (`,_jsx(_components.code,{children:`AND`}),` semantics).`]}),`\n`,_jsx(_components.li,{children:`Filtering happens before weight/priority ordering and cooldown are computed, so only matching endpoints participate in routing for that request.`}),`\n`]}),`\n`,_jsxs(Accordion,{title:`Basic metadata filtering`,id:`basic-metadata-filtering`,children:[_jsx(CodeBlock,{filename:``,numberOfLines:`18`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`18`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`provider-account/custom-endpoint`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`search-pool`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`routing_type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`weight`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`slug`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`search`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`integrations`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`integration/model/custom-endpoint`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`search-us`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` base_url`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`https://us.search.internal.example.com`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` loadbalancing_config`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` weight`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`70`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` metadata_match`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` region`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`us`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` tier`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`enterprise`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`integration/model/custom-endpoint`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` name`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`search-shared`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` base_url`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`https://shared.search.internal.example.com`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` loadbalancing_config`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` weight`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`30`})]}),`\n`]})})}),_jsx(_components.p,{children:`For a request with:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`http`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`x-tfy-metadata:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` {\"region\":\"us\",\"tier\":\"enterprise\"}`})]}),`\n`]})})}),_jsx(_components.p,{children:`both endpoints are eligible. For:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`http`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`x-tfy-metadata:`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` {\"region\":\"eu\",\"tier\":\"enterprise\"}`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`only `,_jsx(_components.code,{children:`search-shared`}),` remains eligible because `,_jsx(_components.code,{children:`search-us`}),` does not match.`]})]}),`\n`,_jsxs(_components.p,{children:[`For routing by SaaS gateway region using `,_jsx(_components.code,{children:`tfy_gateway_region`}),` / `,_jsx(_components.code,{children:`tfy_gateway_zone`}),`, see the `,_jsx(_components.a,{href:`/docs/ai-gateway/virtual-model#metadata-based-target-filtering`,children:`virtual model example`}),` — the same pattern applies, just put `,_jsx(_components.code,{children:`metadata_match`}),` under each integration’s `,_jsx(_components.code,{children:`loadbalancing_config`}),`.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`If no endpoint matches the request metadata, the AI Gateway returns `,_jsx(_components.code,{children:`404`}),` with an error indicating that none of the configured endpoints matched `,_jsx(_components.code,{children:`metadata_match`}),` conditions. Always include at least one endpoint without `,_jsx(_components.code,{children:`metadata_match`}),` as a catch-all, or ensure your metadata rules cover all possible values.`]})}),`\n`,_jsx(Heading,{level:`4`,id:`fallback-and-health`,children:`Fallback and health`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`fallback_status_codes`})}),` — Upstream statuses that cause the AI Gateway to stop on the current endpoint and try the next eligible one in the pool. Statuses outside this list propagate to the caller immediately. Default: `,_jsx(_components.code,{children:`[\"401\", \"403\", \"404\", \"408\", \"429\", \"500\", \"502\", \"503\"]`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`fallback_candidate`})}),` — When `,_jsx(_components.code,{children:`false`}),`, the endpoint is excluded from receiving fallback traffic from other endpoints; it is only used when selected as its own primary by the routing strategy.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Network errors`}),` (timeouts, connection failures) always roll over to the next endpoint regardless of `,_jsx(_components.code,{children:`fallback_status_codes`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Automatic cooldown`}),` — Repeated failures (`,_jsx(_components.code,{children:`401`}),`, `,_jsx(_components.code,{children:`403`}),`, `,_jsx(_components.code,{children:`429`}),`, `,_jsx(_components.code,{children:`5xx`}),`) within a short rolling window mark an endpoint unhealthy. Healthy endpoints are tried first; if every endpoint is in cooldown the AI Gateway still tries them as a last resort. Recovery is automatic once errors age out of the window.`]}),`\n`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Compared to `,_jsx(_components.a,{href:`/docs/ai-gateway/virtual-model`,children:`Virtual Models`}),`, custom endpoints use the same weight/priority concepts and the same `,_jsx(_components.a,{href:`#metadata-based-target-filtering`,children:_jsx(_components.code,{children:`metadata_match`})}),` routing, but in a different shape: routing is configured on the `,_jsx(_components.strong,{children:`account`}),` with `,_jsx(_components.code,{children:`routing_type`}),` + `,_jsx(_components.code,{children:`slug`}),`, targets are `,_jsx(_components.strong,{children:`implicit`}),` (every endpoint under the account), and each endpoint carries its own `,_jsx(_components.code,{children:`loadbalancing_config`}),`. There is no `,_jsx(_components.code,{children:`routing_config`}),` / `,_jsx(_components.code,{children:`load_balance_targets`}),` array, no latency-based routing, and no `,_jsx(_components.code,{children:`sticky_routing`}),`, `,_jsx(_components.code,{children:`sla_cutoff`}),`, retry attempts/delay, or `,_jsx(_components.code,{children:`override_params`}),`.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`use-cases`,children:`Use cases`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Azure Speech (text-to-speech)`,lines:`true`,numberOfLines:`24`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`24`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Integration Base URL should be like https://\u003cregion>.tts.speech.microsoft.com/cognitiveservices (no trailing slash).`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:\"# Append only the REST suffix — here `v1` for SSML — so the upstream becomes …/cognitiveservices/v1\"})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`url = `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{GATEWAY_BASE_URL}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`/proxy-api/`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{providerAccountName}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`/`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{endpointName}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`/v1\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`headers = {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer your-truefoundry-api-key\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"application/ssml+xml\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"X-Microsoft-OutputFormat\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"audio-16khz-128kbitrate-mono-mp3\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`ssml = `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"\"\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\u003cspeak version='1.0' xml:lang='en-US'>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \u003cvoice xml:lang='en-US' xml:gender='Female' name='en-US-JennyNeural'>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` Hello from the AI Gateway.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \u003c/voice>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\u003c/speak>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"\"\"`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response = requests.post(url, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`headers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=headers, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=ssml.encode(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"utf-8\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response.raise_for_status()`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Response body is binary audio from the upstream service.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`open`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"output.mp3\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"wb\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`).write(response.content)`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Internal REST API`,lines:`true`,numberOfLines:`13`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`url = `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{GATEWAY_BASE_URL}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`/proxy-api/`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{providerAccountName}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`/`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{endpointName}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`/api/v1/orders\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`headers = {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer your-truefoundry-api-key\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`payload = {`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"customer_id\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"cust_123\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"limit\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`10`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response = requests.post(url, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`headers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=headers, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`json`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=payload)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(response.json())`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Any HTTP service (GET)`,lines:`true`,numberOfLines:`8`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`url = `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{GATEWAY_BASE_URL}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`/proxy-api/`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{providerAccountName}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`/`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`{endpointName}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`/health\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`headers = {`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Authorization\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer your-truefoundry-api-key\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`response = requests.get(url, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`headers`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=headers, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`timeout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`30`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(response.status_code, response.text)`})]}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`3`,id:`configuration-reference`,children:`Configuration reference`}),`\n`,_jsxs(Heading,{level:`4`,id:`model-account-provider-account/custom-endpoint`,children:[`Model account (`,_jsx(_components.code,{children:`provider-account/custom-endpoint`}),`)`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Name`})}),_jsxs(_components.td,{children:[`Unique account identifier (lowercase letters, digits, hyphens; 3–32 characters); used in the AI Gateway URL as `,_jsx(_components.code,{children:`providerAccountName`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Endpoint Type`})}),_jsxs(_components.td,{children:[`Optional: `,_jsx(_components.code,{children:`azure-speech-service`}),` or `,_jsx(_components.code,{children:`other`}),` (used for tracking / defaults in the product)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Routing Type`})}),_jsxs(_components.td,{children:[`Optional: `,_jsx(_components.code,{children:`weight`}),` or `,_jsx(_components.code,{children:`priority`}),`. Turns the account into a load-balanced pool. Leave unset for the standard per-endpoint flow. See `,_jsx(_components.a,{href:`#load-balancing-across-endpoints`,children:`Load balancing across endpoints`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Slug`})}),_jsxs(_components.td,{children:[`Required when `,_jsx(_components.strong,{children:`Routing Type`}),` is set. Pattern: letters, digits, `,_jsx(_components.code,{children:`-`}),`, `,_jsx(_components.code,{children:`_`}),`, `,_jsx(_components.code,{children:`.`}),`; 2–62 characters; cannot start with a digit. Becomes the second URL segment for the aggregated endpoint (`,_jsx(_components.code,{children:`/proxy-api/\u003caccount>/\u003cslug>/\u003cupstream-path>`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Header Auth`})}),_jsxs(_components.td,{children:[`Optional default upstream auth: header-based credentials (`,_jsx(_components.code,{children:`type: header`}),` plus a `,_jsx(_components.strong,{children:`Headers`}),` map), applied when an integration has no Header Auth of its own`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Collaborators`})}),_jsxs(_components.td,{children:[`Who can manage or use this account — see `,_jsx(_components.a,{href:`/docs/ai-gateway/gateway-access-control`,children:`Gateway access control`})]})]})]})]}),`\n`,_jsx(Heading,{level:`4`,id:`integration-endpoint`,children:`Integration (endpoint)`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Display Name`})}),_jsxs(_components.td,{children:[`Identifies the endpoint in the UI and in the URL as `,_jsx(_components.code,{children:`endpointName`}),` (pattern: letters, digits, `,_jsx(_components.code,{children:`-`}),`, `,_jsx(_components.code,{children:`_`}),`, `,_jsx(_components.code,{children:`.`}),`; no spaces; cannot start with a digit)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Base URL`})}),_jsxs(_components.td,{children:[`HTTPS (or HTTP) origin `,_jsx(_components.strong,{children:`without`}),` a trailing slash; the AI Gateway appends `,_jsx(_components.code,{children:`upstream-path`}),` from the request`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Custom Headers`})}),_jsx(_components.td,{children:`Optional key/value headers merged into every upstream request (often under Advanced)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Header Auth`})}),_jsx(_components.td,{children:`Optional upstream credentials as header key/value pairs; when set, replaces provider-account Header Auth for this integration`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`TLS Settings`})}),_jsxs(_components.td,{children:[`Optional `,_jsx(_components.strong,{children:`Reject Unauthorized`}),` toggle and optional `,_jsx(_components.strong,{children:`Custom CA Certificates`}),` text for upstream TLS verification`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Load Balancing Config`})}),_jsxs(_components.td,{children:[`Required on every endpoint when the parent account has `,_jsx(_components.strong,{children:`Routing Type`}),` set. See `,_jsx(_components.a,{href:`#per-endpoint-load-balancing-fields`,children:`Per-endpoint load balancing fields`}),` for the sub-field reference`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Access Control`})}),_jsxs(_components.td,{children:[`Optional `,_jsx(_components.code,{children:`authorized_subjects`}),` for per-subject allow lists — commonly edited via API or manifest rather than the default UI. Not consulted when calling the account’s aggregated slug URL (access is checked at the provider-account level)`]})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`tracing`,children:`Tracing`}),`\n`,_jsxs(_components.p,{children:[`All traffic through Custom Endpoints is traced with span type `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`CustomEndpoint`})}),` on the AI Gateway trace / root span. To browse requests in the dashboard, see `,_jsx(_components.a,{href:`/docs/ai-gateway/request-logging`,children:`Request Logging`}),`. For general tracing concepts (traces, spans, attributes), see the `,_jsx(_components.a,{href:`/docs/tracing/overview`,children:`LLM tracing overview`}),`.`]}),`\n`,_jsx(_components.p,{children:`Aggregated (load-balanced) requests carry extra attributes on the same span so you can see which pooled endpoint served each request and how often fallback occurred:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Attribute`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`custom_proxy_routing_type`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`weight`}),` or `,_jsx(_components.code,{children:`priority`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`custom_proxy_slug`})}),_jsx(_components.td,{children:`The account slug used in the request URL`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`custom_proxy_endpoint_name`})}),_jsx(_components.td,{children:`The endpoint that actually served the request`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`custom_proxy_target_was_cooled_down`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`true`}),` if the request had to use an endpoint in cooldown (all targets unhealthy)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`loadbalance_target_attempt_count`})}),_jsx(_components.td,{children:`Number of endpoints attempted before success or final failure`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`loadbalance_first_target`})}),_jsx(_components.td,{children:`First endpoint tried for this request`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`loadbalance_final_target`})}),_jsx(_components.td,{children:`Endpoint that produced the final response`})]})]})]})]})}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":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Custom Endpoints","sidebarTitle":"Custom Endpoints","description":"Connect any HTTP service to the AI Gateway for centralized authentication, access control, and tracing.","href":"/docs/ai-gateway/custom-endpoints"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Example integrations","slug":"example-integrations","depth":3,"children":[]},{"title":"Setup","slug":"setup","depth":3,"children":[]},{"title":"Endpoint structure","slug":"endpoint-structure","depth":3,"children":[]},{"title":"Authentication","slug":"authentication","depth":3,"children":[]},{"title":"Load balancing across endpoints","slug":"load-balancing-across-endpoints","depth":3,"children":[]},{"title":"How it works","slug":"how-it-works","depth":4,"children":[]},{"title":"Configuration structure","slug":"configuration-structure","depth":4,"children":[]},{"title":"Weight-based routing","slug":"weight-based-routing","depth":4,"children":[]},{"title":"Priority-based routing","slug":"priority-based-routing","depth":4,"children":[]},{"title":"Metadata-based target filtering","slug":"metadata-based-target-filtering","depth":4,"children":[]},{"title":"Fallback and health","slug":"fallback-and-health","depth":4,"children":[]},{"title":"Use cases","slug":"use-cases","depth":3,"children":[]},{"title":"Configuration reference","slug":"configuration-reference","depth":3,"children":[]},{"title":"Model account (provider-account/custom-endpoint)","slug":"model-account-provider-account/custom-endpoint","depth":4,"children":[]},{"title":"Integration (endpoint)","slug":"integration-endpoint","depth":4,"children":[]},{"title":"Tracing","slug":"tracing","depth":3,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/truefoundry/9e0085f7ed271180/scripts.js"],"subdomain":"truefoundry","siteName":"TrueFoundry Docs","title":"Custom Endpoints - TrueFoundry Docs","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-13T07:27:51.532Z","originalFileLocation":"docs/ai-gateway/custom-endpoints.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=\"light\"}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=\"Connect any HTTP service to the AI Gateway for centralized authentication, access control, and tracing.\">\u003cmeta data-mint-head name=\"application-name\" content=\"TrueFoundry 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/truefoundry/DMuq4kzeTciVEGUc/_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/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/truefoundry/DMuq4kzeTciVEGUc/_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/truefoundry/DMuq4kzeTciVEGUc/_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/truefoundry/DMuq4kzeTciVEGUc/_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/truefoundry/DMuq4kzeTciVEGUc/_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/truefoundry/DMuq4kzeTciVEGUc/_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/truefoundry/DMuq4kzeTciVEGUc/_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/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Custom Endpoints - TrueFoundry Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"TrueFoundry offers an enterprise-grade AI Gateway combining LLM, MCP, and Agent Gateways—empowering businesses to connect, monitor, and govern agentic AI applications across providers from a unified control plane.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"TrueFoundry Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://www.truefoundry.com/docs/ai-gateway/custom-endpoints\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://assets.production.truefoundry.com/logo.svg\">\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=\"Custom Endpoints - TrueFoundry Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"TrueFoundry offers an enterprise-grade AI Gateway combining LLM, MCP, and Agent Gateways—empowering businesses to connect, monitor, and govern agentic AI applications across providers from a unified control plane.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://assets.production.truefoundry.com/logo.svg\">\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/truefoundry/DMuq4kzeTciVEGUc/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"TrueFoundry Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#4f46e5\">\u003clink data-mint-head rel=\"canonical\" href=\"https://www.truefoundry.com/docs/ai-gateway/custom-endpoints\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/ai-gateway/custom-endpoints.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://www.truefoundry.com/#organization\",\"name\":\"TrueFoundry Docs\",\"url\":\"https://www.truefoundry.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/truefoundry/e2uUimEwX30qkWxc/logo/light.svg?fit=max\u0026auto=format\u0026n=e2uUimEwX30qkWxc\u0026q=85\u0026s=6068d83664aeda0239bec2422657dd20\"}},{\"@type\":\"WebSite\",\"@id\":\"https://www.truefoundry.com#website\",\"name\":\"TrueFoundry Docs\",\"url\":\"https://www.truefoundry.com\",\"publisher\":{\"@id\":\"https://www.truefoundry.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://www.truefoundry.com/docs/ai-gateway/custom-endpoints#webpage\",\"url\":\"https://www.truefoundry.com/docs/ai-gateway/custom-endpoints\",\"name\":\"Custom Endpoints\",\"description\":\"Connect any HTTP service to the AI Gateway for centralized authentication, access control, and tracing.\",\"dateModified\":\"2026-11-13T07:27:51.532Z\",\"isPartOf\":{\"@id\":\"https://www.truefoundry.com#website\"},\"breadcrumb\":{\"@id\":\"https://www.truefoundry.com/docs/ai-gateway/custom-endpoints#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://www.truefoundry.com/docs/ai-gateway/custom-endpoints#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"LLM Gateway\",\"item\":\"https://www.truefoundry.com/docs/ai-gateway/truefoundry-managed\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Integrate Models\",\"item\":\"https://www.truefoundry.com/docs/ai-gateway/truefoundry-managed\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Custom Endpoints\",\"item\":\"https://www.truefoundry.com/docs/ai-gateway/custom-endpoints\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://www.truefoundry.com/docs/ai-gateway/custom-endpoints#article\",\"headline\":\"Custom Endpoints\",\"name\":\"Custom Endpoints\",\"description\":\"Connect any HTTP service to the AI Gateway for centralized authentication, access control, and tracing.\",\"url\":\"https://www.truefoundry.com/docs/ai-gateway/custom-endpoints\",\"mainEntityOfPage\":{\"@id\":\"https://www.truefoundry.com/docs/ai-gateway/custom-endpoints#webpage\"},\"image\":\"https://assets.production.truefoundry.com/logo.svg\",\"dateModified\":\"2026-11-13T07:27:51.532Z\",\"publisher\":{\"@id\":\"https://www.truefoundry.com/#organization\"},\"isPartOf\":{\"@id\":\"https://www.truefoundry.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"TrueFoundry Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"TrueFoundry Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/ai-gateway/custom-endpoints.md","siteName":"TrueFoundry Docs","nav":{"global":null,"tabs":[{"tab":"AI Gateway","groups":[{"group":"Get Started","pages":[{"title":"Introduction to AI Gateway","sidebarTitle":"AI Gateway Overview","href":"/docs/ai-gateway/intro-to-llm-gateway"},{"title":"Quick Start Guide: Setup \u0026 Integration","sidebarTitle":"Quick Start","href":"/docs/ai-gateway/quick-start"}]},{"group":"LLM Gateway","pages":[{"group":"Integrate Models","pages":[{"title":"TrueFoundry Managed Models","sidebarTitle":"TrueFoundry Managed Models","href":"/docs/ai-gateway/truefoundry-managed"},{"title":"Providers","sidebarTitle":"Supported Providers","href":"/docs/ai-gateway/supported-providers"},{"title":"OpenAI","sidebarTitle":"OpenAI Models","href":"/docs/ai-gateway/openai"},{"title":"Anthropic","sidebarTitle":"Anthropic","href":"/docs/ai-gateway/anthropic"},{"title":"AWS Claude Platform","sidebarTitle":"AWS Claude Platform","href":"/docs/ai-gateway/aws-claude-platform"},{"title":"AWS Bedrock","sidebarTitle":"AWS Bedrock","href":"/docs/ai-gateway/aws-bedrock"},{"title":"AWS Bedrock Mantle","sidebarTitle":"AWS Bedrock Mantle","href":"/docs/ai-gateway/aws-bedrock-mantle"},{"title":"AWS Sagemaker","sidebarTitle":"AWS Sagemaker","href":"/docs/ai-gateway/aws-sagemaker"},{"title":"Google Vertex","sidebarTitle":"Google Vertex AI","href":"/docs/ai-gateway/google-vertex"},{"title":"Google Gemini","sidebarTitle":"Google Gemini","href":"/docs/ai-gateway/google-gemini"},{"group":"Azure Models","pages":[{"title":"Choosing an Azure model integration","sidebarTitle":"Overview","href":"/docs/ai-gateway/azure-models-guide"},{"title":"Microsoft Foundry","sidebarTitle":"Microsoft Foundry","tag":"NEW","href":"/docs/ai-gateway/microsoft-foundry"},{"title":"Migrate to Microsoft Foundry","sidebarTitle":"Migrate to Microsoft Foundry","href":"/docs/ai-gateway/migrate-to-microsoft-foundry"},{"title":"Azure OpenAI","sidebarTitle":"Azure OpenAI","tag":"LEGACY","href":"/docs/ai-gateway/azure-openai"},{"title":"Azure Foundry","sidebarTitle":"Azure AI Foundry","tag":"LEGACY","href":"/docs/ai-gateway/azure-ai-foundry"},{"group":"Authentication","pages":[{"title":"Azure Entra ID Certificate Based Authentication","sidebarTitle":"Azure Certificate Auth","href":"/docs/ai-gateway/azure-entra-certificate-auth"},{"title":"Azure Entra ID Client Secret Based Authentication","sidebarTitle":"Azure Client Secret Auth","href":"/docs/ai-gateway/azure-entra-client-secret-auth"},{"title":"Azure Workload Identity Federation Authentication","sidebarTitle":"Azure Workload Identity","href":"/docs/ai-gateway/azure-entra-wif-auth"}]}]},{"title":"Databricks","sidebarTitle":"Databricks Models","href":"/docs/ai-gateway/databricks-models"},{"title":"Cohere","sidebarTitle":"Cohere Models","href":"/docs/ai-gateway/cohere"},{"title":"AI21","sidebarTitle":"AI21","href":"/docs/ai-gateway/ai21"},{"title":"Deepinfra","sidebarTitle":"Deepinfra Models","href":"/docs/ai-gateway/deepinfra"},{"title":"Groq","sidebarTitle":"Groq Models","href":"/docs/ai-gateway/groq"},{"title":"ElevenLabs","sidebarTitle":"ElevenLabs","href":"/docs/ai-gateway/elevenlabs"},{"title":"Deepgram","sidebarTitle":"Deepgram","href":"/docs/ai-gateway/deepgram"},{"title":"Cartesia","sidebarTitle":"Cartesia","href":"/docs/ai-gateway/cartesia"},{"title":"Smallest AI","sidebarTitle":"Smallest AI","href":"/docs/ai-gateway/smallest-ai"},{"title":"Mistral AI","sidebarTitle":"Mistral AI Models","href":"/docs/ai-gateway/mistral"},{"title":"Cloudera","sidebarTitle":"Cloudera Models","href":"/docs/ai-gateway/cloudera"},{"title":"OpenRouter","sidebarTitle":"OpenRouter","href":"/docs/ai-gateway/openrouter"},{"title":"Perplexity AI","sidebarTitle":"Perplexity Models","href":"/docs/ai-gateway/perplexity-ai"},{"title":"Together AI","sidebarTitle":"Together AI","href":"/docs/ai-gateway/together-ai"},{"title":"xAI","sidebarTitle":"xAI Models","href":"/docs/ai-gateway/xai"},{"title":"SambaNova","sidebarTitle":"SambaNova","href":"/docs/ai-gateway/sambanova"},{"title":"Cerebras","sidebarTitle":"Cerebras","href":"/docs/ai-gateway/cerebras"},{"title":"Wafer","sidebarTitle":"Wafer","href":"/docs/ai-gateway/wafer"},{"title":"Fireworks AI Model Provider for TrueFoundry AI Gateway","sidebarTitle":"Fireworks AI","href":"/docs/ai-gateway/fireworks-ai"},{"title":"Snowflake Cortex","sidebarTitle":"Snowflake Cortex","href":"/docs/ai-gateway/snowflake-cortex"},{"title":"Baseten","sidebarTitle":"Baseten","href":"/docs/ai-gateway/baseten"},{"title":"TypeSafe","sidebarTitle":"TypeSafe","description":"Add and configure TypeSafe decision models in TrueFoundry's AI Gateway.","href":"/docs/ai-gateway/typesafe"},{"group":"Custom Endpoints","root":{"title":"Custom Endpoints","sidebarTitle":"Custom Endpoints","href":"/docs/ai-gateway/custom-endpoints"},"expanded":false,"pages":[{"group":"Examples","pages":[{"title":"CoreWeave","sidebarTitle":"CoreWeave Models","description":"Proxy CoreWeave models (via W\u0026B Inference) through TrueFoundry's AI Gateway using Custom Endpoints.","href":"/docs/ai-gateway/coreweave-models"},{"title":"PipeShift","sidebarTitle":"PipeShift","description":"Add and configure PipeShift models in TrueFoundry's AI Gateway using Custom Endpoints.","href":"/docs/ai-gateway/pipeshift"},{"title":"SiliconFlow","sidebarTitle":"SiliconFlow","description":"Add and configure SiliconFlow models in TrueFoundry's AI Gateway using Custom Endpoints.","href":"/docs/ai-gateway/siliconflow"},{"title":"io.net","sidebarTitle":"io.net","description":"Add and configure io.net Intelligence models in TrueFoundry's AI Gateway using Custom Endpoints.","href":"/docs/ai-gateway/io-net"},{"title":"Resemble AI","sidebarTitle":"Resemble AI","description":"Add and configure Resemble AI Text-to-Speech (TTS) in TrueFoundry's AI Gateway using Custom Endpoints.","href":"/docs/ai-gateway/resemble-ai"},{"title":"Ringg.AI","sidebarTitle":"Ringg.AI","description":"Add and configure Ringg.AI Parrot Speech-to-Text (STT) in TrueFoundry's AI Gateway using Custom Endpoints.","href":"/docs/ai-gateway/ringg-ai"},{"title":"Crusoe","sidebarTitle":"Crusoe","description":"Add and configure Crusoe Managed Inference models in TrueFoundry's AI Gateway using Custom Endpoints.","href":"/docs/ai-gateway/crusoe"},{"title":"Jev (TypeSafe)","sidebarTitle":"Jev","description":"Connect TypeSafe's Jev model to TrueFoundry's AI Gateway using Custom Endpoints.","href":"/docs/ai-gateway/jev"},{"title":"SCX.ai","sidebarTitle":"SCX.ai","description":"Add and configure SCX.ai models in TrueFoundry's AI Gateway using Custom Endpoints.","href":"/docs/ai-gateway/scx-ai"}]}]},{"title":"Self-Hosted Models","sidebarTitle":"Self-Hosted Models","href":"/docs/ai-gateway/self-hosted-models"}]},{"group":"Supported APIs","pages":[{"group":"Chat Completions","root":{"title":"Chat Completions API (/chat/completions)","sidebarTitle":"Overview","href":"/docs/ai-gateway/chat-completions-overview"},"expanded":false,"directory":"accordion","pages":[{"title":"Chat Completions API (/chat/completions)","sidebarTitle":"Overview","href":"/docs/ai-gateway/chat-completions-overview"},{"title":"Chat Completions: Multimodal","sidebarTitle":"Multimodal","href":"/docs/ai-gateway/chat-completions-multimodal"},{"title":"Chat Completions: Tools \u0026 Signatures","sidebarTitle":"Tools","href":"/docs/ai-gateway/chat-completions-tools"},{"title":"Chat Completions: Structured Outputs","sidebarTitle":"Structured Outputs","href":"/docs/ai-gateway/chat-completions-structured-outputs"},{"title":"Chat Completions: Caching \u0026 Reasoning","sidebarTitle":"Caching \u0026 Reasoning","href":"/docs/ai-gateway/chat-completions-advanced"},{"title":"Chat Completions: Extended Thinking","sidebarTitle":"Extended Thinking","href":"/docs/ai-gateway/chat-completions-extended-thinking"}]},{"title":"Embeddings API (/embeddings)","sidebarTitle":"Embeddings","href":"/docs/ai-gateway/embed"},{"title":"Batch API (/batches)","sidebarTitle":"Batch Predictions","href":"/docs/ai-gateway/batch-predictions-with-truefoundry-llm-gateway"},{"title":"Finetune API (/fine_tuning)","sidebarTitle":"Finetuning","href":"/docs/ai-gateway/finetune"},{"title":"Responses API (/responses)","sidebarTitle":"Responses API","href":"/docs/ai-gateway/responses-api"},{"title":"Image Generation API (/images/generations)","sidebarTitle":"Image Generation","href":"/docs/ai-gateway/image-generation"},{"title":"Image Edit API (/images/edits)","sidebarTitle":"Image Edit","href":"/docs/ai-gateway/image-edit"},{"title":"Image Variation API (/images/variations)","sidebarTitle":"Image Variation","href":"/docs/ai-gateway/image-variation"},{"title":"Video Generation API (/videos-proxy)","sidebarTitle":"Video Generation","href":"/docs/ai-gateway/video-generation"},{"title":"Text to Speech API","sidebarTitle":"Text to Speech","href":"/docs/ai-gateway/text-to-speech"},{"title":"Audio Translation API","sidebarTitle":"Audio Translation","href":"/docs/ai-gateway/audio-translation"},{"title":"Speech to Text API","sidebarTitle":"Speech to Text","href":"/docs/ai-gateway/audio-transcription"},{"group":"Live / Realtime API","root":{"title":"Live / Realtime API (/live)","sidebarTitle":"Overview","href":"/docs/ai-gateway/live-api"},"expanded":false,"directory":"accordion","pages":[{"title":"Live / Realtime API (/live)","sidebarTitle":"Overview","href":"/docs/ai-gateway/live-api"},{"title":"Live API: Code Snippets","sidebarTitle":"Code Snippets","href":"/docs/ai-gateway/live-api-code-snippets"},{"title":"Live API: Tool Calling","sidebarTitle":"Tool Calling","href":"/docs/ai-gateway/live-api-tool-calling"},{"title":"OpenAI Realtime with WebRTC","sidebarTitle":"WebRTC (OpenAI)","href":"/docs/ai-gateway/live-api-webrtc"},{"title":"Amazon Nova Sonic (Bedrock)","sidebarTitle":"Nova Sonic (Bedrock)","href":"/docs/ai-gateway/live-api-nova-sonic"}]},{"title":"Files API (/files)","sidebarTitle":"Files API","href":"/docs/ai-gateway/file-endpoints"},{"title":"Rerank API (/rerank)","sidebarTitle":"Rerank API","href":"/docs/ai-gateway/rerank"},{"title":"Moderation API (/moderations)","sidebarTitle":"Moderation API","href":"/docs/ai-gateway/moderation"},{"title":"Compaction API (/responses/compact)","sidebarTitle":"Compaction API","href":"/docs/ai-gateway/compaction"},{"title":"Messages API (/messages)","sidebarTitle":"Messages API","href":"/docs/ai-gateway/messages-overview"},{"title":"Decisions API (/v1/decisions, /v1/systemone)","sidebarTitle":"Decisions API","href":"/docs/ai-gateway/decisions"},{"title":"Proxy API (/proxy)","sidebarTitle":"Proxy API","href":"/docs/ai-gateway/proxy-api"}]},{"group":"Making LLM Requests","pages":[{"title":"Making Your First Request","sidebarTitle":"Making Your First Request","href":"/docs/ai-gateway/making-llm-requests-via-gateway"},{"title":"Authentication","sidebarTitle":"Authentication","href":"/docs/ai-gateway/authentication"},{"title":"Custom Metadata and Headers","sidebarTitle":"Metadata \u0026 Headers","href":"/docs/ai-gateway/request-headers"},{"title":"Native SDK Support","sidebarTitle":"Native SDK Support","href":"/docs/ai-gateway/native-sdk-support"},{"title":"Model Discovery","sidebarTitle":"Model Discovery","href":"/docs/ai-gateway/model-discovery"}]},{"group":"Set Up Your IDEs","pages":[{"title":"Set Up Your IDEs","sidebarTitle":"Overview","href":"/docs/ai-gateway/personal-setup"},{"title":"Claude Code","href":"/docs/ai-gateway/ide-setup/claude-code"},{"title":"Codex (CLI \u0026 Desktop)","href":"/docs/ai-gateway/ide-setup/codex"},{"title":"Claude Desktop","href":"/docs/ai-gateway/ide-setup/claude-desktop"},{"title":"Cursor","href":"/docs/ai-gateway/ide-setup/cursor"},{"title":"VS Code","href":"/docs/ai-gateway/ide-setup/vscode"},{"title":"GitHub Copilot CLI","href":"/docs/ai-gateway/ide-setup/copilot-cli"},{"title":"Gemini CLI","href":"/docs/ai-gateway/ide-setup/gemini-cli"},{"title":"OpenCode","href":"/docs/ai-gateway/ide-setup/opencode"},{"title":"Goose","href":"/docs/ai-gateway/ide-setup/goose"},{"title":"Qwen Code","href":"/docs/ai-gateway/ide-setup/qwen-code"},{"title":"Grok Build","href":"/docs/ai-gateway/ide-setup/grok-build"},{"title":"Pi","href":"/docs/ai-gateway/ide-setup/pi"}]},{"group":"Deploy with MDM","pages":[{"title":"Deploy coding agents with MDM","sidebarTitle":"Overview","href":"/docs/ai-gateway/mdm-setup"},{"title":"Claude Code and Claude Desktop with MDM","sidebarTitle":"Claude Code \u0026 Desktop","href":"/docs/ai-gateway/mdm/claude"},{"title":"Codex with MDM","sidebarTitle":"Codex","href":"/docs/ai-gateway/mdm/codex"},{"title":"MDM configuration reference","sidebarTitle":"Configuration reference","href":"/docs/ai-gateway/mdm/configuration-reference"}]},{"title":"TrueFoundry AI Gateway Playground","sidebarTitle":"AI Gateway Playground","href":"/docs/ai-gateway/playground-overview"},{"group":"Virtual Models","pages":[{"title":"Virtual Models","sidebarTitle":"Overview","href":"/docs/ai-gateway/virtual-model"},{"title":"Create a Virtual Model","sidebarTitle":"Create a Virtual Model","href":"/docs/ai-gateway/virtual-model-advanced"},{"title":"Auto Routing","sidebarTitle":"Auto Routing","href":"/docs/ai-gateway/auto-routing"}]},{"title":"Access Control","sidebarTitle":"Access Control","href":"/docs/ai-gateway/gateway-access-control"},{"group":"Policies","pages":[{"title":"Rate Limiting","sidebarTitle":"Rate Limiting","href":"/docs/ai-gateway/ratelimiting-v2"},{"title":"Rate Limiting (V1, deprecated)","sidebarTitle":"Rate Limiting (V1)","hidden":true,"href":"/docs/ai-gateway/ratelimiting"},{"title":"Budget Limiting","sidebarTitle":"Budget Limiting","href":"/docs/ai-gateway/budget-limiting-v2"},{"title":"Budget Usage Recovery","sidebarTitle":"Budget Usage Recovery","href":"/docs/ai-gateway/budget-usage-recovery"},{"title":"Budget Limiting (V1, deprecated)","sidebarTitle":"Budget Limiting (V1)","hidden":true,"href":"/docs/ai-gateway/budgetlimiting"},{"title":"Logging Configuration","sidebarTitle":"Logging Config","href":"/docs/ai-gateway/logging-config"}]},{"title":"Caching (Exact and Semantic)","sidebarTitle":"Caching (Exact and Semantic)","href":"/docs/ai-gateway/caching"},{"title":"Cost Tracking","sidebarTitle":"Cost Tracking","href":"/docs/ai-gateway/cost-tracking"},{"title":"Cost Savings","sidebarTitle":"Cost Savings","href":"/docs/ai-gateway/cost-savings"},{"group":"Extras","pages":[{"title":"Session Management","sidebarTitle":"Session Management","href":"/docs/ai-gateway/session-management"},{"title":"Log Feedback on Requests","sidebarTitle":"Log Feedback","href":"/docs/ai-gateway/feedback-for-traces"},{"title":"First Chunk Gate for Streaming","sidebarTitle":"First Chunk Gate","href":"/docs/ai-gateway/first-chunk-gate"},{"title":"Anthropic Stream Overload Fallback","sidebarTitle":"Anthropic Stream Fallback","href":"/docs/ai-gateway/anthropic-stream-overload-fallback"}]}]},{"group":"MCP Registry and Gateway","pages":[{"title":"TrueFoundry MCP Gateway","sidebarTitle":"Overview","href":"/docs/ai-gateway/mcp/mcp-overview"},{"title":"MCP Server: Getting Started","sidebarTitle":"Getting Started","href":"/docs/ai-gateway/mcp/mcp-server-getting-started"},{"title":"MCP Protocol Support","sidebarTitle":"Protocol Support","href":"/docs/ai-gateway/mcp/mcp-protocol-support"},{"group":"Authentication and Security","root":{"title":"Authentication and Security","sidebarTitle":"Authentication and Security","href":"/docs/ai-gateway/mcp/mcp-gateway-auth-security"},"pages":[{"title":"Authentication and Security","sidebarTitle":"Authentication and Security","href":"/docs/ai-gateway/mcp/mcp-gateway-auth-security"},{"title":"Auth Overrides","sidebarTitle":"Auth Overrides","href":"/docs/ai-gateway/mcp/mcp-server-auth-overrides"},{"group":"Outbound auth integrations","pages":[{"title":"Okta app setup","sidebarTitle":"Okta App Setup","href":"/docs/ai-gateway/mcp/okta-app-setup"},{"title":"Microsoft Entra app setup","sidebarTitle":"Microsoft Entra App Setup","href":"/docs/ai-gateway/mcp/entra-app-setup"},{"title":"Microsoft Entra On-Behalf-Of (OBO) for MCP","sidebarTitle":"Microsoft Entra OBO App Setup","href":"/docs/ai-gateway/mcp/mcp-server-oauth-azure-obo"},{"title":"Register an AWS Bedrock AgentCore MCP Server","sidebarTitle":"AgentCore (AWS SigV4)","href":"/docs/ai-gateway/mcp/mcp-server-agentcore-sigv4"}]}]},{"title":"MCP Troubleshooting Guide","sidebarTitle":"Troubleshooting Guide","href":"/docs/ai-gateway/mcp/mcp-troubleshooting-guide"},{"title":"MCP Tool Approvals","sidebarTitle":"Tool Approvals","href":"/docs/ai-gateway/mcp/mcp-tool-approval"},{"title":"MCP Tool Management","sidebarTitle":"Tool Management","href":"/docs/ai-gateway/mcp/mcp-tool-management"},{"title":"Connect MCP Servers from Your IDE","sidebarTitle":"Connect MCP Servers from Your IDE","href":"/docs/ai-gateway/mcp/connect-mcp-from-ide"},{"title":"TrueFoundry Managed MCPs","sidebarTitle":"TrueFoundry Managed MCPs","href":"/docs/ai-gateway/mcp/tfy-managed-mcp-server"},{"title":"Virtual MCP Server","sidebarTitle":"Virtual MCP Server","href":"/docs/ai-gateway/mcp/virtual-mcp-server"},{"title":"OpenAPI to MCP Server","sidebarTitle":"OpenAPI to MCP Server","href":"/docs/ai-gateway/mcp/openapi-mcp-server"},{"title":"Hosted Stdio-based MCP Server","sidebarTitle":"Hosted Stdio-based MCP Server","href":"/docs/ai-gateway/mcp/stdio-mcp-server"},{"group":"MCP Server Guides","pages":[{"group":"Creating MCP Servers","pages":[{"title":"Create a Basic Calculator MCP Server","sidebarTitle":"Basic Calculator MCP Server","href":"/docs/ai-gateway/mcp/create-calculator-mcp-server"},{"title":"Add Okta OAuth to a Calculator MCP Server","sidebarTitle":"Okta OAuth MCP server","href":"/docs/ai-gateway/mcp/mcp-server-oauth-okta"},{"title":"Create an OAuth MCP Server with Azure Entra ID","sidebarTitle":"Azure Entra ID OAuth MCP Server","href":"/docs/ai-gateway/mcp/mcp-server-oauth-azure"}]}]}]},{"group":"Skills Registry","pages":[{"title":"AI Gateway Skills Registry","sidebarTitle":"Overview","href":"/docs/ai-gateway/skills/skills-registry"},{"title":"Create, Manage, and Use Skills","sidebarTitle":"Create, Manage and Use Skills","href":"/docs/ai-gateway/skills/getting-started"}]},{"group":"Prompt Registry","pages":[{"title":"Prompt Management","sidebarTitle":"Create, Manage and Use Prompts","href":"/docs/ai-gateway/prompt-management"}]},{"group":"Guardrails and Security","pages":[{"title":"AI Gateway Guardrails Overview","sidebarTitle":"Overview","href":"/docs/ai-gateway/guardrails-overview"},{"title":"AI Gateway Guardrails: Quick Start","sidebarTitle":"Getting Started","href":"/docs/ai-gateway/guardrails-getting-started"},{"title":"Configure Guardrail Policies","sidebarTitle":"Configure Guardrail Policies","href":"/docs/ai-gateway/guardrails-configuration"},{"title":"Guardrails Best Practices","sidebarTitle":"Best Practices","href":"/docs/ai-gateway/guardrails-best-practices"},{"group":"TrueFoundry Guardrails","root":{"title":"TrueFoundry Guardrails","sidebarTitle":"Overview","href":"/docs/ai-gateway/truefoundry-guardrails"},"pages":[{"title":"TrueFoundry Guardrails","sidebarTitle":"Overview","href":"/docs/ai-gateway/truefoundry-guardrails"},{"title":"Secrets Detection Guardrail","sidebarTitle":"Secrets Detection","href":"/docs/ai-gateway/secrets-detection"},{"title":"Code Safety Linter Guardrail","sidebarTitle":"Code Safety Linter","href":"/docs/ai-gateway/code-safety-linter"},{"title":"SQL Sanitizer Guardrail","sidebarTitle":"SQL Sanitizer","href":"/docs/ai-gateway/sql-sanitizer"},{"title":"Regex Pattern Match Guardrail","sidebarTitle":"Regex Pattern Match","href":"/docs/ai-gateway/regex-pattern-matching"},{"title":"Prompt Injection Guardrail","sidebarTitle":"Prompt Injection","href":"/docs/ai-gateway/tfy-prompt-injection"},{"title":"PII/PHI Detection Guardrail","sidebarTitle":"PII/PHI","href":"/docs/ai-gateway/tfy-pii"},{"title":"Content Moderation Guardrail","sidebarTitle":"Content Moderation","href":"/docs/ai-gateway/tfy-content-moderation"},{"title":"Metadata Validation Guardrail","sidebarTitle":"Metadata Validation","href":"/docs/ai-gateway/metadata-validation"},{"title":"Cedar Guardrails","sidebarTitle":"Cedar Guardrails","href":"/docs/ai-gateway/cedar-guardrails"},{"title":"OPA Guardrails","sidebarTitle":"OPA Guardrails","href":"/docs/ai-gateway/opa-guardrails"}]},{"group":"External Providers","pages":[{"title":"Akto Integration","sidebarTitle":"Akto","href":"/docs/ai-gateway/akto"},{"title":"Arthur AI","sidebarTitle":"Arthur AI","href":"/docs/ai-gateway/arthur-ai"},{"title":"AWS Bedrock Guardrail Integration","sidebarTitle":"AWS Bedrock Guardrail","href":"/docs/ai-gateway/bedrock-guardrails"},{"title":"Azure Content Safety Guardrail Integration","sidebarTitle":"Azure Content Safety","href":"/docs/ai-gateway/azure-content-safety"},{"title":"Azure PII Guardrail Integration","sidebarTitle":"Azure PII","href":"/docs/ai-gateway/azure-pii"},{"title":"Azure Prompt Shield Guardrail Integration","sidebarTitle":"Azure Prompt Shield","href":"/docs/ai-gateway/azure-prompt-shield"},{"title":"Bigeye","sidebarTitle":"Bigeye","href":"/docs/ai-gateway/bigeye"},{"title":"CrowdStrike AIDR Integration","sidebarTitle":"CrowdStrike AIDR","href":"/docs/ai-gateway/crowdstrike"},{"title":"Cato Networks","sidebarTitle":"Cato Networks","href":"/docs/ai-gateway/cato-networks"},{"title":"Cisco AI Defense Integration","sidebarTitle":"Cisco AI Defense","href":"/docs/ai-gateway/cisco-ai-defense"},{"title":"DeepKeep AI Firewall","sidebarTitle":"DeepKeep","href":"/docs/ai-gateway/deepkeep"},{"title":"Enkrypt AI Guardrail Integration","sidebarTitle":"Enkrypt AI","href":"/docs/ai-gateway/enkrypt-ai"},{"title":"F5 AI Security (CalypsoAI) Integration","sidebarTitle":"F5 AI Security","href":"/docs/ai-gateway/f5-calypsoai"},{"title":"Fiddler Integration","sidebarTitle":"Fiddler","href":"/docs/ai-gateway/fiddler"},{"title":"Fireworks Safety Model Guardrail for TrueFoundry AI Gateway","sidebarTitle":"Fireworks","href":"/docs/ai-gateway/fireworks"},{"title":"Google Model Armor Guardrail Integration","sidebarTitle":"Google Model Armor","href":"/docs/ai-gateway/google-model-armor"},{"title":"Gray Swan Cygnal","sidebarTitle":"Gray Swan Cygnal","href":"/docs/ai-gateway/grayswan-cygnal"},{"title":"Guardrails AI Integration","sidebarTitle":"Guardrails AI","href":"/docs/ai-gateway/guardrails-ai"},{"title":"HiddenLayer Integration","sidebarTitle":"HiddenLayer","href":"/docs/ai-gateway/hiddenlayer"},{"title":"CoreWeave Weave Guardrails Integration","sidebarTitle":"CoreWeave Guardrails","href":"/docs/ai-gateway/coreweave-weave-guardrails"},{"title":"Lasso Security","sidebarTitle":"Lasso Security","href":"/docs/ai-gateway/lasso-security"},{"title":"Noma Security","sidebarTitle":"Noma Security","href":"/docs/ai-gateway/noma-security"},{"title":"NVIDIA NeMo Guardrails Integration","sidebarTitle":"NVIDIA NeMo","href":"/docs/ai-gateway/nvidia-nemo"},{"title":"OpenAI Moderation Integration","sidebarTitle":"OpenAI Moderation","href":"/docs/ai-gateway/openai-moderations"},{"title":"Onyx Security","sidebarTitle":"Onyx Security","href":"/docs/ai-gateway/onyx-security"},{"title":"Palo Alto Prisma AIRS Integration","sidebarTitle":"Palo Alto Prisma AIRS","href":"/docs/ai-gateway/palo-alto-airs"},{"title":"Patronus AI Integration","sidebarTitle":"Patronus AI","href":"/docs/ai-gateway/patronus"},{"title":"Pillar Security Integration","sidebarTitle":"Pillar Security","href":"/docs/ai-gateway/pillar-security"},{"title":"Straiker","sidebarTitle":"Straiker","href":"/docs/ai-gateway/straiker"},{"title":"TrojAI DEFEND Integration","sidebarTitle":"TrojAI","href":"/docs/ai-gateway/trojai"},{"title":"Verra","sidebarTitle":"Verra","href":"/docs/ai-gateway/verra"},{"title":"Zscaler AI Guard guardrail for prompts and responses","sidebarTitle":"Zscaler AI Guard","href":"/docs/ai-gateway/zscaler-ai-guard"}]},{"title":"Custom Guardrail/Plugins Configuration","sidebarTitle":"Bring your own Guardrail / Plugin","href":"/docs/ai-gateway/custom-guardrails"}]},{"group":"Observability","pages":[{"title":"Metrics Dashboard","sidebarTitle":"Metrics Dashboard","href":"/docs/ai-gateway/analytics"},{"title":"Request Logging","sidebarTitle":"Request Logging","href":"/docs/ai-gateway/request-logging"},{"title":"Configure Data Access","sidebarTitle":"Configure Data Access","href":"/docs/ai-gateway/data-access"},{"title":"Configure Data Routing","sidebarTitle":"Configure Data Routing","href":"/docs/ai-gateway/data-routing"},{"group":"Export Logs and Metrics","pages":[{"title":"Export OpenTelemetry Data","sidebarTitle":"Export via OpenTelemetry","href":"/docs/ai-gateway/export-opentelemetry-data"},{"title":"Prometheus Grafana Integration","sidebarTitle":"Prometheus \u0026 Grafana","href":"/docs/ai-gateway/prometheus-grafana-integration"}]},{"group":"API Access to Metrics","expanded":false,"pages":[{"title":"Model Metrics","sidebarTitle":"Model Metrics","href":"/docs/ai-gateway/fetch-model-metrics"},{"title":"MCP Metrics","sidebarTitle":"MCP Metrics","href":"/docs/ai-gateway/fetch-mcp-metrics"},{"title":"Guardrail Metrics","sidebarTitle":"Guardrail Metrics","href":"/docs/ai-gateway/fetch-guardrail-metrics"},{"title":"Cache Metrics","sidebarTitle":"Cache Metrics","href":"/docs/ai-gateway/fetch-cache-metrics"},{"title":"Routing Metrics","sidebarTitle":"Routing Metrics","href":"/docs/ai-gateway/fetch-routing-metrics"},{"title":"Agent Metrics","sidebarTitle":"Agent Metrics","href":"/docs/ai-gateway/fetch-agent-metrics"}]},{"group":"API Access to Logs","root":{"title":"API Access to Logs","sidebarTitle":"Overview","href":"/docs/ai-gateway/fetch-request-logs"},"expanded":false,"directory":"accordion","pages":[{"title":"API Access to Logs","sidebarTitle":"Overview","href":"/docs/ai-gateway/fetch-request-logs"},{"title":"Request Logs: Trace Inspection","sidebarTitle":"Trace Inspection","href":"/docs/ai-gateway/fetch-request-logs-trace-inspection"},{"title":"Request Logs: Filtering","sidebarTitle":"Filtering","href":"/docs/ai-gateway/fetch-request-logs-filtering"},{"group":"Use Cases","expanded":false,"pages":[{"title":"Request Logs: Common Use Cases","sidebarTitle":"Basic Queries","href":"/docs/ai-gateway/fetch-request-logs-use-cases"},{"title":"Request Logs: Advanced Queries","sidebarTitle":"Advanced Queries","href":"/docs/ai-gateway/fetch-request-logs-use-cases-advanced"}]},{"group":"Span Attributes","expanded":false,"pages":[{"title":"Request Logs: Span Attributes","sidebarTitle":"TrueFoundry Attributes","href":"/docs/ai-gateway/fetch-request-logs-span-attributes"},{"title":"GenAI Span Attributes","sidebarTitle":"GenAI Attributes","href":"/docs/ai-gateway/fetch-request-logs-span-attributes-genai"}]}]}]},{"group":"Deployment","pages":[{"title":"Gateway Architecture","sidebarTitle":"Architecture","href":"/docs/ai-gateway/gateway-architecture"},{"title":"Deployment Options","sidebarTitle":"Deployment Options","href":"/docs/ai-gateway/modes-of-deployment"},{"title":"Globally Distributed SAAS Gateway","sidebarTitle":"Globally Distributed SAAS","href":"/docs/ai-gateway/globally-distributed-saas"},{"title":"Connect Private Models and MCP Servers","sidebarTitle":"Connect Private Endpoints","href":"/docs/ai-gateway/connect-private-models-mcp-servers"},{"title":"Install LLM Gateway (Standalone)","sidebarTitle":"Install AI Gateway","href":"/docs/ai-gateway/install-only-llm-gateway"}]},{"group":"Admin Guide","pages":[{"title":"Setup AI Gateway in Your Organization","sidebarTitle":"Setup AI Gateway in Org","href":"/docs/ai-gateway/setup-ai-gateway-in-org"},{"title":"Govern All AI Traffic Through the AI Gateway","sidebarTitle":"Govern All AI Traffic","href":"/docs/ai-gateway/govern-traffic-through-ai-gateway"},{"title":"Setup Dev, Staging and Prod Environments","sidebarTitle":"Setup Multiple Environments","href":"/docs/ai-gateway/setup-multiple-environments"},{"title":"Use Secret Manager in Integrations","sidebarTitle":"Use Secret Manager","href":"/docs/ai-gateway/secret-manager-in-ai-gateway"}]},{"group":"Chat","pages":[{"title":"Chat Completions","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /chat/completions","href":"/docs/api-reference/chat/chat-completions"}]},{"group":"Messages","pages":[{"title":"Messages","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /messages","href":"/docs/api-reference/messages/messages"},{"title":"Count Tokens","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /messages/count_tokens","href":"/docs/api-reference/messages/count-tokens"}]},{"group":"Embeddings","pages":[{"title":"Generate Embeddings","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /embeddings","href":"/docs/api-reference/embeddings/generate-embeddings"}]},{"group":"Rerank","pages":[{"title":"Rerank Documents","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /v2/rerank","href":"/docs/api-reference/rerank/rerank-documents"}]},{"group":"Responses","pages":[{"title":"List Model Response Input Items","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /responses/{id}/input_items","href":"/docs/api-reference/responses/list-model-response-input-items"},{"title":"Get Model Response","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /responses/{id}","href":"/docs/api-reference/responses/get-model-response"},{"title":"Delete Model Response","deprecated":null,"version":null,"openapi":"/gateway-openapi.json delete /responses/{id}","href":"/docs/api-reference/responses/delete-model-response"},{"title":"Model Responses","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /responses","href":"/docs/api-reference/responses/model-responses"},{"title":"Model Responses Compact","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /responses/compact","href":"/docs/api-reference/responses/model-responses-compact"}]},{"group":"Image","pages":[{"title":"Generate Images","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /images/generations","href":"/docs/api-reference/image/generate-images"},{"title":"Edit Images","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /images/edits","href":"/docs/api-reference/image/edit-images"},{"title":"Create Image Variation","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /images/variations","href":"/docs/api-reference/image/create-image-variation"}]},{"group":"Audio","pages":[{"title":"Transcribe Audio","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /audio/transcriptions","href":"/docs/api-reference/audio/transcribe-audio"},{"title":"Translate Audio","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /audio/translations","href":"/docs/api-reference/audio/translate-audio"},{"title":"Generate Speech","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /audio/speech","href":"/docs/api-reference/audio/generate-speech"}]},{"group":"Batch","pages":[{"title":"List Batches","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /batches","href":"/docs/api-reference/batch/list-batches"},{"title":"Create Batch","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /batches","href":"/docs/api-reference/batch/create-batch"},{"title":"Get Batch","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /batches/{id}","href":"/docs/api-reference/batch/get-batch"},{"title":"Get Batch Output","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /batches/{id}/output","href":"/docs/api-reference/batch/get-batch-output"},{"title":"Cancel Batch","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /batches/{id}/cancel","href":"/docs/api-reference/batch/cancel-batch"}]},{"group":"Files","pages":[{"title":"List Files","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /files","href":"/docs/api-reference/files/list-files"},{"title":"Upload File","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /files","href":"/docs/api-reference/files/upload-file"},{"title":"Get File","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /files/{id}","href":"/docs/api-reference/files/get-file"},{"title":"Delete File","deprecated":null,"version":null,"openapi":"/gateway-openapi.json delete /files/{id}","href":"/docs/api-reference/files/delete-file"},{"title":"Get File Content","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /files/{id}/content","href":"/docs/api-reference/files/get-file-content"}]},{"group":"Fine-tuning","pages":[{"title":"List Fine-tuning Jobs","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /fine_tuning/jobs","href":"/docs/api-reference/fine-tuning/list-fine-tuning-jobs"},{"title":"Create Fine-tuning Job","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /fine_tuning/jobs","href":"/docs/api-reference/fine-tuning/create-fine-tuning-job"},{"title":"Retrieve Fine-tuning Job","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /fine_tuning/jobs/{fine_tuning_job_id}","href":"/docs/api-reference/fine-tuning/retrieve-fine-tuning-job"},{"title":"Cancel Fine-tuning Job","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /fine_tuning/jobs/{fine_tuning_job_id}/cancel","href":"/docs/api-reference/fine-tuning/cancel-fine-tuning-job"}]},{"group":"Moderations","pages":[{"title":"Create Moderation","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /moderations","href":"/docs/api-reference/moderations/create-moderation"}]},{"group":"Video","pages":[{"title":"Poll or Download Video","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /videos-proxy/{providerAccountName}/{nativePath}","href":"/docs/api-reference/video/poll-or-download-video"},{"title":"Generate Video","deprecated":null,"version":null,"openapi":"/gateway-openapi.json post /videos-proxy/{providerAccountName}/{nativePath}","href":"/docs/api-reference/video/generate-video"}]},{"group":"Models","pages":[{"title":"List available models","deprecated":null,"version":null,"openapi":"/gateway-openapi.json get /models","href":"/docs/api-reference/models/list-available-models"}]}]},{"tab":"Agent Platform","pages":[{"title":"Agent Platform","href":"/docs/agent-platform/agent-harness/overview"}]},{"tab":"Platform","pages":[{"title":"Platform","href":"/docs/platform/overview"}]},{"tab":"AI Deployment","pages":[{"title":"AI Deployment","href":"/docs/ai-deployment-overview"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/docs/truefoundry_sdk"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/docs/ai-gateway/ecosystem"}]},{"tab":"Changelog","groups":[{"group":" ","pages":[{"title":"Changelog","href":"/docs/changelog"},{"group":"Announcements","pages":[{"title":"Deprecation of Rate Limiting V1 — 2nd November, 2026","href":"/docs/change-announcements/deprecation-of-rate-limiting-v1"},{"title":"Move to Named Guardrail Policies — v0.179","href":"/docs/change-announcements/named-guardrails-config-v0.179"},{"title":"Perplexity Models Move to the Agent API","href":"/docs/change-announcements/perplexity-agent-api-migration"},{"title":"Plan-Based Feature Gating — v0.174.0","href":"/docs/change-announcements/plan-based-feature-gating-v0.174.0"},{"title":"Agent Builder Moving to Trueforge \u0026 Agent APIs Deprecated — v0.172","href":"/docs/change-announcements/agents-moving-to-trueforge"},{"title":"Removing Collaborators from Resources — v0.172.0","href":"/docs/change-announcements/removing-collaborators-from-resources"},{"title":"Deprecation of MCP tool_settings — 26th October, 2026","href":"/docs/change-announcements/deprecation-of-mcp-tool-settings"},{"title":"Deprecation of truefoundry \u003c 0.17.0 and truefoundry-sdk \u003c 0.4.0 packages","sidebarTitle":"Deprecation of truefoundry \u003c 0.17.0 and truefoundry-sdk \u003c 0.4.0 packages - 19th August 2026","href":"/docs/change-announcements/deprecation-of-truefoundry-below-0.17-and-api-ml"},{"title":"Minimum Python Version Raised to 3.10 — truefoundry v0.17.0","href":"/docs/change-announcements/python-3.10-minimum-truefoundry-cli-v0.17.0"},{"title":"Budget Limiting V2 — v0.158.0","href":"/docs/change-announcements/budget-limiting-v2-v0.158.0"},{"title":"Deprecation of MCP Servers APIs — 30th September, 2026","href":"/docs/change-announcements/deprecation-of-mcp-servers-v1-apis"},{"title":"Deprecation of Images and Plots in Job Runs — v0.156.0","href":"/docs/change-announcements/deprecation-of-images-and-plots-in-job-runs-v0.156.0"},{"title":"Moving to External Secrets Operator for Secrets Management — v0.151.5","href":"/docs/change-announcements/moving-to-eso-for-secret-management-v0.151.5"},{"title":"MCP DCR client_id \u0026 Redirect URL Validation — v0.148","href":"/docs/change-announcements/mcp-dcr-client-id-validation-v0.148"},{"title":"Deprecation of Routing Config","href":"/docs/change-announcements/deprecation-of-routing-config"},{"title":"Identity and Access Revamp — v0.143","href":"/docs/change-announcements/identity-and-access-revamp-v0.143"},{"title":"AI Gateway Metrics Rename — v0.136","href":"/docs/change-announcements/refactoring-of-ai-gateway-metrics"},{"title":"Deprecation of MCP Servers in Prompts","href":"/docs/change-announcements/deprecation-of-mcp-servers-in-prompts"},{"title":"Deprecation of Common Tools in Playground and Settings — v0.135","href":"/docs/change-announcements/deprecation-of-common-tools-v0-135-0"},{"title":"x-tfy-routing-config Header Removal — v0.133","href":"/docs/change-announcements/routing-config-header-removal-v0.133"},{"title":"Simplified GitOps CI/CD with tfy apply — v0.132","href":"/docs/change-announcements/simplified-gitops-cicd-v0.132"},{"title":"Legacy MCP OAuth Routes Removal — v0.134","href":"/docs/change-announcements/legacy-mcp-oauth-routes-removal"},{"title":"MCP Gateway URL and Transport Changes — v0.130","href":"/docs/change-announcements/mcp-gateway-url-transport-v0.130"},{"title":"Gemini CLI Model Registration Requirement — v0.118","href":"/docs/change-announcements/gemini-cli-model-registration-v0.118"},{"title":"Guardrails YAML Schema Change — v0.116","href":"/docs/change-announcements/guardrails-yaml-schema-change-v0.116"},{"title":"MCP Server Groups Removal — v0.112","href":"/docs/change-announcements/mcp-server-groups-removal-v0.112"}]}]}]}]},"basePath":"","title":"Custom Endpoints - TrueFoundry Docs","deploymentId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","buildId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-otd7Y6S-.js","DynamicMarkdown-QJ7LkRm3.js","zoom-image-lightbox-BodsesVp.js","lightbox-handle-r17bVUz3.js"]}