Keep data in your region
Configure a project so its requests are served only in the regions you allow, and show that they were.
Set the organization's residency#
You need the Owner or Admin role. In the console open Settings → Data residency, choose the Allowed regions and the default region, and decide whether new projects are Sealed only by default. Gateways apply the change within 10 seconds. Policies whose regions fall outside the new set must be changed first.
Pin the project#
In the project's policy, set residency.allowed_regions, simulate a request, then publish (Policies, Simulate).
Call the regional host#
Configure each environment with the regional host of an allowed region, for example https://api.eu.panward.ai/v1. A regional host is never served from another geography, and a request that reaches a region the policy does not allow is refused (Hosts).
Check which models remain#
Under a pinned policy only the models that can be served in the pinned regions are available, so the list is shorter.
GET /v1/models lists the models your key can call; under a pinned policy the regions outside the pin are marked unavailable, and GET /v1/models?region=eu keeps only the models available in that region.
Prove it#
Every response names its region in panward-region. The receipt records it as region, and its policy.applied event lists the constraints that applied, for example region:eu. The requests export in the console lists the region of every request.
import os from openai import OpenAI client = OpenAI( base_url="https://api.eu.panward.ai/v1", api_key=os.environ["PANWARD_API_KEY"], ) raw = client.chat.completions.with_raw_response.create( model="z-ai/glm-5.3", messages=[{"role": "user", "content": "Hello"}], ) region = raw.headers["panward-region"] assert region == "eu", f"served in {region}"
import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://api.eu.panward.ai/v1", apiKey: process.env.PANWARD_API_KEY, }); const { response } = await client.chat.completions .create({ model: "z-ai/glm-5.3", messages: [{ role: "user", content: "Hello" }] }) .withResponse(); const region = response.headers.get("panward-region"); if (region !== "eu") throw new Error(`served in ${region}`);
curl -s -D headers.txt -o response.json https://api.eu.panward.ai/v1/chat/completions \ -H "Authorization: Bearer $PANWARD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "z-ai/glm-5.3", "messages": [{"role": "user", "content": "Hello"}]}' grep -qi '^panward-region: eu' headers.txt || { echo "served outside eu"; exit 1; }
$ jq '{region, constraints: (.events[] | select(.type == "policy.applied") | .constraints)}' receipt.json
Test the refusal#
Call the host of a region the policy does not allow. The gateway refuses the request with 403 region_not_allowed and never forwards it to another region.
curl -s https://api.us.panward.ai/v1/chat/completions \ -H "Authorization: Bearer $PANWARD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "z-ai/glm-5.3", "messages": [{"role": "user", "content": "Hello"}]}'
What residency covers#
Inference content exists only in the memory of the gateway in the serving region while the request runs, and is never stored. Request metadata and receipts stay in the serving region. Account and billing data live in the EU home region (What stays where).
Outage behaviour#
A pinned request fails rather than moves: when its region is unavailable it is not served from another one.