POST /v1/tts — Text-to-Speech API Reference
POST /v1/tts — Text-to-Speech API Reference
Convert text to natural-sounding speech audio via the Artnex API. Choose ElevenLabs or Kling voices and get a direct audio URL in the response.
POST
POST /v1/tts — Text-to-Speech API Reference
TheDocumentation Index
Fetch the complete documentation index at: https://docs.artnex.app/llms.txt
Use this file to discover all available pages before exploring further.
/v1/tts endpoint converts a text string into a natural-sounding audio file. You choose the voice model and an optional voice identifier; the API returns a URL to the generated audio file you can stream or download directly.
Endpoint
Request parameters
The text to convert to speech. Plain text only — no HTML or SSML markup. Maximum 5,000 characters per request.
The speech synthesis model to use. Accepted values:
"tts-elevenlabs"— ElevenLabs voice synthesis (10 credits). High-quality, natural-sounding output. Best for narration, marketing, and content creation."kling-tts"— Kling voice synthesis (100 credits). Extended capabilities for longer-form audio.
Identifier of the voice to use. Available voices depend on the chosen model. If omitted, the model’s default voice is used. Contact support for a full list of available voice IDs for your plan.
Response fields
true when the request completed successfully.Direct HTTPS URL to the generated audio file (MP3 format). The file is available for 24 hours; download it promptly if you need to keep it.
Duration of the generated audio clip in seconds.
Unique identifier for this request, useful for support queries or logging.
Total credits deducted from your account balance for this request.
Credit costs
| Model | Credits per request |
|---|---|
tts-elevenlabs | 10 |
kling-tts | 100 |
Credit costs are fixed per request regardless of text length, up to the 5,000-character limit. Break very long content into multiple requests if needed.
Example requests
Example response
Error codes
| HTTP status | Error code | Cause |
|---|---|---|
400 | missing_text | The text field is absent or empty |
400 | text_too_long | The text exceeds 5,000 characters |
400 | invalid_model | The model value is not "tts-elevenlabs" or "kling-tts" |
400 | invalid_voice_id | The voice_id is not available for the selected model |
401 | invalid_api_key | The API key is missing, malformed, or revoked |
402 | insufficient_credits | Your account does not have enough credits |
429 | rate_limit_exceeded | You have exceeded your plan’s daily request quota |