API guide

Quick start

The public API follows the OpenAI shape. If you already use an OpenAI SDK, change the base URL and the key and you are done.

Base URL

Every endpoint in this guide lives under the base URL https://api.novapi.ai/v1.

1. Get an API key

Create a key on the key page and keep it secret. Send it as Authorization: Bearer <key> on every request.

2. Pick a model

Browse the catalog for model ids, categories and prices, or call GET /v1/models (no key needed). Use the model id exactly as listed.

To see what a call will cost with your own discount before you submit it, see Model pricing lookup.

3. Make your first call

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."
    }
  ]
}'

Python (OpenAI 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)

TypeScript (OpenAI 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);

Endpoints at a glance

CapabilityEndpointMode
ChatPOST /v1/chat/completionsSynchronous, optional streaming
ImagesPOST /v1/images/generationsSynchronous
VideoPOST /v1/videos, GET /v1/videos/{id}Asynchronous: create, then poll
Speech (TTS)POST /v1/audio/speechSynchronous, returns audio bytes
Speech to textPOST /v1/audio/transcriptions, GET /v1/audio/transcriptions/{id}Waits up to about 110 seconds, else 202 and poll
Music (extension)POST /v1/audio/generationsAsynchronous: create, then poll
ffmpeg (extension)POST /v1/ffmpeg/jobsAsynchronous: create, then poll
ModelsGET /v1/models, GET /api/cqt/modelsPublic, no key
Price lookupGET /api/cqt/models/me, POST /api/cqt/generator/price-preview/{model}, POST /v1/videos/price-previewYour price list and quotes; key required