---
title: "How to Switch from OpenAI Voice to ElevenLabs"
description: "Switch OpenAI text-to-speech to ElevenLabs without replacing the OpenAI SDK. Change the base URL, API key, model, and voice with AllModels."
canonical: "https://allmodels.io/guides/how-to-switch-from-openai-voice-to-elevenlabs"
markdown: "https://allmodels.io/guides/how-to-switch-from-openai-voice-to-elevenlabs.md"
author: "AllModels"
datePublished: "2026-07-30"
dateModified: "2026-07-30"
---

# How to Switch from OpenAI Voice to ElevenLabs

Keep the OpenAI SDK. Point it at AllModels, then replace the model and voice. Your speech-generation call stays the same.

## The short answer

1. Use your AllModels API key and set the SDK base URL to `https://api.allmodels.io/oai`.
2. Set the model to `elevenlabs/eleven-v3` and replace `ELEVENLABS_VOICE_ID` with an [ElevenLabs voice ID](https://allmodels.io/model?model=elevenlabs%2Feleven-v3#voices).

> AllModels is an independent service and is not affiliated with, endorsed by, or sponsored by OpenAI, ElevenLabs, Fish Audio, or Cartesia.

## Code

These examples generate an MP3 response. The provider migration only changes the client configuration, model, and voice.

### JavaScript

Before — OpenAI:

```javascript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY
});

const speech = await client.audio.speech.create({
  model: "gpt-4o-mini-tts",
  voice: "OPENAI_VOICE",
  input: "Hello from my application",
  response_format: "mp3"
});
```

After — ElevenLabs through AllModels:

```javascript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.ALLMODELS_API_KEY,
  baseURL: "https://api.allmodels.io/oai"
});

const speech = await client.audio.speech.create({
  model: "elevenlabs/eleven-v3",
  voice: "ELEVENLABS_VOICE_ID",
  input: "Hello from my application",
  response_format: "mp3"
});
```

### Python

Before — OpenAI:

```python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["OPENAI_API_KEY"],
)

with client.audio.speech.with_streaming_response.create(
    model="gpt-4o-mini-tts",
    voice="OPENAI_VOICE",
    input="Hello from my application",
    response_format="mp3",
) as response:
    response.stream_to_file("speech.mp3")
```

After — ElevenLabs through AllModels:

```python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["ALLMODELS_API_KEY"],
    base_url="https://api.allmodels.io/oai",
)

with client.audio.speech.with_streaming_response.create(
    model="elevenlabs/eleven-v3",
    voice="ELEVENLABS_VOICE_ID",
    input="Hello from my application",
    response_format="mp3",
) as response:
    response.stream_to_file("speech.mp3")
```

## Keep using the OpenAI SDK

Switching providers through AllModels is intentionally simple: keep the SDK and request flow you already use, point the client at AllModels, then choose a different model and voice.

The compatible OpenAI SDK surface supports:

- [text-to-speech and streamed speech responses](https://docs.allmodels.io/openai/text-to-speech)
- [file transcription](https://docs.allmodels.io/openai/transcription)
- [realtime transcription](https://docs.allmodels.io/openai/realtime)

Read the [complete OpenAI SDK compatibility guide](https://docs.allmodels.io/openai) for setup details, supported methods, and current limitations.

## About Eleven v3

Eleven v3 is ElevenLabs’ generally available, most advanced text-to-speech model. ElevenLabs says the production release is more stable and more accurate than the earlier alpha, especially when reading numbers, symbols, and specialized notation across languages.

In its internal benchmark across 27 categories and eight languages, ElevenLabs reports a 68% reduction in errors. That makes v3 particularly relevant for scripts containing phone numbers, currencies, formulas, scores, URLs, and other context-sensitive text.

- [Read ElevenLabs’ Eleven v3 announcement](https://elevenlabs.io/blog/eleven-v3-is-now-generally-available)

## Common migration questions

### Do I need to replace the OpenAI SDK?

No. Keep the installed SDK and its speech method. AllModels exposes a compatible base URL for it.

### Can I reuse my OpenAI voice?

No. Choose a voice from the [Eleven v3 voice list](https://allmodels.io/model?model=elevenlabs%2Feleven-v3#voices), then replace `ELEVENLABS_VOICE_ID` with its ID.

### Can I switch providers again later?

Yes. Keep the AllModels base URL and API key, then change the model and voice to another supported provider.

## Continue

- [Browse ElevenLabs models](https://allmodels.io/models?provider=elevenlabs)
- [Read the AllModels documentation](https://docs.allmodels.io)
- [View the canonical HTML guide](https://allmodels.io/guides/how-to-switch-from-openai-voice-to-elevenlabs)
