Welcome to the official NexusAI API documentation. Our API provides fast, scalable, and secure access to our state-of-the-art LLM, audio transcription, and diarization models.
The NexusAI API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
The NexusAI API uses API keys to authenticate requests. You can view and manage your API keys in the Dashboard.
Authentication to the API is performed via HTTP Bearer Auth. Provide your API key as the bearer token value in the Authorization header.
Authorization: Bearer sk-live-xxxxxxxxxxxxxxxxxxxxxxxx
The API is offered in two versions:
https://api.nexusai.com/v1
https://api.nexusai.com/v2
The v2 API mirrors the OpenAI API: endpoints, request parameters, response bodies, streaming events and error envelopes all match what official OpenAI SDKs expect. To migrate an existing OpenAI workflow, change only the base URL and the API key — everything else keeps working.
from openai import OpenAI
client = OpenAI(
base_url="https://api.nexusai.com/v2",
api_key="sk-live-xxxxxxxxxxxxxxxx", # your NexusAI API key
)
completion = client.chat.completions.create(
model="standard",
messages=[{"role": "user", "content": "Hello!"}],
)
| Endpoint | Description |
|---|---|
POST /v2/chat/completions | OpenAI Chat Completions. Supports stream: true (server-sent events, including the final usage chunk). |
POST /v2/responses | OpenAI Responses API. Returns the standard OpenAI response object (or event stream with stream: true). |
POST /v2/audio/speech | OpenAI Text to Speech. Returns the raw audio file; set stream_format to "audio" or "sse" to stream chunks while the audio is generated. |
POST /v2/audio/transcriptions | OpenAI Transcriptions. Upload an audio file (multipart file field, up to 25 MB) and receive the final text synchronously. response_format: json (default), text or verbose_json. |
GET /v2/models | Lists the available model ids in the OpenAI list format. /v2/models/{id} retrieves a single model. |
The model parameter accepts our tier names — mini, standard and pro (see pricing). For drop-in compatibility, any other model id sent by an unmodified integration is accepted and billed at the closest tier, so requests never fail on the model name alone. The audio endpoints accept (and ignore) OpenAI audio model names such as tts-1 and whisper-1.
curl https://api.nexusai.com/v2/audio/speech \
-H "Authorization: Bearer sk-live-xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"input": "Streaming speech, chunk by chunk!",
"voice": "nova",
"response_format": "mp3",
"stream_format": "sse"
}'
Each event carries a base64 audio chunk ({"type": "speech.audio.delta", "audio": "..."}) followed by a final speech.audio.done event with the token usage. With "stream_format": "audio" the raw audio bytes are streamed instead. Omit stream_format to receive the finished audio file in one response.
curl https://api.nexusai.com/v2/audio/transcriptions \
-H "Authorization: Bearer sk-live-xxxxxxxxxxxxxxxx" \
-F file=@audio.mp3 \
-F model=whisper-1
{ "text": "This is the transcribed audio..." }
Creates a model response for the given chat conversation.
POST /v1/responses
curl https://api.nexusai.com/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-live-xxxxxxxxxxxxxxxx" \
-d '{
"model": "standard",
"input": [
{
"role": "system",
"content": "You are a helpful coding assistant."
},
{
"role": "user",
"content": "Write a python function to fetch data."
}
]
}'
| Parameter | Type | Required | Description |
|---|---|---|---|
model |
string | Yes |
ID of the model to use. Available models:
|
input |
array | Yes | A list of messages comprising the conversation so far. Each message object should have a role (e.g. "user", "system", "assistant") and content. |
{
"status": "completed",
"max_output_tokens": 2048,
"model": "standard",
"output": [
{
"type": "message",
"role": "assistant",
"status": "completed",
"content": [
{
"type": "text",
"text": "Here is the python function you requested: ..."
}
]
}
],
"usage": {
"input_tokens": 45,
"output_tokens": 120,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 165
}
}
| Field | Type | Description |
|---|---|---|
| status | string | The overall status of the response generation (e.g. completed). |
| max_output_tokens | integer | The maximum number of tokens allowed to be generated in this request. |
| model | string | The requested tier name (mini, standard, pro). |
| output | array | Contains the response message(s). Each message includes its role, status, and content (an array containing the actual text response). |
| usage | object | Contains token usage statistics, including input_tokens, output_tokens, total_tokens, and detailed breakdown like reasoning_tokens. |
Generate natural-sounding speech from text. The v1 flow is a two-step asynchronous process, like transcriptions: submit the generation job, then poll it until the audio is ready. For a synchronous, OpenAI-compatible call (including streaming), use /v2/audio/speech instead — both accept the same parameters.
POST /v1/audio/speech
Submit text and a voice; the endpoint charges the estimated cost, starts the generation and returns a job id to poll. The generated audio is also stored in your account and listed under Text to Speech in your dashboard.
curl https://api.nexusai.com/v1/audio/speech \
-H "Authorization: Bearer sk-live-xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"input": "Today is a wonderful day to build something people love!",
"voice": "nova",
"instructions": "Speak in a cheerful and positive tone.",
"response_format": "mp3"
}'
| Parameter | Type | Required | Description |
|---|---|---|---|
input |
string | Yes | The text to generate audio for. Maximum 4,096 characters. |
voice |
string | Yes | The voice to use. One of: alloy, ash, ballad, coral, echo, fable, onyx, nova, sage, shimmer. |
instructions |
string | No | Free-text guidance to control how the voice should sound (tone, pace, emotion, accent). |
response_format |
string | No | Audio format of the response. One of mp3 (default), opus, aac, flac, wav, pcm. |
speed |
number | No | Speed of the generated audio, from 0.25 to 4.0. Defaults to 1.0. |
{
"id": "tts-1a2b3c4d5e6f7a8b9c0d1e2f",
"status": "queued",
"voice": "nova",
"response_format": "mp3",
"speed": 1.0,
"created_at": 1754500000
}
The estimated cost is charged when the job is accepted and refunded automatically if the generation fails.
GET /v1/audio/speech/{id}
Poll this endpoint every second or two. While the job is still running it returns a JSON status object; as soon as the audio is ready the same call returns the binary audio file instead — check the response Content-Type to tell the two apart.
curl https://api.nexusai.com/v1/audio/speech/tts-1a2b3c4d5e6f7a8b9c0d1e2f \
-H "Authorization: Bearer sk-live-xxxxxxxxxxxxxxxx" \
--output speech.mp3
{
"id": "tts-1a2b3c4d5e6f7a8b9c0d1e2f",
"status": "processing",
"voice": "nova",
"response_format": "mp3",
"speed": 1.0
}
Possible status values are queued, processing and error (failed jobs include an error field and are fully refunded). On success the response body is the audio file, served with the Content-Type matching the requested response_format (e.g. audio/mpeg for MP3), plus the X-Tts-Job-Id, X-Tts-Cost and X-Tts-Format headers. The audio stays stored in your account, so the call can be repeated at any time.
Transcribing audio is a two-step asynchronous process: Request a transcription (via URL or direct file upload), and poll until the job completes.
POST /v1/transcript
Submit an audio file or an audio URL to begin the asynchronous transcription job.
curl -X POST https://api.nexusai.com/v1/transcript \
-H "Authorization: Bearer sk-live-xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"audio_url": "https://...",
"speaker_labels": true
}'
| Parameter | Type | Description |
|---|---|---|
| audio_url Required |
string | The publicly accessible URL of the audio file to transcribe. Must be an MP3 or WAV file. |
| speaker_labels Optional |
boolean | Enable Speaker Diarization to identify "who spoke when". Default is false. Note: Enabling this feature incurs additional costs. Please view the Pricing Table for details. |
| language_code Optional |
string | The language of your audio file. See Supported Languages below. If not specified, the system will attempt to auto-detect the language. |
enen_auen_uken_usesfrdeitptnlhijazhfikoplrutrukviafsqamarhyasazbaeubebnbsbrbgmycahrcsdaetfoglkaelguhthahawhehuisidjwknkkkmlolalvlnltlbmkmgmsmlmtmimrmnnenonnocpapsfarosasrsnsdsiskslsosuswsvtltgtatttethbotkuruzcyyiyo{
"id": "abc123def"
}
| Field | Type | Description |
|---|---|---|
| id | string | The unique identifier for the transcription job. Use this ID to poll for the result. |
GET /v1/transcript/{id}
Retrieve the status of your transcription job. You should poll this endpoint every few seconds until the status becomes completed.
curl -X GET https://api.nexusai.com/v1/transcript/abc123def \
-H "Authorization: Bearer sk-live-xxxxxxxxxxxxxxxx"
{
"id": "abc123def",
"language_code": "en_us",
"status": "completed",
"audio_url": "https://...",
"text": "This is a mocked transcription from NexusAI. Hello, how are you doing today?",
"words": [
{ "text": "This", "start": 100, "end": 500, "confidence": 0.98 }
],
"utterances": [
{
"confidence": 0.95,
"start": 100,
"end": 3500,
"speaker": "A",
"text": "This is a mocked transcription from NexusAI. Hello, how are you doing today?"
}
],
"confidence": 0.97,
"audio_duration": 345,
"punctuate": true,
"format_text": true,
"speaker_labels": true,
"language_detection": false
}
| Field | Description |
|---|---|
| id | Unique identifier for the transcription job. |
| language_code | The language code of the transcription. |
| status | Current status (e.g. queued, processing, completed, error). |
| audio_url | The URL of the processed audio file. |
| text | The final transcribed text. |
| words | Array of objects containing individual words, their timestamps, and confidence scores. |
| utterances | Array of objects containing sentences, their timestamps, confidence, and speaker (if diarization is enabled). |
| confidence | Overall confidence score for the transcription. |
| audio_duration | Total duration of the audio in seconds. |
| punctuate | Whether automatic punctuation was applied. |
| format_text | Whether casing and text formatting was applied. |
| speaker_labels | Whether speaker diarization was enabled. |
| language_detection | Whether automatic language detection was used. |
| language_detection_results | Confidence scores for different language candidates. |
| language_confidence_threshold | The required confidence to automatically select a language. |
| language_confidence | The confidence score of the final detected language. |