🚀 Introducing MARS8 Series — Four Powerful Variants | Available on All Major Clouds | Learn about the model here
🚀 Introducing MARS8 Series — Four Powerful Variants | Available on All Major Clouds | Learn about the model here
Monitor the progress of your AI-generated voice creation through real-time status updates.
curl --request GET \
--url https://client.camb.ai/apis/text-to-voice/{task_id} \
--header 'x-api-key: <api-key>'{
"status": "SUCCESS",
"run_id": 123
}Track every stage of your voice generation process with millisecond precision. This endpoint provides real-time visibility into voice synthesis tasks, enabling seamless integration with time-sensitive applications like live narration systems and interactive voice interfaces.Documentation Index
Fetch the complete documentation index at: https://docs.camb.ai/llms.txt
Use this file to discover all available pages before exploring further.
/text-to-voice endpoint, which initiates the voice generation process and provides the essential task_id for status monitoring.def monitor_voice_creation(task_id, poll_interval=5):
"""
Advanced status tracking with automatic recovery suggestions
"""
status_guidance = {
"SUCCESS": {"icon": "✅", "action": "download_voice"},
"PENDING": {"icon": "⏳", "action": "wait"},
"TIMEOUT": {"icon": "⏰", "action": "retry_or_contact"},
"ERROR": {"icon": "❌", "action": "review_inputs"},
"PAYMENT_REQUIRED": {"icon": "💳", "action": "add_credits"}
}
while True:
response = requests.get(f"/text-to-voice/{task_id}", headers=headers)
status_data = response.json()
current_status = status_data.get('status')
# Get status metadata
guidance = status_guidance.get(current_status, {})
print(f"{guidance.get('icon', 'ℹ️')} Status: {current_status}")
# Handle terminal states
if current_status in ["SUCCESS", "TIMEOUT", "ERROR", "PAYMENT_REQUIRED"]:
print(f"Error details: {status_data.get('message', 'Contact support')}")
print(f"Recommended action: {guidance.get('action', 'contact_support')}")
if current_status == "SUCCESS":
print(f"\n🎉 Voice generation completed!")
print(f"Production ID: {status_data.get('run_id')}")
return status_data
time.sleep(poll_interval)
SUCCESS, you’ll receive a run_id in the response. This run_id is your key to accessing the generated sample audio files for the voices. Take this identifier and use it with the /text-to-voice-result/{run_id} endpoint to download your the sample voices, select the one that matches your desired characteristics and put it to work in your application.The x-api-key is a custom header required for authenticating requests to our API. Include this header in your request with the appropriate API key value to securely access our endpoints. You can find your API key(s) in the 'API' section of our studio website.
A unique identifier for the task. This is used to query the status of the text to voice task that is running. It is returned when a create request is made for text to voice.
curl --request GET \
--url https://client.camb.ai/apis/text-to-voice/{task_id} \
--header 'x-api-key: <api-key>'{
"status": "SUCCESS",
"run_id": 123
}