Audio Cleaner (Text To Speech) API - Complete Integration Guide
The Text To Speech (TTS) API converts text into audio files. It supports multiple languages, voices, emotions, and speed settings, and is suitable for dubbing, narration, podcast production, and customer service voice scenarios.
Overview
Key Features
Rich voice parameter customization: configure voice_id, emotion, speed, and language for personalized speech styles.
Diverse voice and language options: integrated multi-language, multi-voice library with continuous updates for different use cases.
Fast response: TTS tasks are processed quickly, often generating high-quality audio in seconds for batch or real-time scenarios.
Powerful AI speech modeling: advanced AI models restore text emotion and intonation for natural, human-like voice output.
Authentication
All API requests require an api-key. Include your API key in the request header:
API Host: https://audiocleaner.ai/
api-key: YOUR_API_KEY
Credit Billing Rules
Text Length
Credit Deduction Rule
<= 100 characters
1 credit
101 ~ 200 characters
2 credits
201 ~ 300 characters
3 credits
...
...
Rule: 1 credit is charged for every 100 characters, and any remainder under 100 still counts as 1 credit.
Example: 215 characters consumes 3 credits.
Example: 60 characters consumes 1 credit.
1. Create TTS Task
Endpoint
POST /audio/api/v1/api-keys/tts/task/create
Request Headers
Header
Type
Required
Description
Content-Type
string
✅
application/json
api-key
string
✅
YOUR_API_KEY
Request Parameters (Body · JSON)
Parameter
Type
Required
Description
voice_id
number
Yes
Voice ID (can be retrieved from the voice list API)
emotion
number
Yes
Emotion parameter (depends on voice support)
speed
number
Yes
Speech speed multiplier (e.g., 1 is default)
language
string
Yes
Language, e.g. en
text
string
Yes
Text content to synthesize
Supported Languages
Language
Key
All
all
Simplified Chinese
zh
English
en
Arabic
ar
Russian
ru
Spanish
es
French
fr
Portuguese
pt
German
de
Korean
ko
Japanese
ja
Cantonese Chinese
zh_yue
Supported Speed Multipliers
Speed
Value
Slow
0.5
Standard
1
Fast
2
Supported Emotion Parameters
Emotion
Key
ID
Auto
auto
0
Happy
happy
1
Angry
angry
2
Sad
sad
3
Afraid
afraid
4
Disgusted
disgusted
5
Melancholic
melancholic
6
Surprised
surprised
7
Calm
calm
8
Note: language and speed options can be extended according to actual TTS capabilities.
Parameter Example (JSON)
{
"voice_id": 2072,
"emotion": 0,
"speed": 1,
"language": "en",
"text": "Faced with growing backlash, US President Donald Trump appears to have removed a controversial Truth Social post depicting himself as a Jesus-like figure.\n\nThe AI-generated image, which showed Trump appearing to heal a sick man in a hospital bed, sparked fierce backlash from both sides of the US political spectrum, including from some of Trump's most ardent supporters."
}
Use this API to query task status. Request headers must include api-key.
The backend validates API key legality, including but not limited to key existence, rate limit, concurrency limit, credit sufficiency, and task existence.
The API returns different task states and explicit error codes for failure cases.
Gender enum value (based on platform enum definitions)
records.language
string
Language key, e.g. en
records.age
number
Age enum value (based on platform enum definitions)
records.emotion
string[]
Supported emotion list for the current voice
records.name
string
Internal system name
records.display_name
string
Display name for frontend
Recommended Usage Flow
Call the voice list API to fetch voice_id and available parameters.
Call the create-task API, submit text, and get job_id.
Poll the task status API until status = success.
Read output and download/play the generated audio.
FAQ
If a task fails, will credits or fees still be deducted?
Third-party service platforms usually charge only when task status is success and output is available. Please refer to actual billing logic for final rules.
Why do I get "Task not found" when querying task status?
Common reasons include non-existing or expired job_id, or mismatch between job_id and current API key/account. Ensure request parameters and authentication are correct and consistent.
What should I do if task status stays in waiting for a long time?
Queue delays may occur for popular voices or high-volume tasks. Increase polling attempts or polling intervals appropriately. If there is still no progress for a long time, contact platform technical support.