Docs

Build on the API

One key, one base URL, and 225 public REST endpoints — chat and agents through to speech, video, retrieval and rented compute. Every call is metered at the provider's real rate plus our margin, and the cost comes back in the response.

Base URL

https://api.quantumencoding.ai

Every public endpoint sits under /qai/v1. One base URL for every provider — you change the model string, not the integration.

Authentication

X-API-Key: qai_k_…

Create a key in Dashboard → Keys, choosing its routing region at creation. A signed-in session bearer token works too, for first-party apps.

Quickstart

Your first call

Sign up, create a key, send this. New accounts start with free credits, so it costs nothing to try.

curl https://api.quantumencoding.ai/qai/v1/chat \
  -H "X-API-Key: qai_k_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-fable-5-1",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Six SDKs wrap the same surface — TypeScript, Python, Go, Rust, Swift and Kotlin. See the SDK docs.

Surface

What the API covers

Grouped by what you'd reach for. Counts are operations in the live spec.

Chat & sessions

7

Completions, streaming, and server-side sessions with history.

Agents & missions

16

Orchestrated multi-model runs with SSE event streams.

Audio & voices

24

Speech synthesis, transcription, voice cloning, music, finetunes.

Video & avatars

16

Generation, avatars, digital twins, batch rendering.

Keys, credits & account

25

Scoped API keys, balances, packs, usage by reference.

Compute

13

GPU and CPU rental, deployments, instance lifecycle.

Scanner

12

Codebase and document scanning jobs.

Embeddings & RAG

11

Vectors, collections, and retrieval over your own corpus.

Batch & jobs

8

Async submission, polling, and job streams.

Search & documents

7

Grounded answers, LLM context, extraction and chunking.

Realtime

3

Ephemeral sessions for realtime voice over WSS.

Images

2

Generation and editing.

Models & pricing

2

The live model registry and per-token rates.

Every endpoint, with schemas and try-it-out, lives in the generated reference — rendered from openapi.yaml, so it is never out of date.

Metering

Cost on every response

Tokens are metered per call at the provider's rate plus our margin. Every response carries X-QAI-Cost-Ticks, X-QAI-Balance-After, X-QAI-Model and X-QAI-Request-Id — so you can reconcile spend without waiting for the dashboard.

Keys

Scoped and regional

Keys carry scopes, spend caps, expiry and a routing region chosen at creation — Americas, Europe (EU data residency) or Asia. Rotate or revoke without touching your code.

Errors

Typed, not just a status

Failures come back as {error: {message, type, code}} — a stable code to branch on and a sentence you can show a human. A missing or unknown key is a 401 AUTH_HEADER_MISSING / KEY_NOT_FOUND; a depleted balance is a 402.