Get Text-to-Speech Task Status
Retrieves the current status of a Text-to-Speech task using the specified task_id
.
This endpoint allows you to check on the progress of your Text-to-Speech tasks. When you submit a text-to-speech request, our system begins processing your audio in the background. This endpoint lets you monitor that process from start to finish, keeping you informed about when your audio will be ready.
How to Use This Endpoint
To check the status of your Text-to-Speech task, simply send a GET
request to this endpoint with the task_id
you received when you submitted your original request. The system will respond with detailed information about where your task stands in the processing pipeline.
Understanding the Response
When you call this endpoint, you’ll receive a status response that includes several key pieces of information:
- Status Code: Indicates whether the task is still processing, has completed successfully, or encountered an error.
- Result Information: For completed tasks, includes the
run_id
needed to download your finished audio file.
Status Types Explained
Your text-to-speech task will pass through different states as our system processes it. Understanding these status codes will help you properly handle each situation in your application:
Status | Description | Next Step |
---|---|---|
SUCCESS | Your audio generation has completed successfully | Use the run_id to download your finished audio |
PENDING | Your task is currently being processed by our system. | Continue polling until completion. |
TIMEOUT | The processing time exceeded the allowed limit. | Consider breaking text into smaller segments. |
ERROR | Something went wrong during processing. | Check error details and try submitting again. |
PAYMENT_REQUIRED | Your account requires additional credits for this operation. | Add credits to your account or upgrade your plan by heading to the billing page and retry the request. |
Example Code
This polling mechanism gives you flexibility to build applications that can provide real-time feedback to users about their text-to-speech conversions. You can adjust the polling interval based on your specific needs, checking more frequently for time-sensitive applications or less frequently for background tasks.
Next Steps
Once your task shows a status of SUCCESS
, you’ll receive a run_id
in the response. This run_id
is your key to accessing the generated audio. Take this identifier and use it with the /tts-result/run_id endpoint to download your finished audio file and put it to work in your application.
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
The response is of type object
.