Synthesis is billed per character of the text field.

Formula

characters = number of Unicode characters in `text`
cost (RUB) = characters / 1,000,000 × price_per_million_chars_rub
  • previous_text and next_text are not billed.
  • Failed and rejected requests are not billed (but are recorded in history).
  • Your price (price_per_million_chars_rub) is shown by GET /v1/account.

Balance & overdraft

Each request checks your balance before running. A small overdraft may be allowed (configured per account); once the limit is reached, requests return 402 insufficient_balance. After each successful request, the response includes:
HeaderMeaning
X-Characters-BilledCharacters charged
X-Cost-RubCost of the request
X-Balance-RubRemaining balance

Check your balance any time

curl https://api.trysasha.ru/v1/account \
  -H "Authorization: Bearer $SASHA_API_KEY"