Speech API: synthesis and transcription

The same API key and LLM balance. TTS returns an audio file; STT returns a transcript.

Endpoints and authentication

MethodPathPurpose
GET/v1/audio/models?task=ttsSpeech catalog; the tts or stt task filter is optional.
POST/v1/audio/speechJSON → binary audio.
POST/v1/audio/transcriptionsmultipart/form-data → text or JSON.

Authorization: Bearer sk-your-tokenator-key

Models and capabilities

Models appear here after they are configured. Models available to your key: GET /v1/audio/models.

ModelAPI IDTaskMultiplier
Gemini 3.8 Flash TTSgemini-3.8-flash-ttsTTS2.5×

The catalog exposes audio_options with the task, formats and default voice. Use an API ID from the catalog. TTS and STT use separate models; chat endpoints refuse them.

TTS: text to audio

curl
curl https://api.tokenator.top/v1/audio/speech \
  -H "Authorization: Bearer sk-your-tokenator-key" \
  -H "Content-Type: application/json" \
  --output speech.mp3 \
  -d '{
  "input": "Hello!",
  "model": "gemini-3.8-flash-tts",
  "response_format": "mp3",
  "voice": "Zephyr"
}'

Required fields: model, non-empty input, and voice when no default voice is configured. The default response_format is mp3. Fields such as speed, instructions, language, sample_rate and other model parameters pass upstream. Support depends on the model. The response is a binary file; save it to disk. SSE is not supported.

Python
import requests

r = requests.post(
    "https://api.tokenator.top/v1/audio/speech",
    headers={"Authorization": "Bearer sk-your-tokenator-key"},
    json={"model": "gemini-3.8-flash-tts", "input": "Hello!", "voice": "Zephyr"},
    timeout=300,
)
r.raise_for_status()
with open("speech.mp3", "wb") as f:
    f.write(r.content)

STT: audio to text

curl
curl https://api.tokenator.top/v1/audio/transcriptions \
  -H "Authorization: Bearer sk-your-tokenator-key" \
  -F 'model=your-stt-model' \
  -F 'file=@recording.wav' \
  -F 'response_format=json'
JSON
{"text":"Hello!","usage":{"prompt_tokens":6,"completion_tokens":0,"total_tokens":6}}

Requires model and one non-empty file up to 25 MiB. Let your client set Content-Type with the multipart boundary. response_format: json (default), text or verbose_json. Optional language, prompt and temperature are passed through; support depends on the upstream. An empty transcript for silence is valid.

Token billing

Uses the shared LLM balance and the model or selected binding multiplier. With usage, billing follows LLM rules: all input (including cache reads), plus cache writes and output. Speech does not show caching separately in its interface.

Without usage, 1 Unicode character = 1 token. TTS counts the original input; STT counts the transcript. Spaces and punctuation count too. For example, 100 characters at ×2 consume 200 LLM tokens. Only successful results are charged; errors are not charged. Image and video generation quotas are not used.

Counts before the multiplier are returned in X-Tokenator-Input-Tokens, X-Tokenator-Output-Tokens and X-Tokenator-Total-Tokens. STT JSON also includes usage. Check the key's history for the final charge.

Errors

HTTPReason
400Missing a required field, wrong model task or format, or SSE requested.
401 / 403Invalid key or model access denied.
413Audio file is too large.
429LLM quota or request limit reached.
502 / 503The upstream failed or returned an invalid result. No tokens are charged.

FAQ

Do I need a separate Speech key?

No. Use a key with LLM tokens and access to the Speech model.