ElevenLabs API
ReachAPI offers ElevenLabs text to speech, sound effects, and music through synchronous endpoints. Paths, request bodies, and query parameters are the same as in the ElevenLabs API, and a successful response body is the audio file itself, so the official ElevenLabs SDK works after you switch the base URL and API key.
Model ID (model_id) | Use | Endpoint | Price |
|---|---|---|---|
eleven_multilingual_v2 | Text to speech | POST /v1/text-to-speech/{voice_id} | $0.08 / 1K characters |
eleven_v3 | Text to speech | POST /v1/text-to-speech/{voice_id} | $0.08 / 1K characters |
eleven_flash_v2_5 | Text to speech | POST /v1/text-to-speech/{voice_id} | $0.04 / 1K characters |
eleven_text_to_sound_v3 | Sound effects | POST /v1/sound-generation | $0.12 / minute |
music_v2_5 | Music | POST /v1/music | $0.15 / minute |
GET /v2/voices lists the voices you can use and is free. When model_id is omitted, each endpoint uses its default: eleven_multilingual_v2 for text to speech, eleven_text_to_sound_v3 for sound effects, and music_v2_5 for music.
What is supported:
- Text to speech with three models, voice settings,
previous_textandnext_textfor a consistent tone across segments, and mp3, Opus, WAV, PCM, μ-law, and A-law output - Sound effects from 0.5 to 30 seconds, including seamless loops for ambient sound
- Music from 3 seconds to 10 minutes, with an instrumental-only mode
- Voice listing
- ElevenLabs-style errors, so the official SDK parses them as usual
Section 9 has copy-and-paste test cases for every endpoint.
1. Base URL and Authentication
Base URL: https://direct.reachapi.ai
Send your ReachAPI key in the xi-api-key header, which is how the official ElevenLabs SDK sends keys. Authorization: Bearer YOUR_REACH_API_KEY also works; when both are present, xi-api-key is used.
curl "https://direct.reachapi.ai/v2/voices?page_size=5" \
-H "xi-api-key: YOUR_REACH_API_KEY"Official Python SDK (pip install elevenlabs):
from elevenlabs.client import ElevenLabs
client = ElevenLabs(
base_url="https://direct.reachapi.ai",
api_key="YOUR_REACH_API_KEY",
timeout=600,
)The SDK's default timeout is 240 seconds. Generation can take longer, so raise it as above (see section 7). Every response carries a request-id header; include it when you report a problem.
2. Text to Speech
POST /v1/text-to-speech/{voice_id}
The request body and query parameters follow the ElevenLabs text-to-speech reference and are forwarded unchanged. Common fields:
| Field | Description |
|---|---|
voice_id (path) | Voice to use; get one from GET /v2/voices. Letters, digits, _ and - only, up to 64 characters |
text | Required. The text to read aloud; Chinese lines can be written directly |
model_id | eleven_multilingual_v2 (default), eleven_v3, or eleven_flash_v2_5 |
voice_settings, seed, previous_text, next_text | Same as the ElevenLabs reference; other fields in the reference are forwarded as well |
output_format (query) | Default mp3_44100_128; values below |
output_format values: mp3_22050_32, mp3_24000_48, mp3_44100_{32,64,96,128,192}, opus_48000_{32,64,96,128,192}, pcm_{8000,16000,22050,24000,32000,44100,48000}, wav_{8000,16000,22050,24000,32000,44100,48000}, ulaw_8000, alaw_8000. Some high-bitrate and high-sample-rate formats may be unavailable; the request then fails, so use the default format instead.
previous_request_ids and next_request_ids cannot be used: the request-id in a ReachAPI response is ReachAPI's own, not an ElevenLabs request ID. To keep the tone consistent across consecutive segments, use previous_text and next_text.
Each model has a per-request character limit: eleven_multilingual_v2 10,000, eleven_v3 5,000, and eleven_flash_v2_5 40,000. A longer text is rejected by ElevenLabs and its error response is returned unchanged.
curl "https://direct.reachapi.ai/v1/text-to-speech/VOICE_ID?output_format=mp3_44100_128" \
-H "xi-api-key: YOUR_REACH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "你来晚了。", "model_id": "eleven_multilingual_v2"}' \
--output line.mp3Official Python SDK:
audio = client.text_to_speech.convert(
voice_id="VOICE_ID",
text="你来晚了。",
model_id="eleven_multilingual_v2",
output_format="mp3_44100_128",
)
with open("line.mp3", "wb") as f:
for chunk in audio:
f.write(chunk)3. Sound Effects
POST /v1/sound-generation
The request body follows the ElevenLabs sound effects reference:
| Field | Description |
|---|---|
text | Required. Describes the sound effect |
duration_seconds | 0.5 to 30 seconds; if omitted, the model chooses a length from the prompt |
loop | true generates a seamlessly looping clip, suited to ambient sound. For a long ambience, generate one loop and let the player repeat it |
model_id | Only eleven_text_to_sound_v3; it is also the default |
output_format (query) | Same values as text to speech; default mp3_44100_128 |
curl "https://direct.reachapi.ai/v1/sound-generation" \
-H "xi-api-key: YOUR_REACH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "night forest ambience with crickets", "duration_seconds": 20, "loop": true}' \
--output forest_loop.mp3Official Python SDK:
audio = client.text_to_sound_effects.convert(
text="night forest ambience with crickets",
duration_seconds=20,
loop=True,
model_id="eleven_text_to_sound_v3",
)4. Music
POST /v1/music
The request body follows the ElevenLabs music reference:
| Field | Description |
|---|---|
prompt | Describes the scene; use either prompt or composition_plan |
composition_plan | Structured plan as defined in the ElevenLabs reference; cannot be combined with prompt |
music_length_ms | 3000 to 600000; prompt mode only; if omitted, the model chooses a length |
force_instrumental | true guarantees no vocals; prompt mode only |
model_id | Only music_v2_5; it is also the default |
output_format (query) | Default auto. Values: auto, mp3_22050_32, mp3_24000_48, mp3_44100_{32,64,96,128,192}, mp3_48000_{128,192,240,320}, opus_48000_{32,64,96,128,192}, pcm_{8000,16000,22050,24000,32000,44100,48000}, ulaw_8000, alaw_8000. No WAV |
curl "https://direct.reachapi.ai/v1/music" \
-H "xi-api-key: YOUR_REACH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "calm acoustic guitar town theme", "music_length_ms": 60000, "force_instrumental": true}' \
--max-time 600 --output town.mp3Official Python SDK:
audio = client.music.compose(
prompt="calm acoustic guitar town theme",
music_length_ms=60000,
force_instrumental=True,
model_id="music_v2_5",
)Music output is covered by ElevenLabs' separate Music terms. Check them before using the output in a commercial project.
5. List Voices
GET /v2/voices
Returns the voices available on ReachAPI; every user sees the same list. Query parameters such as page_size, search, and next_page_token follow the ElevenLabs voices reference. The request is free. Use a returned voice_id in text-to-speech requests, and keep your own mapping between characters and voice_id values.
Official Python SDK:
voices = client.voices.search(page_size=5)6. Billing
Prices are the official ElevenLabs prices with no markup (see the table at the top).
- Text to speech is billed per character of the request
text. Every Unicode character counts: punctuation and spaces count, and each Chinese character or emoji counts as 1. - Sound effects and music are billed per minute of the audio actually returned. The returned length can differ from the requested length, and billing follows the returned length.
- Only successful requests are billed. Failed and timed-out requests are not.
- At submission ReachAPI reserves $0.01 of your balance; with less than that available the request returns 402. On success the final charge is settled on actual usage, and on failure the reservation is released in full.
7. Timeouts and Retries
These endpoints are synchronous: the response arrives when generation finishes, and ReachAPI waits up to 600 seconds for ElevenLabs. In our tests a 60-second track came back in about 6 seconds; longer tracks were not measured.
Set your client timeout to at least 600 seconds and turn off automatic retries. After a timeout or a dropped connection the request may still have completed, and a retry generates and bills again, so check whether you still need the audio before resending. In the official Python SDK, pass request_options={"max_retries": 0} on each generation call, as the script in section 9 does.
8. Errors
Errors from ReachAPI use the ElevenLabs shape, so the official SDK raises its usual exception with the parsed body:
{
"detail": {
"status": "api_key_not_found",
"message": "API key is invalid"
}
}| Status | detail.status | Meaning |
|---|---|---|
| 400 | bad_request | Invalid parameter: a malformed voice_id, output_format, or model_id, or a model that does not exist |
| 400 | model_not_available_on_endpoint | model_id belongs to another endpoint, such as music_v2_5 on the text-to-speech endpoint |
| 400 | invalid_json_body, request_body_required | The body is not a JSON object, or is missing |
| 400, 422 | ElevenLabs' own body | Parameter errors decided by ElevenLabs (text too long, unknown voice, out-of-range values) keep ElevenLabs' status and body |
| 401 | api_key_missing, api_key_not_found | No key was sent, or the key is invalid |
| 402 | user_quota_exceeded | Not enough available credits |
| 403 | model_not_in_group | The model is not included in the access group bound to your API key |
| 429 | upstream_rate_limited, or a ReachAPI limit code | The service is busy, or you hit a ReachAPI rate limit; retry later |
| 502 | upstream_response_invalid | ElevenLabs returned unusable audio; not billed |
| 503 | upstream_error | Temporarily unavailable; the message is always The model service is temporarily unavailable. Please try again later. |
| 504 | upstream_timeout | ElevenLabs timed out; not billed |
9. Test Cases
The commands below need curl and jq. Running all successful cases costs about $0.05 in total; the error cases are rejected before any audio is generated and are not billed.
export REACH_API_KEY="YOUR_REACH_API_KEY"
export BASE="https://direct.reachapi.ai"Successful requests
-D - prints the response headers, so you can check the status line and Content-Type; the audio is saved to a file.
C1. List voices (free)
curl -s "$BASE/v2/voices?page_size=5" -H "xi-api-key: $REACH_API_KEY" -o voices.json
jq '.voices[] | {voice_id, name}' voices.json
export VOICE_ID=$(jq -r '.voices[0].voice_id' voices.json)Expected: voices.json holds a voices array and every item has voice_id and name. No charge. The next cases use VOICE_ID.
C2. Text to speech, default model
curl -s -D - "$BASE/v1/text-to-speech/$VOICE_ID" \
-H "xi-api-key: $REACH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "你来晚了,Reach 2026!😀"}' \
-o line.mp3Expected: HTTP/1.1 200 OK, a Content-Type starting with audio/mpeg, and a request-id header; line.mp3 plays the line. Billed for 17 characters (punctuation, spaces, and the emoji each count as 1): 17 × $0.08 / 1,000 = $0.00136.
C3. Text to speech, Flash model and a smaller format
curl -s -D - "$BASE/v1/text-to-speech/$VOICE_ID?output_format=mp3_22050_32" \
-H "xi-api-key: $REACH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "你来晚了,Reach 2026!😀", "model_id": "eleven_flash_v2_5"}' \
-o line_flash.mp3Expected: HTTP 200 and a Content-Type starting with audio/mpeg; line_flash.mp3 is a 22.05 kHz, 32 kbps mp3. Billed at half the price of C2: 17 × $0.04 / 1,000 = $0.00068.
C4. Sound effect, 5-second loop
curl -s -D - "$BASE/v1/sound-generation" \
-H "xi-api-key: $REACH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "night forest ambience with crickets", "duration_seconds": 5, "loop": true}' \
-o forest_loop.mp3Expected: HTTP 200; forest_loop.mp3 is about 5 seconds long and loops without a gap. Billed by the returned duration: about 5 s × $0.12 / 60 = $0.01.
C5. Music, 10 seconds, no vocals
curl -s -D - "$BASE/v1/music" \
-H "xi-api-key: $REACH_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "calm acoustic guitar town theme", "music_length_ms": 10000, "force_instrumental": true}' \
--max-time 600 -o town.mp3Expected: HTTP 200; town.mp3 is about 10 seconds long with no vocals. Billed by the returned duration, which can differ from the requested length: about 10 s × $0.15 / 60 = $0.025.
Error cases
Send each request with the same headers as above (xi-api-key and Content-Type: application/json) unless the case says otherwise, and add -i to see the status line. Check the status code and detail.status; the message text may change.
| Case | Request | Status | detail.status |
|---|---|---|---|
| E1 | POST /v1/sound-generation with no key header | 401 | api_key_missing |
| E2 | POST /v1/sound-generation with xi-api-key: wrong-key | 401 | api_key_not_found |
| E3 | POST /v1/music with {"prompt": "x", "model_id": "eleven_v3"} | 400 | model_not_available_on_endpoint |
| E4 | POST /v1/music?output_format=wav_44100 with {"prompt": "x"} | 400 | bad_request |
| E5 | POST /v1/text-to-speech/bad.id with {"text": "x"} | 400 | bad_request |
| E6 | POST /v1/text-to-speech/$VOICE_ID with {"text": "x", "model_id": "no_such"} | 400 | bad_request |
| E7 | POST /v1/sound-generation with {"text": "x", "duration_seconds": 0.1} | 400 | invalid_generation_settings |
| E8 | POST /v1/music with {"prompt": "x", "music_length_ms": 1000} | 422 | none: detail is an array |
E7 and E8 are decided by ElevenLabs and returned unchanged. For E8, detail[0].loc is ["body", "music_length_ms"].
Official SDK smoke test
Save as sdk_smoke.py and run REACH_API_KEY=YOUR_REACH_API_KEY python sdk_smoke.py. It lists a voice, generates speech, a sound effect, and music, and checks that a model on the wrong endpoint raises the expected error.
import os
from elevenlabs.client import ElevenLabs
from elevenlabs.core.api_error import ApiError
client = ElevenLabs(
base_url="https://direct.reachapi.ai",
api_key=os.environ["REACH_API_KEY"],
timeout=600, # the SDK default is 240 seconds
)
NO_RETRY = {"max_retries": 0} # generation requests are billed, so never retry them automatically
def save(chunks, path):
data = b"".join(chunks)
assert data, f"{path}: empty response"
with open(path, "wb") as f:
f.write(data)
print(f"ok {path} {len(data)} bytes")
voice_id = client.voices.search(page_size=1).voices[0].voice_id
print("ok voices.search ->", voice_id)
save(
client.text_to_speech.convert(
voice_id=voice_id,
text="你来晚了,Reach 2026!😀",
model_id="eleven_multilingual_v2",
output_format="mp3_44100_128",
request_options=NO_RETRY,
),
"sdk_line.mp3",
)
save(
client.text_to_sound_effects.convert(
text="night forest ambience with crickets",
duration_seconds=2,
loop=True,
model_id="eleven_text_to_sound_v3",
request_options=NO_RETRY,
),
"sdk_forest_loop.mp3",
)
save(
client.music.compose(
prompt="calm acoustic guitar town theme",
music_length_ms=3000,
force_instrumental=True,
model_id="music_v2_5",
request_options=NO_RETRY,
),
"sdk_town.mp3",
)
# Errors keep the ElevenLabs shape, so the SDK raises ApiError with the parsed body.
try:
b"".join(
client.text_to_speech.convert(
voice_id=voice_id, text="x", model_id="music_v2_5", request_options=NO_RETRY
)
)
raise SystemExit("expected a 400 for a music model on the speech endpoint")
except ApiError as e:
assert e.status_code == 400, e.status_code
print("ok wrong-endpoint model ->", e.status_code, e.body["detail"]["status"])Expected: five lines starting with ok, the three .mp3 files saved, and exit code 0. Billed about $0.013 (17 characters of speech, 2 seconds of sound effect, 3 seconds of music).
10. Not Supported Yet
Multi-speaker dialogue (/v1/text-to-dialogue), endpoints with timestamps, streaming and WebSocket endpoints, voice cloning, voice design, dubbing, speech-to-text, and the SDK's models.list() and user-information calls. GET /v1/models is ReachAPI's own model list, not in the ElevenLabs format. Access to each model remains subject to your API key and group permissions.