Get Started with the CQTAI API in 5 Minutes: One OpenAI-Style Endpoint for Chat, Images, Video and Music
CQTAI
10/26/2026
If you have ever called an OpenAI-style API, you already know most of what you need. The public CQTAI API follows the same shape: a base URL, a Bearer key, JSON in, JSON out. Change the base URL and the key, and the OpenAI SDK you already use keeps working.
This post walks through the shortest path: get a key, pick a model, make your first call, and see where the other capabilities live.
1. Base URL and key
Every endpoint lives under one base URL:
https://api.novapi.ai/v1
Create an API key on the API keys page and keep it secret. Send it on every request:
Authorization: Bearer $API_KEY
The x-api-key header is accepted as well. Put the key in an environment variable instead of in your source code, and never ship it to a browser.
2. Pick a model
Model ids are exact strings, and you pass them in the model field. There are two places to find them:
- The model catalog shows every model with its category and a code sample.
GET /v1/modelsreturns the same list as JSON. It is public, so it does not need a key.
curl https://api.novapi.ai/v1/models
Each entry carries a category (chat, image, video, music or audio), so you can filter for the kind of model you want. Use the id exactly as listed.
3. Your first request
Replace MODEL_ID with a chat model id from the catalog.
curl https://api.novapi.ai/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MODEL_ID",
"messages": [
{ "role": "user", "content": "Explain quantum entanglement in three sentences." }
]
}'
The same call with the OpenAI Python SDK:
from openai import OpenAI
client = OpenAI(base_url="https://api.novapi.ai/v1", api_key="sk-...")
resp = client.chat.completions.create(
model="MODEL_ID",
messages=[{"role": "user", "content": "Explain quantum entanglement in three sentences."}],
)
print(resp.choices[0].message.content)
And with the TypeScript SDK:
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.novapi.ai/v1",
apiKey: process.env.API_KEY,
});
const resp = await client.chat.completions.create({
model: "MODEL_ID",
messages: [{ role: "user", content: "Explain quantum entanglement in three sentences." }],
});
console.log(resp.choices[0].message.content);
Chat supports streaming. Add "stream": true and, if you want token usage on the last chunk, "stream_options": { "include_usage": true }.
4. Beyond chat: the endpoint map
The same key works for every category. The difference is whether the call answers right away or hands you a task to poll.
| Capability | Endpoint | Mode |
|---|---|---|
| Chat | POST /v1/chat/completions | Synchronous, optional streaming |
| Images | POST /v1/images/generations | Synchronous by default, async optional |
| Video | POST /v1/videos, GET /v1/videos/ID | Asynchronous: create, then poll |
| Text to speech | POST /v1/audio/speech | Synchronous, returns audio bytes |
| Speech to text | POST /v1/audio/transcriptions | Waits up to about 110 seconds, else 202 and poll |
| Music | POST /v1/audio/generations | Asynchronous: create, then poll |
| ffmpeg jobs | POST /v1/ffmpeg/jobs | Asynchronous: create, then poll |
Here is an image request, which answers with the finished image URL:
curl https://api.novapi.ai/v1/images/generations \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana",
"prompt": "A cozy wooden cabin in a snowy forest at dusk, warm window light",
"n": 1,
"size": "1536x1024"
}'
If an image takes longer than about 110 seconds, the call answers 202 with a task object and a Location header. Do not resubmit it. Poll that URL instead, otherwise you pay twice.
5. Handle errors on purpose
Errors on /v1/* use the OpenAI format:
{
"error": {
"message": "...",
"type": "invalid_request_error",
"param": null,
"code": "invalid_api_key"
}
}
Branch on the HTTP status and error.code. The human-readable message may change over time. The ones you will meet first:
401 invalid_api_key: the key is missing, wrong, disabled or expired.402 insufficient_quota: your balance does not cover the call.403 model_not_allowed: the key has a model allowlist and this model is not on it.429 rate_limit_exceededortask_limit_reached: slow down, or wait for running tasks to finish.
For video, music and ffmpeg, a task that fails after it was accepted is not an HTTP error. The poll call returns 200 with status: failed and an error object, so check the status field.
Where to go next
- The full Quick start guide in the docs, with every endpoint in detail.
- Models and pricing for what each model costs. Prices live there so that this post never goes out of date.
- Our next posts cover generating video with the async task API, choosing an image model and controlling cost with points and API key limits.