Mage API · Audio model
Eleven Speech API
ElevenLabs v4: lifelike speech you can direct
POST https://api.mage.space/v1/eleven_speech/generateAt a glance
The Eleven Speech API runs Eleven v4 through Mage at POST https://api.mage.space/v1/eleven_speech/generate. A request at the default settings costs 30 Gems (about $0.03), with no subscription. Eleven Speech takes no @handle mentions.
- AudioOutput
- 1Variant
- 30Gems per clip, default
- $0.03About, in USD
Overview
What the Eleven Speech API does
ElevenLabs v4 text to speech in 16 voices and 90+ languages, directed line by line with audio tags like [whispers] or [laughs].
ElevenLabs' expressive text to speech in 90+ languages, as an MP3 as long as the text. Audio tags in square brackets direct the delivery and add sound cues: [whispers], [laughs], [sarcastic], [door slams].
It generates from the prompt alone.
Quick start
Call the Eleven Speech API
Set MAGE_API_KEY, submit to /eleven_speech/generate, and poll status_url until the request completes.
cURL
STATUS_URL=$(curl --request POST 'https://api.mage.space/v1/eleven_speech/generate' \
--header "Authorization: Bearer $MAGE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"prompt": "Every lighthouse keeps one promise... to stay lit until morning. [softly] And this one never broke it.",
"model_id": "eleven-v4"
}' | jq -r '.status_url')
# Repeat until status is "completed"; result.url is the file
curl "$STATUS_URL" --header "Authorization: Bearer $MAGE_API_KEY"TypeScript
// npm install @mage-space/sdk
import Mage from '@mage-space/sdk';
const mage = new Mage(); // reads MAGE_API_KEY
const request = await mage.run('eleven_speech', {
prompt: 'Every lighthouse keeps one promise... to stay lit until morning. [softly] And this one never broke it.',
model_id: 'eleven-v4',
});
console.log(request.result.url);Python
# pip install mage-space
from mage_space import Mage
mage = Mage() # reads MAGE_API_KEY
request = mage.run("eleven_speech", {
"prompt": "Every lighthouse keeps one promise... to stay lit until morning. [softly] And this one never broke it.",
"model_id": "eleven-v4",
})
print(request["result"]["url"])Models
Eleven Speech model_id values
Send model_id to pick a variant. A request without one runs the default.
| model_id | Name | Default |
|---|---|---|
| eleven-v4 | Eleven v4 | Yes |
Options
Eleven Speech parameters
Allowed values across all variants; a variant may offer fewer. The docs list the options per variant.
| Field | Values |
|---|---|
| voice | darian, talia, elara, baxter, eldrin, elowen, kaelen, lawrence, alicia, maisie, warren, jade, caleb, sawyer, florence, wyatt |
Rules
What the Eleven Speech API enforces
- The prompt is the text to speak, at most 5000 characters, audio tags included.
- `voice` is one of darian, talia, elara, baxter, eldrin, elowen, kaelen, lawrence, alicia, maisie, warren, jade, caleb, sawyer, florence, wyatt.
- `stability` runs from 0 (expressive) to 1 (steady).
More audio models
Other audio generation APIs on Mage
Seed Audio API
Voices, music, and sound effects from one prompt
Eleven Music API
ElevenLabs songs, with vocals or without
FAQ
Frequently asked questions
How much does the Eleven Speech API cost?
What is the Eleven Speech API endpoint?
Which Eleven Speech models can I call?
Does Eleven Speech support reference images or characters?
Can I use Eleven Speech from Claude or ChatGPT?
How long are Eleven Speech results kept?
Start building with Mage
One account, one Gems balance, every model. Pay only for what you generate.