Speech
POST
/v1/audio/speech
const url = 'https://example.com/v1/audio/speech';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"input":"example","model":"example","voice":"example","response_format":"wav","speed":1,"stream":true,"tier":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/audio/speech \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "input": "example", "model": "example", "voice": "example", "response_format": "wav", "speed": 1, "stream": true, "tier": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
SpeechRequest
Standard speech shape; unknown fields pass through.
voice is a Nairon voice id or name.
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
Examplegenerated
exampleValidation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}