
100% private · no tracking · works offline100% client-side/no data leaves your browser/no accounts/works offline
A production guide to selecting US or EU processing per OpenAI API request while keeping storage, processing, eligibility, and fallback behavior explicit.

Free toolkit
85+ private dev tools
Everything runs in your browser. Zero tracking, no sign-up.
Browse toolsOpenAI API regional processing can now be selected for an individual request instead of requiring every call made with one key to follow a single regional path. That flexibility is useful for multi-region products, but changing a hostname is only the final step: eligibility, retention controls, endpoint support, model support, and failure policy still determine whether a request satisfies your data-handling requirement.
This guide implements regional routing as an explicit backend policy. It keeps storage and processing separate, refuses unsafe fallback, and records enough evidence for engineers and compliance reviewers to reconstruct what the application intended to do.
On August 21, 2026, OpenAI added per-request regional selection for API keys belonging to projects whose geography is Global. A service chooses a supported regional processing path by sending the request to a prefixed API domain. The documented US and European examples are:
https://us.api.openai.com/v1https://eu.api.openai.com/v1The ordinary https://api.openai.com/v1 endpoint remains the unconstrained global route. Region selection is therefore an origin-level routing choice, not a new field inside the Responses API payload.
This solves a real architecture problem. A platform can retain one Global project while choosing the processing path for a particular workload, tenant, or data class. Previously, regional handling was primarily tied to creating a new region-specific project and using its regional domain.
The feature does not make every regional prefix a processing guarantee. OpenAI's current support matrix distinguishes regions that provide regional storage from those that also provide regional processing. As of August 22, 2026, the US and Europe support both across listed services; several other available regions provide storage but not regional processing for the same services. The UAE has a narrower processing matrix and requires additional approval.
Always treat the official data-controls matrix as live configuration, not documentation you copy once into a policy spreadsheet. Endpoint and model eligibility can change independently.
| Decision | Where it is expressed | What it controls |
|---|---|---|
| Project geography | OpenAI project configuration | Default residency configuration and key eligibility |
| Request region | API hostname | Processing route for that request when supported |
| Retention control | Organization and project controls | Abuse-monitoring retention behavior |
| Endpoint and model | Request path and model |
Whether the regional combination is supported |
“Data residency” is often used as if it were one switch. For implementation reviews, split it into at least three questions:
OpenAI documents regional storage and regional processing separately. A region may store eligible customer content locally while processing it elsewhere. That means in.api.openai.com, for example, must not be interpreted as proof that inference happens in India when the matrix says processing is not supported there.
Data residency also does not cover all operational data. OpenAI excludes system data such as account information, usage statistics, billing data, analytics, support requests, and structured-output schemas from the customer-content residency promise. Your own network path matters too: regional handling does not undo transmission caused by an end user's location or your infrastructure.
The practical rule is simple: encode the control your requirement actually names. If a contract requires EU processing, storageRegion: "eu" is an incomplete policy. Your configuration should say processingRegion: "eu", validate that the chosen endpoint and model support it, and reject the request when they do not.
For related cost controls, see the site's guide to OpenAI API hard spend limits. Regional data-residency endpoints carry a documented 10% uplift for eligible models released on or after March 5, 2026, so region policy belongs in both compliance and cost reviews.
Do not scatter base URLs across controllers and background jobs. Define a small, reviewed allowlist and map application policy to it.
type ProcessingRegion = "global" | "us" | "eu";
const OPENAI_BASE_URL: Readonly<Record<ProcessingRegion, string>> = {
global: "https://api.openai.com/v1",
us: "https://us.api.openai.com/v1",
eu: "https://eu.api.openai.com/v1",
};
function baseURLFor(region: ProcessingRegion): string {
const baseURL = OPENAI_BASE_URL[region];
if (!baseURL) throw new Error(`Unsupported processing region: ${region}`);
return baseURL;
}
This intentionally includes only regions whose behavior the application supports. Do not generate a hostname by interpolating an arbitrary country code. A syntactically valid hostname is not evidence that the organization is eligible or that the requested model, endpoint, and processing mode are supported.
The policy input should come from trusted application state: a tenant contract, a server-managed workspace setting, or a classified workload. The caller may request a feature, but it should not be able to downgrade its required processing region with a JSON field.
Install the official JavaScript SDK and create clients from the approved base URLs:
npm install openai
import OpenAI from "openai";
type ProcessingRegion = "global" | "us" | "eu";
const BASE_URLS: Record<ProcessingRegion, string> = {
global: "https://api.openai.com/v1",
us: "https://us.api.openai.com/v1",
eu: "https://eu.api.openai.com/v1",
};
const clients = new Map<ProcessingRegion, OpenAI>();
function getClient(region: ProcessingRegion): OpenAI {
const existing = clients.get(region);
if (existing) return existing;
const client = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
baseURL: BASE_URLS[region],
maxRetries: 0,
});
clients.set(region, client);
return client;
}
export async function summarizeInRegion(
region: ProcessingRegion,
text: string,
) {
const response = await getClient(region).responses.create({
model: "gpt-5.6-terra",
input: `Summarize this incident report:
${text}`,
});
return {
responseId: response.id,
outputText: response.output_text,
requestedRegion: region,
};
}
The example disables SDK retries so the application can own retry policy explicitly. That is not mandatory, but it prevents a compliance-sensitive path from inheriting behavior nobody reviewed. Retries to the same approved regional origin are usually operationally different from falling back to another origin.
The model name above follows OpenAI's current example, but do not freeze the article's model choice into production policy. Maintain an allowlist of endpoint/model combinations confirmed against the live matrix, and update it through a controlled release.

A safe router derives the region from authenticated tenancy and workload classification. It does not trust req.body.region.
type TenantPolicy = {
processingRegion: "global" | "us" | "eu";
allowedModels: ReadonlySet<string>;
};
function authorizeRoute(
policy: TenantPolicy,
requestedModel: string,
): { region: TenantPolicy["processingRegion"]; model: string } {
if (!policy.allowedModels.has(requestedModel)) {
throw new Error("Model is not approved for this tenant");
}
return {
region: policy.processingRegion,
model: requestedModel,
};
}
Resolve TenantPolicy from server-side configuration after authentication. If the tenant has no complete policy, stop before sending customer content. A default-to-global branch is convenient during development and dangerous in a system claiming regional processing.
This resembles model routing, but the priorities differ. The Google Cloud API Gateway model-routing guide focuses on selecting an upstream model safely. A residency router must make location a non-negotiable constraint before optimizing model, latency, or price.
For an ordinary recommendation feature, cross-region fallback may be a reasonable availability choice. For a request covered by a regional-processing obligation, it is usually a policy violation disguised as resilience.
Use one of these explicit modes:
| Mode | On regional failure | Appropriate when |
|---|---|---|
| Strict | Retry the same region within bounds, then fail | Processing location is mandatory |
| Consent-based | Ask an authorized operator or user before changing region | The agreement permits informed exception handling |
| Flexible | Fall back according to a documented region order | Location is a preference, not a requirement |
Never mix these modes in a catch-all HTTP retry wrapper. The routing layer should return a typed error that distinguishes unsupported configuration, authorization failure, rate limiting, and regional service failure.
class RegionalProcessingUnavailable extends Error {
constructor(
readonly region: "us" | "eu",
readonly cause: unknown,
) {
super(`Required ${region.toUpperCase()} processing is unavailable`);
}
}
async function runStrictlyInEU(input: string) {
try {
return await getClient("eu").responses.create({
model: "gpt-5.6-terra",
input,
});
} catch (cause) {
throw new RegionalProcessingUnavailable("eu", cause);
}
}
Do not include sensitive prompts or model output in the error. Observability should capture routing facts without becoming a second uncontrolled copy of customer content.
Log the decision, not the payload. A useful audit event includes:
Avoid prompts, files, tool arguments, and generated text unless a separate retention policy explicitly permits them. Hashing a prompt is not automatically anonymous; small or predictable inputs can be guessed and compared.
Also distinguish requested region from verified outcome. The hostname proves what your application selected and where it connected. It does not create an API response field that independently attests to processing location. Your evidence chain therefore combines approved OpenAI terms and support documentation with application configuration, DNS/TLS controls, request logs, and change management.
If a workload also uses Fast mode, keep the dimensions separate. Regional origin chooses a location constraint; service_tier chooses a processing tier. The site's OpenAI API Fast Mode guide covers tier routing and downgrade telemetry.
Treat this as a routing change, even when application prompts stay identical.
Test that strict EU tenants always produce the EU base URL, global tenants use the global endpoint, unknown regions fail, and unapproved models never reach the SDK.
import { describe, expect, it } from "vitest";
describe("regional routing", () => {
it("maps strict EU processing to the EU origin", () => {
expect(baseURLFor("eu")).toBe("https://eu.api.openai.com/v1");
});
it("rejects values outside the allowlist", () => {
expect(() => baseURLFor("apac" as ProcessingRegion)).toThrow(
"Unsupported processing region",
);
});
});
For every allowed region, exercise the exact API endpoint, model snapshot, tools, input modalities, and retention control used by production. A successful text-only Responses call does not prove that file inputs, image generation, Batch, or a third-party tool share the same eligibility.
Simulate DNS failure, timeouts, rate limits, and server errors for the regional host. Assert that strict requests remain in-region and eventually fail. This is where an old global retry client often reappears.
Start with internal traffic, then a small set of eligible tenants. Compare error rate, latency, and spend with the global path, but never automatically weaken a mandatory location rule to improve those metrics.
Yes. OpenAI's August 21 update documents using a key from a project with Global geography against the prefixed US and EU domains for individual requests. The organization must still meet eligibility and retention-control requirements, and the chosen endpoint and model must support regional processing.
No. The support matrix separately marks regional storage and processing. As of August 22, 2026, several country prefixes provide regional storage without regional processing. Use only a region explicitly marked for processing for the selected service and model.
Not for the new per-request option when an eligible Global project key is used. Region-specific projects remain the configuration path for project-level residency. Choose based on whether isolation should be enforced by project boundaries or by an application routing policy.
Technically it can, but it should not do so when regional processing is mandatory. Retry the same region within a bounded policy and fail closed. Cross-region fallback belongs only in workloads whose contract and user experience explicitly allow it.
Do not assume so. OpenAI's residency limitations exclude products, services, or content offered by third parties. Review each hosted or remote tool's own data path and either prohibit it for strict workloads or document a separate approved boundary.
Per-request OpenAI API regional processing turns location into a routing decision that can be made at workload granularity. The production-safe implementation is an allowlisted regional client selected from trusted policy, validated against the live support matrix, audited without payloads, and designed to fail closed when location is mandatory.
The new hostname flexibility is valuable, but it should reduce key sprawl—not weaken the controls that regional processing is meant to provide. OpenAI recorded the feature in its API changelog on August 21, 2026.
Comments
Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.