SonnaLabs is now on Google Play.
Get the app
SonnaLabs text to speech API

Add lifelike speech to your product

One request turns text into audio with the voices of ElevenLabs, HeyGen and Google Cloud.

For paid plans and credit packs, from your own server

curl -X POST https://api.sonnalabs.app/api/v1/tts/synthesize \
  -H "Authorization: Bearer $SONNA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "text": "Welcome to SonnaLabs, where your words turn into lifelike speech in seconds.",
    "voice": "06f2ddd4-70ab-4e0f-a92f-8504bef52533",
    "ttsModel": "eleven-v4-turbo"
  }'
Response · 200 OK
{
  "url": "https://…/speech.mp3",
  "remainingCredits": 108420
}
Quick start

From key to audio in three steps

  1. 01

    Create a key

    Open the console, name a key and copy it once. It starts with sona_sk_.

    sona_sk_1a2b3c…
  2. 02

    Send the text

    POST the text, a voice and a model. The call waits for the audio and returns it.

    POST /api/v1/tts/synthesize
  3. 03

    Play the file

    The response holds the address of the finished audio and your remaining credits.

    { "url": "…", "remainingCredits": … }
Endpoints

Everything the API exposes

Every request goes to the same host and carries your key.

Base URLhttps://api.sonnalabs.app
  • POST/api/v1/tts/synthesizeSpeech from one voice.
  • POST/api/v1/tts/synthesize-dialogueA conversation between several voices.
  • POST/api/v1/tts/enhanceAdds expressive audio tags to your text.
  • GET/api/v1/tts/voicesThe voices you can use, with their ids.
  • GET/api/v1/tts/modelsThe models and what each one needs.
  • GET/api/v1/user/creditsYour credit balance and plan.
Authentication

One key, two ways to send it

Put the key in an Authorization header or in X-API-Key; both work on every endpoint. Keep it on your server, out of pages and apps that others can open, and never in a URL.

Authorization: Bearer sona_sk_…

# or

X-API-Key: sona_sk_…
Models

The ttsModel values

Pass one of these ids. The voice must belong to the same provider as the model.

ttsModel
Model
Provider
Access
eleven-v4
Eleven v4
ElevenLabs
Paid
eleven-v4-turbo
Eleven v4 Turbo
ElevenLabs
Paid
eleven-v3
Eleven v3
ElevenLabs
Paid
eleven-multilingual-v2
Multilingual v2
ElevenLabs
Paid
eleven-flash-v2-5
Flash v2.5
ElevenLabs
Paid
heygen-voice
HeyGen Voice
HeyGen
Paid
heygen-voice-turbo
HeyGen Voice Turbo
HeyGen
Free plan
google-neural2
Neural2
Google Cloud
Free plan
google-wavenet
Wavenet
Google Cloud
Free plan
Reliability

Built to be called by machines

Charged only for success

Credits are taken before the audio is made and returned automatically when a request fails.

Safe retries

Send an Idempotency-Key and a retry after a dropped connection is answered from the first attempt, never charged twice.

Limits you can read

Rate-limited endpoints answer with X-RateLimit-Limit, -Remaining and -Reset, and a Retry-After on 429.

Errors

Know what went wrong

Errors come back as JSON with a code you can branch on.

Status
Code
Meaning
Credits
400
INVALID_REQUEST
The text or the voice is missing.
Not charged
400
TEXT_TOO_LONG
The text is longer than the model or your plan allows.
Not charged
402
INSUFFICIENT_CREDITS
The balance is too low. Nothing is charged.
Not charged
403
PAID_ACCESS_REQUIRED
The model needs a paid plan or credit packs.
Not charged
409
DUPLICATE_REQUEST_RETRY
The same Idempotency-Key is still being processed.
Not charged
429
RATE_LIMIT_EXCEEDED
Too many requests. Wait for the seconds in Retry-After.
Not charged
503
PROVIDER_BUSY
The provider is over capacity. Retry after Retry-After.
Refunded
Console

Manage it in one place

API keys

Create and revoke keys, up to 10 active at a time. A key is shown once.

Analytics

See the credits you spend, day by day, and where they go.

Request log

Check the latest requests and whether they succeeded, without logging on your side.

Models

Browse the catalog with the ids you put in a request.

Ready to build?

Create a key in the console and make your first request in minutes.

FAQ

Frequently asked questions

Have more questions?

Contact us
Contact us

What can I build with the API?

Is there an API for images, video, music or chat?

Who can create a key?

How do I authenticate?

What does a request cost?

Can I keep the audio at the address I get back?