Region routing
Restrict the regions in which your requests are processed, or exclude specific regions.
This page explains how to control the regions of the workers that serve your requests. It is intended for developers with data residency or compliance requirements.
Regions
Each worker is tagged with the region in which it runs. Regions are broad jurisdictional blocs, not countries:
| Region | Description |
|---|---|
eu | European Union and European Economic Area |
us | United States |
cn | Mainland China |
apac | Asia-Pacific, excluding mainland China, such as Japan, Singapore, and South Korea |
other | All other regions |
Restrict a request to regions
Set provider.region_only to a list of regions. Only workers in one of these regions serve the request.
curl https://api.engy.ai/v1/chat/completions \
-H "Authorization: Bearer $ENGY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k3",
"provider": {"region_only": ["eu", "us"]},
"messages": [{"role": "user", "content": "Hello"}]
}'Workers without a region tag do not serve requests that set region_only.
Exclude regions
Set provider.region_exclude to a list of regions. Workers in any of these regions do not serve the request.
curl https://api.engy.ai/v1/chat/completions \
-H "Authorization: Bearer $ENGY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k3",
"provider": {"region_exclude": ["cn"]},
"messages": [{"role": "user", "content": "Hello"}]
}'Combine requirements
You can combine region_only, region_exclude, and zdr in one provider object. A worker must meet all of the requirements to serve the request. For details about zdr, see Data retention.
{
"provider": {
"zdr": true,
"region_only": ["eu"]
}
}Errors
| Status | Cause |
|---|---|
400 | A region value is not one of eu, us, cn, apac, or other. The values are not case-sensitive. |
503 | No available worker meets the requirements. Engy does not send the request to any other worker. |
Restrictive requirements reduce the capacity that is available for a request. If you receive 503 errors, relax the requirements or retry later.
Supported endpoints
The provider object works on /v1/chat/completions, /v1/completions, /v1/messages, and /v1/responses. Engy removes it before the request reaches the model.