For the complete documentation index, see llms.txt. This page is also available as Markdown.

Audio

Generate audio or text from audio or text input.

Create speech

post

Generate speech audio from text.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
modelstringRequiredExample: tts-1
inputstring · max: 4096Required

The text to generate audio for.

voicestring · enumRequired

The voice to use when generating the audio.

Possible values:
response_formatstring · enumOptional

The format to output audio in.

Default: mp3Possible values:
speednumber · min: 0.25 · max: 4Optional

The speed of the generated audio.

Default: 1
Responses
200

Successful response with an audio speech.

application/octet-stream
string · binaryOptional
post/v1/audio/speech
POST /v1/audio/speech HTTP/1.1
Host: api.nexos.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 97

{
  "model": "tts-1",
  "input": "There are three letters 'r' in the word 'strawberry'.",
  "voice": "alloy"
}
binary

Create transcription

post

Transcribe audio to text.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
filestring · binaryRequired

The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.

modelstringRequiredExample: Whisper
languagestringOptional

The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.

promptstringOptional

An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.

response_formatstring · enumOptional

The format of the transcript output. Note: the non-JSON formats (text, srt, vtt) are currently returned wrapped in a JSON object ({"html-message": "..."}) with Content-Type: application/json, not as a plain-text body.

Default: jsonPossible values:
temperaturenumberOptional

The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.

Default: 0
Responses
200

OK

application/json
or
post/v1/audio/transcriptions
POST /v1/audio/transcriptions HTTP/1.1
Host: api.nexos.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 147

{
  "file": "binary",
  "model": "Whisper",
  "language": "text",
  "prompt": "text",
  "response_format": "json",
  "temperature": 0,
  "timestamp_granularities[]": [
    "word"
  ]
}
{
  "text": "text",
  "usage": {
    "type": "duration",
    "seconds": 1
  }
}

Create translation

post

Translate audio to English text.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
filestring · binaryRequired

The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.

modelstringRequiredExample: Whisper
promptstringOptional

An optional text to guide the model's style or continue a previous audio segment. The prompt should be in English.

response_formatstring · enumOptional

The format of the translated transcript output. Note: the non-JSON formats (text, srt, vtt) are currently returned wrapped in a JSON object ({"html-message": "..."}) with Content-Type: application/json, not as a plain-text body.

Default: jsonPossible values:
temperaturenumberOptional

The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.

Default: 0
Responses
200

OK

application/json
or
post/v1/audio/translations
POST /v1/audio/translations HTTP/1.1
Host: api.nexos.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 92

{
  "file": "binary",
  "model": "Whisper",
  "prompt": "text",
  "response_format": "json",
  "temperature": 0
}
{
  "text": "text"
}

Last updated