Skip to content

For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see For full documentation content, see For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at

Streaming Endpoints and Data Zones ​

For the complete documentation index, see llms.txt

Choose the endpoint that best fits your application's requirements—whether that's achieving the lowest possible latency or ensuring your audio data stays within a specific geographic region.

Edge Routing ​

The default endpoint (streaming.assemblyai.com) automatically routes requests to the nearest available region, minimizing latency for real-time transcription. With infrastructure in Oregon, Virginia, and Ireland, this endpoint delivers best-in-class streaming performance regardless of where your users are located.

Data Zone Routing ​

Data Zone endpoints guarantee your data never leaves the specified region. This is designed for organizations with strict data residency and governance requirements—your audio and transcription data will remain entirely within the US or EU, respectively.

Endpoints ​

EndpointWebSocket URLDescription
Edge Routing (default)wss://streaming.assemblyai.com/v3/wsLowest latency, nearest region
US data residencywss://streaming.us.assemblyai.com/v3/wsData stays in the US
EU data residencywss://streaming.eu.assemblyai.com/v3/wsData stays in the EU

Which endpoint should I use? ​

  • Optimizing for latency? Use Edge Routing (default). No configuration change is needed — it automatically routes to the nearest region for the fastest response.
  • Need data residency? Use a Data Zone endpoint. Choose US or EU to ensure your audio and transcription data stays within that region.

How to use it ​

Update your WebSocket connection URL to your preferred endpoint. Select an endpoint tab below to see examples for each.

Edge Routing is the default. If you're using the SDKs without overriding the base URL, you're already using this endpoint. No configuration change is required.

python
import assemblyai as aai
from assemblyai.streaming.v3 import (
    StreamingClient,
    StreamingClientOptions,
    StreamingParameters,
)

api_key = "<YOUR_API_KEY>"

# No api_host override needed — Edge Routing is the default
client = StreamingClient(
    StreamingClientOptions(
        api_key=api_key,
    )
)

client.connect(
    StreamingParameters(
        sample_rate=16000,
        speech_model="u3-rt-pro",
    )
)
client.stream(aai.extras.MicrophoneStream(sample_rate=16000))
python
import websocket
from urllib.parse import urlencode

YOUR_API_KEY = "<YOUR_API_KEY>"
CONNECTION_PARAMS = {"sample_rate": 16000, "speech_model": "u3-rt-pro"}
API_ENDPOINT_BASE_URL = "wss://streaming.assemblyai.com/v3/ws"
API_ENDPOINT = f"{API_ENDPOINT_BASE_URL}?{urlencode(CONNECTION_PARAMS)}"

ws = websocket.WebSocketApp(
    API_ENDPOINT,
    header={"Authorization": YOUR_API_KEY},
)

ws.run_forever()
javascript
import { AssemblyAI } from "assemblyai";

// No streamingBaseUrl override needed — Edge Routing is the default
const client = new AssemblyAI({
  apiKey: "<YOUR_API_KEY>",
});

const transcriber = client.streaming.transcriber({
  sampleRate: 16_000,
  speechModel: "u3-rt-pro",
});

await transcriber.connect();
javascript
const WebSocket = require("ws");
const querystring = require("querystring");

const YOUR_API_KEY = "<YOUR_API_KEY>";
const CONNECTION_PARAMS = { sample_rate: 16000, speech_model: "u3-rt-pro" };
const API_ENDPOINT_BASE_URL = "wss://streaming.assemblyai.com/v3/ws";
const API_ENDPOINT = `${API_ENDPOINT_BASE_URL}?${querystring.stringify(CONNECTION_PARAMS)}`;

const ws = new WebSocket(API_ENDPOINT, {
  headers: {
    Authorization: YOUR_API_KEY,
  },
});

Use the US Data Zone endpoint to keep your audio and transcription data within the United States.

python
import assemblyai as aai
from assemblyai.streaming.v3 import (
    StreamingClient,
    StreamingClientOptions,
    StreamingParameters,
)

api_key = "<YOUR_API_KEY>"

client = StreamingClient(
    StreamingClientOptions(
        api_key=api_key,
        api_host="streaming.us.assemblyai.com",
    )
)

client.connect(
    StreamingParameters(
        sample_rate=16000,
        speech_model="u3-rt-pro",
    )
)
client.stream(aai.extras.MicrophoneStream(sample_rate=16000))
python
import websocket
from urllib.parse import urlencode

YOUR_API_KEY = "<YOUR_API_KEY>"
CONNECTION_PARAMS = {"sample_rate": 16000, "speech_model": "u3-rt-pro"}
API_ENDPOINT_BASE_URL = "wss://streaming.us.assemblyai.com/v3/ws"
API_ENDPOINT = f"{API_ENDPOINT_BASE_URL}?{urlencode(CONNECTION_PARAMS)}"

ws = websocket.WebSocketApp(
    API_ENDPOINT,
    header={"Authorization": YOUR_API_KEY},
)

ws.run_forever()
javascript
import { AssemblyAI } from "assemblyai";

const client = new AssemblyAI({
  apiKey: "<YOUR_API_KEY>",
  streamingBaseUrl: "wss://streaming.us.assemblyai.com",
});

const transcriber = client.streaming.transcriber({
  sampleRate: 16_000,
  speechModel: "u3-rt-pro",
});

await transcriber.connect();
javascript
const WebSocket = require("ws");
const querystring = require("querystring");

const YOUR_API_KEY = "<YOUR_API_KEY>";
const CONNECTION_PARAMS = { sample_rate: 16000, speech_model: "u3-rt-pro" };
const API_ENDPOINT_BASE_URL = "wss://streaming.us.assemblyai.com/v3/ws";
const API_ENDPOINT = `${API_ENDPOINT_BASE_URL}?${querystring.stringify(CONNECTION_PARAMS)}`;

const ws = new WebSocket(API_ENDPOINT, {
  headers: {
    Authorization: YOUR_API_KEY,
  },
});

Use the EU Data Zone endpoint to keep your audio and transcription data within the European Union.

python
import assemblyai as aai
from assemblyai.streaming.v3 import (
    StreamingClient,
    StreamingClientOptions,
    StreamingParameters,
)

api_key = "<YOUR_API_KEY>"

client = StreamingClient(
    StreamingClientOptions(
        api_key=api_key,
        api_host="streaming.eu.assemblyai.com",
    )
)

client.connect(
    StreamingParameters(
        sample_rate=16000,
        speech_model="u3-rt-pro",
    )
)
client.stream(aai.extras.MicrophoneStream(sample_rate=16000))
python
import websocket
from urllib.parse import urlencode

YOUR_API_KEY = "<YOUR_API_KEY>"
CONNECTION_PARAMS = {"sample_rate": 16000, "speech_model": "u3-rt-pro"}
API_ENDPOINT_BASE_URL = "wss://streaming.eu.assemblyai.com/v3/ws"
API_ENDPOINT = f"{API_ENDPOINT_BASE_URL}?{urlencode(CONNECTION_PARAMS)}"

ws = websocket.WebSocketApp(
    API_ENDPOINT,
    header={"Authorization": YOUR_API_KEY},
)

ws.run_forever()
javascript
import { AssemblyAI } from "assemblyai";

const client = new AssemblyAI({
  apiKey: "<YOUR_API_KEY>",
  streamingBaseUrl: "wss://streaming.eu.assemblyai.com",
});

const transcriber = client.streaming.transcriber({
  sampleRate: 16_000,
  speechModel: "u3-rt-pro",
});

await transcriber.connect();
javascript
const WebSocket = require("ws");
const querystring = require("querystring");

const YOUR_API_KEY = "<YOUR_API_KEY>";
const CONNECTION_PARAMS = { sample_rate: 16000, speech_model: "u3-rt-pro" };
const API_ENDPOINT_BASE_URL = "wss://streaming.eu.assemblyai.com/v3/ws";
const API_ENDPOINT = `${API_ENDPOINT_BASE_URL}?${querystring.stringify(CONNECTION_PARAMS)}`;

const ws = new WebSocket(API_ENDPOINT, {
  headers: {
    Authorization: YOUR_API_KEY,
  },
});