This guide assumes you already have an API key (it looks like vk_live_…). Keep it secret — anyone with the key can spend your balance.
1

Set your API key

Export it as an environment variable so the examples below work as-is.
export SASHA_API_KEY="vk_live_your_key_here"
2

Check your account

Confirm the key works and see your balance.
curl https://api.trysasha.ru/v1/account \
  -H "Authorization: Bearer $SASHA_API_KEY"
Response
{
  "name": "Acme",
  "balance_rub": "1000.0000",
  "price_per_million_chars_rub": "1500.0000",
  "max_concurrency": 4,
  "provider": "Sasha AI"
}
3

Synthesize your first audio

Send text and save the returned MP3.
curl -X POST https://api.trysasha.ru/v1/speech \
  -H "Authorization: Bearer $SASHA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Привет! Это мой первый синтез речи.","voice":"sasha-lite"}' \
  --output speech.mp3
4

Play it

Open speech.mp3 in any audio player. That’s it!

Useful response headers

Every successful synthesis returns these headers:
HeaderMeaning
X-Request-IdUnique id of the request
X-Characters-BilledNumber of characters charged
X-Cost-RubCost of this request, in rubles
X-Balance-RubYour remaining balance

Next steps

Streaming

Get audio in real time, chunk by chunk.

Long texts

Synthesize articles and books smoothly.

Voices

See all available voices.

Errors

Understand error responses.