Get TTS Task Status
Overview
Retrieve the status and results of a Text-to-Speech or SRT to Speech task using the task_id returned from the initial POST request.
Endpoint
- URL:
GET https://tts.revidapi.com/api/get/{task_id}
- Method:
GET
Request
- No authentication required for status checking (or use
x-api-key if required by your API configuration)
Path Parameters
| Parameter |
Type |
Description |
task_id |
string |
The task ID returned from the initial POST request |
Example Request
curl -X GET "https://tts.revidapi.com/api/get/550e8400-e29b-41d4-a716-446655440000" \
-H "x-api-key: YOUR_API_KEY"
Response
Processing Status (202)
{
"code": 202,
"task_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"message": "Task is being processed"
}
Success Response (200)
{
"code": 200,
"task_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"response": {
"audio_url": "https://storage.example.com/audio/output.mp3",
"duration": 3.5
},
"message": "success"
}
Error Response (404)
{
"code": 404,
"task_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "not_found",
"message": "Task not found"
}
Error Response (500)
{
"code": 500,
"task_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "failed",
"message": "Task processing failed",
"error": "Error details"
}
Status Values
| Status |
Description |
processing |
Task is currently being processed |
completed |
Task completed successfully |
failed |
Task failed during processing |
not_found |
Task ID not found |
Usage Notes
- Polling Interval: Recommended polling interval is 5-10 seconds
- Timeout: Tasks typically complete within 30-60 seconds, but may vary based on text length
- Task Retention: Task results are typically retained for a limited time (check API documentation for retention period)
- Webhook Alternative: Consider using webhooks instead of polling for better efficiency
Best Practices
- Polling Strategy: Start with 5-second intervals, then increase to 10-second intervals after initial wait period
- Timeout Handling: Implement a maximum timeout (e.g., 5 minutes) before considering the task failed
- Error Handling: Always check the status code and handle error cases appropriately
- Result Storage: Download and store result URLs promptly as they may expire