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

# Cloud endpoints & data residency

Choose the endpoint that best fits your application's requirements, whether
that's routing to the nearest data center for the lowest latency or ensuring
your audio data stays within a given data residency zone.

## Data processing locations

All Dictation audio and transcription data is processed in AWS regions located
in the United States and the European Union:

**US**

| AWS region  | Location      |
| ----------- | ------------- |
| `us-east-1` | N. Virginia   |
| `us-east-2` | Ohio          |
| `us-west-1` | N. California |
| `us-west-2` | Oregon        |

**EU**

| AWS region     | Location  |
| -------------- | --------- |
| `eu-central-1` | Frankfurt |
| `eu-north-1`   | Stockholm |
| `eu-south-1`   | Milan     |
| `eu-south-2`   | Spain     |
| `eu-west-1`    | Ireland   |
| `eu-west-3`    | Paris     |

Which of these locations processes your data depends on the endpoint you call,
as described below.

## Endpoints

| Endpoint          | URL                                   | Region                    |
| ----------------- | ------------------------------------- | ------------------------- |
| Global (default)  | `https://dictation.assemblyai.com`    | Nearest region            |
| US data residency | `https://dictation.us.assemblyai.com` | US locations listed above |
| EU data residency | `https://dictation.eu.assemblyai.com` | EU locations listed above |

The request format, headers, and parameters are identical on all three. Only
the host changes.

<Note>
  The global endpoint routes to the nearest available region, so your data may
  be processed in any of the US or EU locations listed above. If you need data
  to stay in one of those zones, call the US or EU endpoint explicitly rather
  than relying on the default.
</Note>

## Which endpoint should I use?

* **Optimizing for latency?** Use the **Global endpoint**
  (`dictation.assemblyai.com`). It routes your request to the region with the
  fastest response time for you, and needs no configuration change.
* **Need US data residency?** Use the **US endpoint**
  (`dictation.us.assemblyai.com`). Your audio and transcription data remains
  within the US.
* **Need EU data residency?** Use the **EU endpoint**
  (`dictation.eu.assemblyai.com`). Your audio and transcription data remains
  within the EU.

## How to use it

Replace the base URL with the endpoint you want. In the Python SDK the base URL
comes from the `dictation_base_url` setting, which defaults to the global
endpoint. The examples below use the US data zone; for the EU data zone,
replace `us` with `eu`.

<Tabs groupId="language">
  <Tab language="python-sdk" title="Python SDK" default>
    ```python title="Global (default)" theme={null}
    import assemblyai as aai

    aai.settings.api_key = "<YOUR_API_KEY>"

    result = aai.DictationTranscriber().transcribe_live("clip.wav")
    print(result.text)
    ```

    ```python title="US data residency" theme={null}
    import assemblyai as aai

    aai.settings.api_key = "<YOUR_API_KEY>"
    aai.settings.dictation_base_url = "https://dictation.us.assemblyai.com"

    result = aai.DictationTranscriber().transcribe_live("clip.wav")
    print(result.text)
    ```

    ```python title="EU data residency" theme={null}
    import assemblyai as aai

    aai.settings.api_key = "<YOUR_API_KEY>"
    aai.settings.dictation_base_url = "https://dictation.eu.assemblyai.com"

    result = aai.DictationTranscriber().transcribe_live("clip.wav")
    print(result.text)
    ```
  </Tab>

  <Tab language="python" title="Python">
    ```python title="Global (default)" theme={null}
    import requests

    with open("clip.wav", "rb") as f:
        audio = f.read()

    response = requests.post(
        "https://dictation.assemblyai.com/v1/transcribe/live",
        headers={"Authorization": "<YOUR_API_KEY>"},
        files={
            "config": (None, "{}", "application/json"),
            "audio": ("clip.wav", audio, "audio/wav"),
        },
        timeout=90,
    )
    response.raise_for_status()
    print(response.json()["text"])
    ```

    ```python title="US data residency" theme={null}
    import requests

    with open("clip.wav", "rb") as f:
        audio = f.read()

    response = requests.post(
        "https://dictation.us.assemblyai.com/v1/transcribe/live",
        headers={"Authorization": "<YOUR_API_KEY>"},
        files={
            "config": (None, "{}", "application/json"),
            "audio": ("clip.wav", audio, "audio/wav"),
        },
        timeout=90,
    )
    response.raise_for_status()
    print(response.json()["text"])
    ```

    ```python title="EU data residency" theme={null}
    import requests

    with open("clip.wav", "rb") as f:
        audio = f.read()

    response = requests.post(
        "https://dictation.eu.assemblyai.com/v1/transcribe/live",
        headers={"Authorization": "<YOUR_API_KEY>"},
        files={
            "config": (None, "{}", "application/json"),
            "audio": ("clip.wav", audio, "audio/wav"),
        },
        timeout=90,
    )
    response.raise_for_status()
    print(response.json()["text"])
    ```
  </Tab>

  <Tab language="javascript" title="JavaScript">
    ```javascript title="Global (default)" theme={null}
    import { readFileSync } from "fs";

    const audio = readFileSync("clip.wav");
    const form = new FormData();
    form.append("config", new Blob(["{}"], { type: "application/json" }));
    form.append("audio", new Blob([audio], { type: "audio/wav" }), "clip.wav");

    const response = await fetch(
      "https://dictation.assemblyai.com/v1/transcribe/live",
      { method: "POST", headers: { Authorization: "<YOUR_API_KEY>" }, body: form }
    );
    console.log((await response.json()).text);
    ```

    ```javascript title="US data residency" theme={null}
    import { readFileSync } from "fs";

    const audio = readFileSync("clip.wav");
    const form = new FormData();
    form.append("config", new Blob(["{}"], { type: "application/json" }));
    form.append("audio", new Blob([audio], { type: "audio/wav" }), "clip.wav");

    const response = await fetch(
      "https://dictation.us.assemblyai.com/v1/transcribe/live",
      { method: "POST", headers: { Authorization: "<YOUR_API_KEY>" }, body: form }
    );
    console.log((await response.json()).text);
    ```

    ```javascript title="EU data residency" theme={null}
    import { readFileSync } from "fs";

    const audio = readFileSync("clip.wav");
    const form = new FormData();
    form.append("config", new Blob(["{}"], { type: "application/json" }));
    form.append("audio", new Blob([audio], { type: "audio/wav" }), "clip.wav");

    const response = await fetch(
      "https://dictation.eu.assemblyai.com/v1/transcribe/live",
      { method: "POST", headers: { Authorization: "<YOUR_API_KEY>" }, body: form }
    );
    console.log((await response.json()).text);
    ```
  </Tab>

  <Tab language="bash" title="cURL">
    ```bash title="Global (default)" theme={null}
    curl -X POST https://dictation.assemblyai.com/v1/transcribe/live \
      -H 'Authorization: <YOUR_API_KEY>' \
      -F 'config={};type=application/json' \
      -F 'audio=@clip.wav;type=audio/wav'
    ```

    ```bash title="US data residency" theme={null}
    curl -X POST https://dictation.us.assemblyai.com/v1/transcribe/live \
      -H 'Authorization: <YOUR_API_KEY>' \
      -F 'config={};type=application/json' \
      -F 'audio=@clip.wav;type=audio/wav'
    ```

    ```bash title="EU data residency" theme={null}
    curl -X POST https://dictation.eu.assemblyai.com/v1/transcribe/live \
      -H 'Authorization: <YOUR_API_KEY>' \
      -F 'config={};type=application/json' \
      -F 'audio=@clip.wav;type=audio/wav'
    ```
  </Tab>
</Tabs>

<Note>
  Pre-warming is per host. A connection warmed against the global endpoint is
  no use to a request aimed at a data zone endpoint, so warm the same host you
  are about to transcribe against. See
  [Connection pre-warming](/docs/dictation/connection-pre-warming).
</Note>
