Text to speech
Synthesize MP3 with Speech Light, Speech Pro, or Speech Expressive. Read GET /v1/speech/catalog for available voices and local prices. Legacy Qwen voices are no longer supported.
POST /v1/chat/speech| Parameters | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to be read; maximum 2,000 UTF-16 units |
voice | string | No | Complete catalog voice ID, such as speech-light:af_alloy; defaults to an available configured voice |
stream | boolean | No | Default false; true returns binary MP3 audio, not JSON or SSE |
curl -X POST https://api.modelgo.moneygo.ai/v1/chat/speech \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{"text":"The API integration is working","voice":"speech-light:af_alloy"}'The non-streaming response includes audio (data:audio/mpeg;base64,...), voice, and billing with local credits, billable characters, model and price per 1,000 characters. Audio can be used as an <audio> element's src.
Each model is priced separately per 1,000 UTF-16 units, using upstream's normalized character count and rounding the total up to eight decimals. Ordinary letters count as one unit; 😀 counts as two. Failed synthesis releases reserved credits. Replaying existing audio is free; synthesizing again incurs a new charge.
For OpenAI SDKs use POST /v1/audio/speech with model, input, voice and optional response_format="mp3"; it returns binary MP3. Only this documented parameter subset is supported. See full examples, streaming, billing and error handling.
