curl --request POST \
--url https://api.orq.ai/v2/gateway/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "<string>",
"model": "<string>",
"voice": "<string>",
"response_format": "mp3",
"speed": 1,
"orq": {
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
},
"fallbacks": [
{
"model": "openai/gpt-4o-mini"
}
],
"name": "<string>",
"contact": {
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "[email protected]",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer"
}
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering"
]
},
"thread": {
"id": "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"tags": [
"customer-support",
"priority-high"
]
},
"load_balancer": [
{
"model": "openai/gpt-4o",
"weight": 0.7
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3
}
],
"timeout": {
"call_timeout": 30000
}
}
}
'Generates audio from the input text.
curl --request POST \
--url https://api.orq.ai/v2/gateway/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "<string>",
"model": "<string>",
"voice": "<string>",
"response_format": "mp3",
"speed": 1,
"orq": {
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
},
"fallbacks": [
{
"model": "openai/gpt-4o-mini"
}
],
"name": "<string>",
"contact": {
"id": "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"display_name": "Jane Doe",
"email": "[email protected]",
"metadata": [
{
"department": "Engineering",
"role": "Senior Developer"
}
],
"logo_url": "https://example.com/avatars/jane-doe.jpg",
"tags": [
"hr",
"engineering"
]
},
"thread": {
"id": "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"tags": [
"customer-support",
"priority-high"
]
},
"load_balancer": [
{
"model": "openai/gpt-4o",
"weight": 0.7
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3
}
],
"timeout": {
"call_timeout": 30000
}
}
}
'Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
input
The text to generate audio for. The maximum length is 4096 characters
ID of the model to use
The voice to use.
Available voices for OpenAI
alloy, echo, fable, onyx, nova, and shimmer
Available voices for ElevenLabs
aria, roger, sarah, laura, charlie, george, callum, river, liam, charlotte, alice, matilda, will, jessica, eric, chris, brian, daniel, lily, bill
The format to audio in. Supported formats are mp3, opus, aac, flac, wav, and pcm. If a format is provided but not supported by the provider, the response will be in the default format. When the provided format is not supported by the provider, the response will be in the default format.
mp3, opus, aac, flac, wav, pcm The speed of the generated audio.
Show child attributes
Retry configuration for the request
The name to display on the trace. If not specified, the default system name will be used.
Information about the contact making the request. If the contact does not exist, it will be created automatically.
Show child attributes
Unique identifier for the contact
"contact_01ARZ3NDEKTSV4RRFFQ69G5FAV"
Display name of the contact
"Jane Doe"
Email address of the contact
URL to the contact's avatar or logo
"https://example.com/avatars/jane-doe.jpg"
A list of tags associated with the contact
["hr", "engineering"]
Thread information to group related requests
Array of models with weights for load balancing requests
[
{ "model": "openai/gpt-4o", "weight": 0.7 },
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3
}
]
The audio file content.
Was this page helpful?