استكشف كل المسارات ونفّذ طلبات حقيقية من المتصفح
Scalar يحمّل مخطط OpenAPI الحي (نسخة على /api/openapi). التوثيق كاللوحة: Bearer لرمز Firebase أو X-API-Key من الحساب → مفاتيح API. مسارات HTML /admin للتشغيل — احمها عند الحافة أو عبر VPN.
Text-to-speech API with real voice cloning
Send text, attach a reference speaker or a saved custom voice, and receive studio-grade audio through the same job system our customers use in production.
Text flows into synthesized speech
Why teams start with cloning TTS
Generic robotic voices erode trust. VoiceChangerAPI lets you keep a consistent speaker—your host, your brand mascot, or a user-uploaded reference—without shipping raw recordings.
The endpoint is intentionally boring engineering: multipart form data, explicit async_mode, and either audio_ref or custom_voice_id so your integration stays easy to audit.
Credits are reserved when the job is accepted, and results always land behind presigned URLs so you can hand them straight to a CDN or a mobile client.
How the request actually works
Follow the same sequence the dashboard uses. Numbers map to what you will see in browser devtools when you try the Text-to-speech panel.
- 1
Authenticate like production
Send Authorization: Bearer <Firebase ID token> for user sessions, or X-API-Key for server-to-server calls. Both resolve to the same user record and credit balance.
- 2
Build the multipart body
Required: text. Optional: language (default auto). Set async_mode to the string true or false. Provide exactly one of audio_ref (WAV upload) or custom_voice_id (UUID from /v1/custom-voices). Never both.
- 3
Interpret the immediate response
Async mode returns mode, job_id, and queued. Sync mode either returns a completed payload with download_url or timeout_waiting with the same job_id so you can poll.
- 4
Poll and download
Call GET /v1/jobs/{job_id} for status, then GET /v1/jobs/{job_id}/result once completed to retrieve a fresh presigned URL and MIME type.
Minimal curl (API key)
Replace $API with your VoiceChangerAPI base URL. This mirrors what the dashboard sends when you are signed in with Firebase.
curl -X POST "$API/v1/voice-cloning/tts" \ -H "X-API-Key: $KEY" \ -F text="Thanks for building with Voicechanger.co" \ -F language=auto \ -F async_mode=true \ -F custom_voice_id="$VOICE_UUID" # Then poll: # curl -H "X-API-Key: $KEY" "$API/v1/jobs/$JOB_ID"
Need the raw schema? Use Raw OpenAPI JSON or Scalar from the purple banner above.