Select The EU Region for EU Data Residency

In this guide, we’ll show you how to configure your code to utilise the EU endpoint when interacting directly with the API, as well as across our SDKs.

The EU endpoint is only available for Async STT. Streaming STT and LeMUR are not currently supported.

Get Started

Before we begin, make sure you have an AssemblyAI account and an API key. You can sign up for a free account and get your API key from your dashboard.

Python (Requests)

The only difference here is adding the eu. subdomain to the base URL. Everything else in your request code stays the same:

1# US endpoint (default)
2url = "https://api.assemblyai.com"
3
4# EU endpoint - just change the base URL
5url = "https://api.eu.assemblyai.com"

Python SDK

To set the EU endpoint as the base URL when using the Python SDK, add the following line of code before setting the Transcriber object:

1import assemblyai as aai
2
3aai.settings.base_url = "https://api.eu.assemblyai.com" // Set the base URL to the EU endpoint

Javascript (Axios)

Similar to the requests library for Python, the only difference here is adding the eu. subdomain to the base URL as follows:

1// US endpoint (default)
2const url = 'https://api.assemblyai.com'
3
4// EU endpoint - just change the base URL
5const url = 'https://api.eu.assemblyai.com'

Javascript SDK

To set the EU endpoint as the base URL when using the Javascript SDK, set the baseUrl parameter in your AssemblyAI client as follows:

1import { AssemblyAI } from "assemblyai";
2
3const client = new AssemblyAI({
4 apiKey: process.env.ASSEMBLYAI_API_KEY,
5 baseUrl: "https://api.eu.assemblyai.com" // Set the baseUrl to the EU endpoint
6});

Java SDK

To set the EU endpoint as the base URL when using the Java SDK, use the custom method from the Environment class in your builder pattern as follows:

1import com.assemblyai.api.AssemblyAI;
2import com.assemblyai.api.core.Environment;
3
4AssemblyAI aai = AssemblyAI.builder()
5 .apiKey("YOUR_API_KEY")
6 .environment(Environment.custom("https://api.eu.assemblyai.com")) // Set the environment to the EU endpoint
7 .build();

C# SDK

To set the EU endpoint as the base URL when using the C# SDK, set the BaseUrl parameter in the ClientOptions object before initializing the client as follows:

1using AssemblyAI;
2
3// Create ClientOptions object
4var options = new ClientOptions
5{
6 ApiKey = Environment.GetEnvironmentVariable("ASSEMBLYAI_API_KEY")!,
7 BaseUrl = "https://api.eu.assemblyai.com" // Set the base URL to the EU endpoint
8};
9
10// Initialize client with options
11var client = new AssemblyAIClient(options);

Go SDK

To set the EU endpoint as the base URL when using the Go SDK, specifically use the constructor NewClientWithOptions and use the WithBaseURL function to set the base URL as follows:

1package main
2
3import (
4 "github.com/AssemblyAI/assemblyai-go-sdk"
5 "os"
6)
7
8func main() {
9 apiKey := os.Getenv("ASSEMBLYAI_API_KEY")
10
11 client := assemblyai.NewClientWithOptions(
12 assemblyai.WithAPIKey(apiKey),
13 assemblyai.WithBaseURL("https://api.eu.assemblyai.com"), // Set the base URL to the EU endpoint
14 )
15}

If you encounter any issues or have any questions, reach out to our Support team.