Skip to Content

Query Asynchronous Task Status

The task status endpoint allows you to check the progress and status of your asynchronous voice cloning tasks. Use this endpoint to monitor task completion and handle any processing errors.

Endpoint

GET https://aivoiceclonefree.com/api/async-clone/task-status/{task_id}

Authentication

This endpoint requires authentication using your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Path Parameters

ParameterTypeRequiredDescription
task_idStringYesThe unique identifier returned when creating the task

Request Example

cURL

curl -X GET "https://aivoiceclonefree.com/api/async-clone/task-status/abc123def456ghi789" \ -H "Authorization: Bearer YOUR_API_KEY"

Python

import requests task_id = "abc123def456ghi789" url = f"https://aivoiceclonefree.com/api/async-clone/task-status/{task_id}" headers = { "Authorization": "Bearer YOUR_API_KEY" } response = requests.get(url, headers=headers) status_data = response.json() print(f"Task status: {status_data['status']}")

JavaScript

const taskId = "abc123def456ghi789"; fetch(`https://aivoiceclonefree.com/api/async-clone/task-status/${taskId}`, { method: 'GET', headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }) .then(response => response.json()) .then(data => { console.log('Task status:', data.status); if (data.status === 'completed') { console.log('Result URL:', data.result_url); } });

Response

Task Status Values

StatusDescription
pendingTask is queued and waiting to be processed
processingTask is currently being processed
completedTask has completed successfully
failedTask has failed due to an error

Completed Status Response (200 OK)

{ "task_id": "abc123def456ghi789", "status": "completed", "created_at": "2024-01-15T10:25:00Z", "started_at": "2024-01-15T10:28:00Z", "completed_at": "2024-01-15T10:32:00Z", "result_url": "https://aivoiceclonefree.com/api/async-clone/task-result/abc123def456ghi789", "audio_duration": 125.3, "file_size": 2048576 }

Error Responses

401 Unauthorized

{ "detail": "Invalid or missing API key" }

404 Not Found

{ "detail": "Task not found" }

Next Steps

When a task is completed, use the Task Result endpoint to download the generated audio.

Last updated on