🔥Горячая функция
Бесплатное онлайн-удаление музыки из видео
Чистый звукРазделение звукаЭффективно
🔥Горячая функция
Самый быстрый AI-генератор профессиональных портретов - 100% бесплатно. Попробуйте сейчас
🔥Горячая функция
Бесплатное онлайн-удаление музыки из видео
Чистый звукРазделение звукаЭффективно
🔥Горячая функция
Самый быстрый AI-генератор профессиональных портретов - 100% бесплатно. Попробуйте сейчас

API Doc

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 LengthCredit Deduction Rule
<= 100 characters1 credit
101 ~ 200 characters2 credits
201 ~ 300 characters3 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

HeaderTypeRequiredDescription
Content-Typestringapplication/json
api-keystringYOUR_API_KEY

Request Parameters (Body · JSON)

ParameterTypeRequiredDescription
voice_idnumberYesVoice ID (can be retrieved from the voice list API)
emotionnumberYesEmotion parameter (depends on voice support)
speednumberYesSpeech speed multiplier (e.g., 1 is default)
languagestringYesLanguage, e.g. en
textstringYesText content to synthesize

Supported Languages

LanguageKey
Allall
Simplified Chinesezh
Englishen
Arabicar
Russianru
Spanishes
Frenchfr
Portuguesept
Germande
Koreanko
Japaneseja
Cantonese Chinesezh_yue

Supported Speed Multipliers

SpeedValue
Slow0.5
Standard1
Fast2

Supported Emotion Parameters

EmotionKeyID
Autoauto0
Happyhappy1
Angryangry2
Sadsad3
Afraidafraid4
Disgusteddisgusted5
Melancholicmelancholic6
Surprisedsurprised7
Calmcalm8
  • 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."
}

Response Format (Unified)

{
  "code": 100000,
  "data": {
    "job_id": "33b6251d7ba94edea8361c318736e746"
  },
  "message": "Request Success"
}

Response Code (code) Description

codeMeaningMessage Example
100000SuccessRequest Success
100100Insufficient credit balanceInsufficient credit balance
101002Invalid API keyInvalid API key
101003API rate limit triggeredAPI key rate limit exceeded
101004Concurrency limit triggeredAPI key concurrent request limit exceeded
101005API key disabledYour account is suspended. Status cannot be modified. Please contact the administrator
101006API key not enabledAPI key not enabled

Example

curl --location --request POST 'https://audiocleaner.ai/audio/api/v1/api-keys/tts/task/create' \
  --header 'Content-Type: application/json' \
  --header 'api-key: YOUR_API_KEY' \
  --data-raw '{
    "voice_id": 2072,
    "emotion": 0,
    "speed": 1,
    "language": "en",
    "text": "Hello from Audio Cleaner TTS API."
  }'

2. Query TTS Task Status

Interface Description

  • 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.

Endpoint

POST /audio/api/v1/api-keys/tts/task/get

Request Headers

HeaderTypeRequiredDescription
Content-Typestringapplication/json
api-keystringYOUR_API_KEY

Request Parameters (Body · JSON)

ParameterTypeRequiredDescription
global_idstringYesTask ID returned when creating the task

Response Format (Success Example)

{
  "code": 100000,
  "data": {
    "status": "waiting/success/failed",
    "output": ""
  },
  "message": "Request Success"
}

Response Field Description

FieldTypeDescription
codenumberResponse code indicating request result
dataobjectResponse payload
messagestringHuman-readable result message
data.statusstringTask status: waiting (queued/processing), success, failed
data.outputstringResult file URL when successful; may be empty if pending/failed

Response Code (code) Description

codeMeaningMessage Example
100000SuccessRequest Success
100100Insufficient credit balanceInsufficient credit balance
101002Invalid API keyInvalid API key
101003API rate limit triggeredAPI key rate limit exceeded
101004Concurrency limit triggeredAPI key concurrent request limit exceeded
101008Task not foundTask not found

Example

curl --location --request POST 'https://audiocleaner.ai/audio/api/v1/api-keys/tts/task/get' \
  --header 'Content-Type: application/json' \
  --header 'api-key: YOUR_API_KEY' \
  --data-raw '{
    "global_id": "59063d399a3749f290a2d9fb4e75ddc3"
  }'

3. Download TTS Voice Library (Voice List)

Interface Description

  • Returns only voice information visible/available to the current account.
  • Returns JSON with all fields needed by business usage (such as image/audio URLs and base attributes).
  • Includes key field descriptions such as gender and age.
  • After login, click the Developer menu, open Playground, and choose AI Voice Generator.

Response Format (Example)

{
  "code": 100000,
  "data": {
    "total": 159,
    "records": [
      {
        "id": 2072,
        "gender": 2,
        "language": "en",
        "age": 2,
        "emotion": [
          "chat",
          "customerservice",
          "narration-professional",
          "newscast-casual",
          "newscast-formal",
          "cheerful",
          "empathetic",
          "angry",
          "sad",
          "excited",
          "friendly",
          "terrified",
          "shouting",
          "unfriendly",
          "whispering",
          "hopeful"
        ],
        "name": "madison",
        "display_name": "Madison"
      }
    ]
  },
  "message": "Request Success"
}

Field Description (Key)

FieldTypeDescription
data.totalnumberTotal voices visible to the current account
data.recordsarrayVoice list
records.idnumberUnique voice ID (used to create TTS tasks)
records.gendernumberGender enum value (based on platform enum definitions)
records.languagestringLanguage key, e.g. en
records.agenumberAge enum value (based on platform enum definitions)
records.emotionstring[]Supported emotion list for the current voice
records.namestringInternal system name
records.display_namestringDisplay 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.