Uploads
Voice references, emotion references, reference images, reference videos and other media must be uploaded before audio, image and video generation requests can reference them. Text models do not use uploads.
An upload takes three steps: request an upload URL, upload the file and confirm completion.
1. Request an upload URL
Call POST /v1/uploads with filename, content_type and the actual file size size_bytes, and set purpose to the intended use:
purpose | Use | Format and size |
|---|---|---|
voice_reference | Voice reference used as the voice for speech synthesis | WAV, up to 20 MiB |
emotion_reference | Emotion reference for indextts-2 emotion control | WAV, up to 20 MiB |
audio_material | Sound effect or music in an audio composition | WAV or MP3, up to 100 MiB |
image_reference | Reference image for image-to-image | PNG, JPEG or WebP, up to 20 MiB |
video_image | Reference image or first/last frame for video generation | PNG, JPEG or WebP, up to 20 MiB |
video_clip | Reference video for video generation | MP4, up to 50 MiB |
video_audio | Reference audio for video generation | WAV or MP3, up to 15 MiB |
Always send the purpose that matches the actual use; generation endpoints check it when they reference the asset. The filename extension must match content_type.
Make sure you have permission before uploading someone else's voice or likeness. You can send rights_confirmed: true to record your confirmation.
2. Upload the file
Send the raw file content with PUT to upload_url from the response, including every header in the response headers unchanged. The upload URL is valid for 300 seconds. Do not send your API Key to the upload URL.
curl -X PUT "$UPLOAD_URL" \
-H 'Content-Type: audio/wav' \
--data-binary '@voice.wav'3. Confirm the upload
After the upload succeeds, call POST /v1/uploads/{asset_id}/complete. The service checks the file size and format, and only confirmed assets can be used for generation. Confirm within one hour of requesting the URL; unconfirmed uploads are removed after that.
Once confirmed, reference the asset by asset_id in generation requests. For example, use a voice reference as voice_asset_id in speech synthesis, an emotion reference as emo_asset_id, and a reference image in reference_asset_ids for image generation.
Upload allowance
- All API Keys and the console of one account share the upload allowance: up to 30 upload requests per minute and up to 500 MiB in any rolling 24-hour period. There is no daily limit on the number of uploads.
size_bytescounts toward the 24-hour allowance as soon as the upload URL is issued. Failed uploads and deleted assets do not give it back; the allowance recovers as the window moves on.- Saving a designed voice does not use the upload allowance.
When the allowance is exceeded, the API returns 429 with the error code UPLOAD_RATE_LIMITED (too many requests) or UPLOAD_QUOTA_EXCEEDED (too many bytes). The quota object in the response contains the limit type kind, the limit limit, the amount used used and the amount requested requested. When a recovery time can be estimated, quota.retry_at gives it as an RFC 3339 timestamp and the Retry-After header gives the seconds to wait. Retry after that time rather than retrying in a loop.