> ## Documentation Index
> Fetch the complete documentation index at: https://anam.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Session Regions

> Enterprise plans can choose the engine region for a persona session, keep engine processing in that region with a strict policy, and read the region that served it.

Set `sessionOptions.region` when you need a session's engine processing to run in a specific region. Anam supports two engine regions:

| Value | Engine location |
| ----- | --------------- |
| `eu`  | Europe          |
| `us`  | United States   |

<Info>
  Session region selection is available on Enterprise plans only.
</Info>

If you omit `region`, Anam selects a region from the request location and its current routing policy. An explicit region takes precedence over that automatic selection, even when automatic geographic routing is disabled.

## Request a region

For browser clients, set the region when your server creates the session token. The region is bound to the token and cannot be replaced when the browser starts the session.

<CodeGroup>
  ```typescript Node.js theme={"system"}
  const response = await fetch("https://api.anam.ai/v1/auth/session-token", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.ANAM_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      personaConfig: {
        personaId: "00000000-0000-0000-0000-000000000000",
      },
      sessionOptions: {
        region: "eu",
        regionPolicy: "strict",
      },
    }),
  });

  if (!response.ok) {
    throw new Error(`Session token request failed: ${response.status}`);
  }

  const { sessionToken } = await response.json();
  ```

  ```python Python theme={"system"}
  import os
  import requests

  response = requests.post(
      "https://api.anam.ai/v1/auth/session-token",
      headers={
          "Authorization": f"Bearer {os.environ['ANAM_API_KEY']}",
          "Content-Type": "application/json",
      },
      json={
          "personaConfig": {
              "personaId": "00000000-0000-0000-0000-000000000000",
          },
          "sessionOptions": {
              "region": "eu",
              "regionPolicy": "strict",
          },
      },
  )
  response.raise_for_status()
  session_token = response.json()["sessionToken"]
  ```

  ```bash cURL theme={"system"}
  curl -X POST https://api.anam.ai/v1/auth/session-token \
    -H "Authorization: Bearer $ANAM_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "personaConfig": {
        "personaId": "00000000-0000-0000-0000-000000000000"
      },
      "sessionOptions": {
        "region": "eu",
        "regionPolicy": "strict"
      }
    }'
  ```
</CodeGroup>

Server-side SDKs that start sessions directly use the same fields. In the Python SDK, pass `SessionOptions(region="eu", region_policy="strict")`.

## Choose a region policy

`regionPolicy` controls what happens when the requested region cannot accept the session.

| Policy      | Behavior                                                                                                                 |
| ----------- | ------------------------------------------------------------------------------------------------------------------------ |
| `preferred` | Uses the requested region first but may fail over to the other region when capacity is unavailable. This is the default. |
| `strict`    | Never serves the session from another region. Requires an explicit `region`.                                             |

Use `strict` when engine processing must stay in the requested region. Anam returns `400` if you set `regionPolicy` to `strict` without a region.

Requests that set `region` or `regionPolicy` return `403` with the error code `session_region_not_available` when session region selection is not enabled for the organization.

If the strict region is unavailable or out of capacity, session start returns `503`. Wait briefly before trying the same region again. Anam does not retry a strict session in another region.

## Read the served region

A successful engine-session response can include the region that actually served it:

```json theme={"system"}
{
  "sessionId": "00000000-0000-0000-0000-000000000000",
  "region": "eu"
}
```

Under `preferred`, this value can differ from the requested region after a capacity failover. The field is absent when the serving session service does not report its region, so do not infer it from the requested region.

In the JavaScript SDK, call `client.getActiveSessionRegion()` after the session starts. It returns `"eu"`, `"us"`, or `null` when no region was reported.

<Note>
  Meeting regions use `eu`, `us-east`, and `us-west` because they select the meeting bot location. A [strict meeting invite](/docs/personas/meetings#regions) also pins its engine session to the corresponding `eu` or `us` engine region.
</Note>

## Data residency

To keep Anam's engine processing in a selected region, create the session token with `region: "eu"` or `region: "us"` and `regionPolicy: "strict"`, as shown in [Request a region](#request-a-region). A strict session is never served from the other region: if the selected engine region is unavailable or out of capacity, session start returns `503` and Anam does not retry in another region.

For example, to keep engine processing in the EU, use `region: "eu"` and `regionPolicy: "strict"`.

<Warning>
  Strict regional routing does not guarantee data residency for stored session data or data handled by third-party providers. Anam retains session content, including transcripts, by default. For EU or US data residency, also enable [Zero Data Retention](/docs/security/privacy) and use an LLM and TTS voice that support ZDR and meet your residency requirements.
</Warning>

The region is bound to the session token when your server mints it, so browser clients need no changes. To confirm where a session ran, [read the served region](#read-the-served-region).

For meeting sessions, send a [strict meeting invite](/docs/personas/meetings#regions), which pins both the meeting bot and engine session to the corresponding region.
