Understanding This Endpoint
To monitor your Translated Text-to-Speech task progression, send aGET
request to this endpoint with the task_id
you received during your initial submission. The system will return comprehensive information about the current stage of processing for both the translation and audio generation components.
Response Structure
When querying this endpoint, youβll receive a detailed status response containing several vital pieces of information:- Current Status: Indicates the overall state of your combined translation and audio generation task.
- Completion Details: For successfully completed tasks, includes
run_id
necessary to access your translated text and generated audio file.
Understanding Status Codes
Your translated text-to-speech request will move through various states during processing. Each status code represents a distinct situation that your application should be prepared to handle:Status | Meaning | Recommended Action |
---|---|---|
SUCCESS | Both translation and audio generation have completed successfully | Retrieve your translated text and audio using the provided IDs |
PENDING | Your request is actively being processed | Continue monitoring at reasonable intervals |
TIMEOUT | Processing exceeded the maximum allowed duration | Consider breaking your content into smaller segments |
ERROR | A system-level issue occurred during processing | Check error details for specific information about what went wrong |
PAYMENT_REQUIRED | Your account has insufficient credits for this operation | Visit your accountβs billing page to add more credits |
Implementation Guidelines
For optimal integration of this endpoint into your applications, consider the following practices:- Implement Progressive Polling: Start with longer intervals between status checks, then decrease the interval as the task progresses through different states.
- Set Reasonable Timeouts: Most translation and synthesis tasks complete within 2-5 minutes, depending on content length and complexity.
Example Implementation in JavaScript
Performance Considerations
When integrating this status-monitoring endpoint into your applications, keep these performance factors in mind:- Request Frequency: Avoid polling more frequently than every 3-5 seconds to prevent unnecessary load on both client and server.
- Timeout Handling: For longer texts, processing may take several minutes. Set appropriate client-side timeout expectations.
- Error Resilience: Network interruptions shouldnβt affect your task processing; the task continues running server-side regardless of status checks.
Next Steps
Once your task reaches theSUCCESS
status, youβll receive a run_id
for accessing both:
- The generated audio file through the
/tts-result/{run_id}
endpoint. - The translated text via the
/translation-result/{run_id}
endpoint.
Authorizations
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.
Path Parameters
This parameter represents a unique identifier for a task. It is used in various API endpoints to query the status or result of a specific task. The task_id
is typically returned when a task is created.
Response
Successful Response
The response is of type object
.