zoice/speech
Generate realistic speech from text using selected voice profile.
Zoice Speech API Docs
Zoice Speech API convert text to speech with the selected voice profile.
API Request
The API endpoint handles heavy media rendering tasks asynchronously using a fast queue-based system, and the request immediately returns a request_id. Use the request_id to poll the status of the generation and return the result after the task is completed.
Sending Request
curl -X POST "https://api.zoice.com/v1/run/zoice/speech" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ZOICE_API_KEY" \
-d '{
"voice_id": "bedf6a57-c6a5-...",
"script_prompt": "Hi, this is Sophia"
}'Response Format
{
"request_id": 'd1f47b9c-6387-49d0-a403-...',
"status": 'processing',
}Polling and Output
After submitting an asynchronous API request, you can use the request_id obtained from the response to further poll for the status of the generation and ultimately retrieve the result after the completion. Use the /v1/fetch/request_id endpoint to perform this operation.
Polling Request
curl -X GET "https://api.zoice.com/v1/fetch/{request_id}" \
-H "Authorization: Bearer $ZOICE_API_KEY"Polling Response
{
"status": 'success',
"request_id": 'd1f47b9c-6387-49d0-a403-...',
"type": "audio",
"output": {
"credits": 300,
"result": "https://assets.zoice.com/...mp3"
}
}Schema
Input
Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
voice_id | string (uuid) | Yes | - | - | Voice ID of the desired voice profile. |
script_prompt | string | Yes | - | - | Text to be converted to audio. |
Output
Field | Type | Description |
|---|---|---|
status | string | The status of the API request. Allowed values: |
request_id | string (uuid) | A unique identifier generated for tracking this specific request. |
type | string | The type of media content being processed. Allowed values: |
output | object | An object containing the generated media url and metadata. |
output.credits | number | Credits used for generation. |
output.result | string (url) | The secure HTTP URL where the generated asset can be downloaded. |