Region routing
Region routing decides where your requests may be served. You set it for your account, for an API key, or for a single request, and it either keeps your requests inside the regions you list or keeps them out of the regions you list.
"region_routing": { "mode": "include", "regions": ["us", "eu"] }
| Mode | What it does |
|---|---|
include | Only sellers whose host runs only in the listed regions can serve you. |
exclude | Only sellers whose host never runs in the listed regions can serve you. |
includeWhat it does · Only sellers whose host runs only in the listed regions can serve you.excludeWhat it does · Only sellers whose host never runs in the listed regions can serve you.The regions are us, eu (EU and EEA member states; the UK and Switzerland don't count as eu) and cn (mainland China).
Where a seller runs
A seller's region comes from where its provider says inference runs for the host the seller uses, not from where the company is based. Many providers make no promise on their main endpoint: OpenAI, Anthropic, Mistral, Together, Fireworks, OpenRouter and Google's Gemini API all say a request may run in any region. Resellers, aggregators and decentralised networks usually don't say where your request ends up.
A seller whose inference location isn't stated never serves a request with region routing, in either mode. So exclude: ["cn"] also keeps you away from a reseller that could pass your request on to a China-hosted provider. Fewer sellers qualify, but none of them can leave the regions you chose.
A seller's region is our classification from the provider's own documents and terms. It isn't a provider guarantee, and it can change. Amazon Bedrock offers take their region from the AWS region in their endpoint.
GET /api/markets/{model} shows each offer's regions in possible_regions (any of us, eu, cn, plus elsewhere when the host may also run outside them) and the countries the provider states in region_countries. An offer without possible_regions has no stated location.
Setting region routing
There are three places to set it, and all three apply to a request: the regions you include must be in every include you set, and a region excluded anywhere is excluded.
| Where | Covers | How |
|---|---|---|
| The account | every key in the account | {"preferences": {"region_routing": {...}}} on PUT /v1/buyer/preferences |
| A key | every request made with that key | scope.region_routing on POST /v1/keys and PATCH /v1/keys/{id} |
| A request | that request only | "region_routing": {...} in the request body |
{"preferences": {"region_routing": {...}}} on PUT /v1/buyer/preferencesscope.region_routing on POST /v1/keys and PATCH /v1/keys/{id}"region_routing": {...} in the request bodyOn the account or a key, null clears it, and a save that doesn't mention it keeps it. A key with region routing counts as a restricted key, so it can't create or manage keys.
curl $SURPLUS_BASE_URL/chat/completions \ -H "Authorization: Bearer $SURPLUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "glm-5.3", "messages": [{"role": "user", "content": "hi"}], "region_routing": {"mode": "include", "regions": ["us", "eu"]} }'
With the OpenAI Python SDK, pass it as extra_body={"region_routing": {"mode": "include", "regions": ["us", "eu"]}}. Every inference endpoint accepts it, text and media. A multipart request (transcription, image edit) sends it as a JSON string. Region routing never reaches the seller.
When no seller in your regions serves a model
The request is refused before anything is charged or held. It's never sent to a seller outside your regions. Your own priority or fallback provider key serves it only if that key's host is in your regions too.
| Code | Status | Meaning |
|---|---|---|
region_unavailable | 400 | No seller of this model is known to run where you asked. Widen the regions where they're set (the account, the key or the request), or choose a model with sellers in your regions. |
no_healthy_sellers | 503 | Sellers in your regions serve this model, but none can take the request right now. Retry shortly. |
invalid_region_routing | 400 | region_routing isn't {"mode": "include" or "exclude", "regions": [one or more of us, eu, cn]}, or was sent on a transcription paid with x402 or MPP. |
region_routing_not_enabled | 400 | Region routing isn't available yet. A request or key that sets it is refused rather than served without it. While it's switched off, a setting on your account isn't applied and your requests are served without it. |
region_routing_unavailable | 503 | We couldn't check whether region routing is on, and your request, key or account sets it. Retry shortly. |
region_routing_settings_unavailable | 503 | Your account's region routing couldn't be read right now. Retry shortly. |
region_routing_unreadable | 503 | The region routing stored on your account or key can't be read. Save it again. |
region_unavailableStatus · 400Meaning · No seller of this model is known to run where you asked. Widen the regions where they're set (the account, the key or the request), or choose a model with sellers in your regions.no_healthy_sellersStatus · 503Meaning · Sellers in your regions serve this model, but none can take the request right now. Retry shortly.invalid_region_routingStatus · 400Meaning · region_routing isn't {"mode": "include" or "exclude", "regions": [one or more of us, eu, cn]}, or was sent on a transcription paid with x402 or MPP.region_routing_not_enabledStatus · 400Meaning · Region routing isn't available yet. A request or key that sets it is refused rather than served without it. While it's switched off, a setting on your account isn't applied and your requests are served without it.region_routing_unavailableStatus · 503Meaning · We couldn't check whether region routing is on, and your request, key or account sets it. Retry shortly.region_routing_settings_unavailableStatus · 503Meaning · Your account's region routing couldn't be read right now. Retry shortly.region_routing_unreadableStatus · 503Meaning · The region routing stored on your account or key can't be read. Save it again.What region routing doesn't cover
- Provider Market. Calls to
/v1/resources/...use a seller's provider key directly and don't apply region routing. - x402 and MPP payments. A request paid with x402 or MPP has no account or key settings, so only
region_routingin the request applies, and a transcription paid that way refuses it.
Questions
Why does exclude: ["cn"] refuse more than China-hosted sellers?
Because a seller that doesn't say where it runs could be running in China. Excluding a region means no request of yours reaches it, so every seller with an unknown location is left out too.
Does a US company count as us?
No. Only where the provider says your request runs counts. A US company's main endpoint usually makes no location promise, so it counts as anywhere.
How is this different from a privacy level?
A privacy level decides which providers can see or keep your request content. Region routing decides where the request may run. They work together: a request has to pass both.