> ## 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 processing
your data within a specific geographic region.\*

Note: File names may be processed by our subprocessors CrowdStrike and Datadog, which are located in the US. Do not include PII or PHI in file names if you require that information to remain in your selected data residency zone.

\*AssemblyAI will store Account Data and Usage Data in the United States, per our [Privacy Policy](https://www.assemblyai.com/legal/privacy-policy) and the Data Privacy Framework. Audio, transcript, and prompt data will be stored in the endpoint region you select. Incident response and customer support may be conducted from locations where staff are employed, which may be in the US, EU, or elsewhere. If your audio, transcript, or prompt needs to be accessed for debugging, a member of our team located outside of your endpoint region may access that data and may use a US-based subprocessor to support the troubleshooting or customer support request.

## 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. Each host serves both `/v1/transcribe/live` and
`/v1/transcribe`.

> [!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.

## 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`).
* **Need EU data residency?** Use the **EU endpoint**
  (`dictation.eu.assemblyai.com`).

## 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, and in the JavaScript SDK from the
`dictationBaseUrl` client option; both default to the global endpoint. The examples below use the US data zone; for the EU data zone,
replace `us` with `eu`.

> [tab] Python SDK
>
> ```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] JavaScript SDK
>
> ```javascript title="Global (default)" theme={null}
> import { AssemblyAI } from "assemblyai";
>
> const client = new AssemblyAI({
>   apiKey: "<YOUR_API_KEY>",
> });
>
> const result = await client.dictation.transcribeLive("clip.wav");
> console.log(result.text);
> ```
>
> ```javascript title="US data residency" theme={null}
> import { AssemblyAI } from "assemblyai";
>
> const client = new AssemblyAI({
>   apiKey: "<YOUR_API_KEY>",
>   dictationBaseUrl: "https://dictation.us.assemblyai.com",
> });
>
> const result = await client.dictation.transcribeLive("clip.wav");
> console.log(result.text);
> ```
>
> ```javascript title="EU data residency" theme={null}
> import { AssemblyAI } from "assemblyai";
>
> const client = new AssemblyAI({
>   apiKey: "<YOUR_API_KEY>",
>   dictationBaseUrl: "https://dictation.eu.assemblyai.com",
> });
>
> const result = await client.dictation.transcribeLive("clip.wav");
> console.log(result.text);
> ```

> [tab] 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] 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] 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'
> ```

> [!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](https://assemblyai.com/docs/dictation/connection-pre-warming.md).
