Retrieve multiple generated audio files for completed Text to Sound tasks using multiple run IDs.
This endpoint retrieves audio outputs generated from multiple previously completed Text to Sound tasks in a single request. It allows you to efficiently fetch results for several text-to-sound generation runs simultaneously, making it ideal for batch processing workflows and applications that need to handle multiple audio files at once.
Unlike the single result endpoint that takes a run ID as a URL parameter, this bulk endpoint accepts multiple run IDs in the request body, providing a more efficient way to retrieve results when working with multiple text-to-sound tasks.
The endpoint processes an array of run IDs and returns corresponding results for each completed task. This batch approach offers several advantages over making individual requests for each result:
Efficiency Benefits:
Practical Applications:
The endpoint expects a JSON payload containing an array of run IDs that you want to retrieve results for:
Each run ID should correspond to a previously initiated and completed text-to-sound task. The endpoint will process all provided run IDs and return results for those that have completed successfully.
The response contains an array of results, where each item corresponds to one of the requested run IDs. Each result includes a presigned URL that points directly to the generated audio file:
When working with bulk requests, itβs important to understand that individual tasks within your batch may have different statuses. The endpoint will return results for all requested run IDs, but some may not be ready yet or may have encountered errors.
Best Practices for Error Handling:
This bulk endpoint fits naturally into larger audio processing workflows. Consider this typical pattern:
File Format and Quality: The generated audio files are delivered in WAV format, providing high audio quality suitable for professional applications. Keep in mind that WAV files are larger than compressed formats but offer the best fidelity for your generated sound effects.
URL Expiration: The presigned URLs returned in the response are temporary and will expire after a certain period. Make sure to download and store important audio files promptly to avoid losing access to your generated content.
Rate Limiting: While this endpoint allows bulk retrieval, be mindful of the fact that this endpoint allows providing a maximum of 5 run IDs per request. The bulk approach is more efficient than individual requests, but extremely large batches should be broken down into manageable chunks.
Memory and Storage: When downloading multiple audio files, consider the memory and storage requirements on your system. Implement appropriate streaming or chunked download strategies for large batches to avoid overwhelming your applicationβs resources.
By leveraging this bulk results endpoint, you can build more efficient applications that handle multiple text-to-sound generations seamlessly, enabling creative workflows that scale with your audio production needs.
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.
Successful Response
An object containing the results of one to five text-to-sound runs. Each key in the object is a unique identifier for a run, and the corresponding value is the output for text-to-sound.