π 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
Retrieves the current status of a Dubbing task using the specified task_id.
curl --request GET \
--url https://client.camb.ai/apis/dub/{task_id} \
--header 'x-api-key: <api-key>'{
"status": "SUCCESS",
"run_id": 123
}Monitor the progress of your dubbing tasks with our status tracking endpoint. This essential companion to our dubbing service lets you check on your media transformation in real-time, providing detailed information about which stage of the process your content has reached. By polling this endpoint, you can keep track of your dubbing tasks progress and detect any issues that might arise during processing. This endpoint works in conjunction with the mainDocumentation Index
Fetch the complete documentation index at: https://docs.camb.ai/llms.txt
Use this file to discover all available pages before exploring further.
/dub endpoint, which initiates the dubbing process and provides the task_id needed for status checks.
import requests
import json
import time
# Your API authentication
headers = {
"x-api-key": "your-api-key", # Replace with your actual API key
"Content-Type": "application/json"
}
def check_dubbing_status(task_id):
"""
Polls the status endpoint to track a dubbing task's progress.
Continues checking until the task reaches a terminal state.
"""
if not task_id:
print("Error: No task ID provided")
return None
terminal_states = ["SUCCESS", "ERROR"]
current_status = None
while current_status not in terminal_states:
try:
# Make the status request
response = requests.get(
f"https://client.camb.ai/apis/dub/{task_id}",
headers=headers
)
# Verify the request was successful
response.raise_for_status()
# Extract the status information
status_data = response.json()
current_status = status_data.get("status")
# Display current progress information
print(f"Status: {current_status}")
if current_status == "PENDING":
time.sleep(15)
continue
# Handle completed state
if current_status == "SUCCESS":
print("Dubbing task completed successfully!")
return status_data
# Handle failed state
if current_status == "ERROR":
print(f"Dubbing task failed: {status_data.get('message')}")
return status_data
# Wait before next check to avoid excessive requests
time.sleep(30) # Poll every 30 seconds
except requests.exceptions.RequestException as e:
print(f"Error checking dubbing status: {e}")
if hasattr(e, 'response') and e.response is not None:
print(f"Response content: {e.response.text}")
return None
return None
# Example usage with a task_id from a previous dubbing request
task_id = "your_task_id" # Replace with your actual task ID
final_status = check_dubbing_status(task_id)
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 dubbing task that is running. It is returned when a create request is made for dubbing.
curl --request GET \
--url https://client.camb.ai/apis/dub/{task_id} \
--header 'x-api-key: <api-key>'{
"status": "SUCCESS",
"run_id": 123
}