Connecting your clients to Quanta
The API lives on its own subdomain, api.quantarelay.com, separate from the website. Each client is covered below.
API reference
Every path below lives on https://api.quantarelay.com; all three protocols share one key and one balance.
Endpoint map
| HTTP verb | Full path | Wire family | What it does |
|---|---|---|---|
HTTP GET | api.quantarelay.com/v1/models | OpenAI | Lists callable models except Gemini; needs a key; free |
HTTP POST | api.quantarelay.com/v1/chat/completions | OpenAI | Chat completions, streaming supported |
HTTP POST | api.quantarelay.com/v1/responses | OpenAI | Responses API, streaming supported |
HTTP POST | api.quantarelay.com/v1/messages | Anthropic | Messages API, streaming supported |
HTTP POST | api.quantarelay.com/v1/messages/count_tokens | Anthropic | Counts tokens; never billed |
HTTP GET | api.quantarelay.com/v1beta/models | Gemini | Lists Gemini models; needs a key; free |
HTTP POST | api.quantarelay.com/v1beta/models/{model}:generateContent | Gemini | Returns the whole answer at once |
HTTP POST | api.quantarelay.com/v1beta/models/{model}:streamGenerateContent?alt=sse | Gemini | Streams the answer as SSE |
HTTP POST | api.quantarelay.com/v1beta/models/{model}:countTokens | Gemini | Counts tokens; never billed |
Headers and authentication
- Send the key as Authorization: Bearer on OpenAI routes, x-api-key on Anthropic routes and x-goog-api-key on Gemini routes.
- When an Anthropic request carries no anthropic-version, Quanta adds 2023-06-01.
- The key may also travel as a ?key= query parameter, mainly for Gemini clients.
- Your client IP, cookies and CDN headers are never passed upstream.
Limits and timeouts
- Per key: up to 120 requests in any 60 seconds
- Per account: up to 8 requests in flight
- Request body: 25 MB at most
- Per account: up to 20 live keys
- Streams: no total time cap; only 300 s of upstream silence ends one
Error format and status codes
Errors always come back in the OpenAI envelope:
{"error": {"message": "Your Quanta balance is used up. Top up from the dashboard to resume metered calls.", "type": "insufficient_quota", "code": 402}}
| HTTP · type value | What it does |
|---|---|
400 · invalid_request_error | Model missing or unknown, or not available on this protocol |
401 · authentication_error | Key missing or not recognised |
402 · insufficient_quota | Balance exhausted — top up, then retry |
403 · permission_error | Account suspended |
404 · not_found | No such route |
413 · invalid_request_error | Request body over 25 MB |
429 · rate_limit_error | Per-key rate or per-account concurrency limit reached |
502 · api_error | Provider unreachable; nothing charged |
503 · api_error | Upstream line not configured |
Integration guides
With the protocol covered above, here is the setup for each kind of client.
OpenAI SDKs, Codex and other compatible clients
Set base_url to the base address plus /v1 and api_key to your key. Chat goes to /v1/chat/completions; the Responses API is at /v1/responses.
base_url = "https://api.quantarelay.com/v1" # Quanta, OpenAI-compatible
api_key = "qnt-your-key-here"Python, using the official openai package:
from openai import OpenAI # pip install openai
qt = OpenAI(base_url="https://api.quantarelay.com/v1", api_key="qnt-your-key-here")
qt_reply = qt.chat.completions.create(model="gpt-6.1-sol", messages=[{"role": "user", "content": "Summarise this quarter’s incident log in three bullet points"}])
print(qt_reply.choices[0].message.content)curl https://api.quantarelay.com/v1/chat/completions \
-H "Authorization: Bearer qnt-your-key-here" -H "Content-Type: application/json" \
-d '{"model":"gpt-6.1-sol","messages":[{"role":"user","content":"Summarise this quarter’s incident log in three bullet points"}]}'GPT ids we suggest starting with:
gpt-6.1-solgpt-6-astragpt-5.6-sol
Gemini CLI and the native Gemini API
Set GOOGLE_GEMINI_BASE_URL to the bare host (do not append /v1beta) and GEMINI_API_KEY to your key, then run gemini.
export GOOGLE_GEMINI_BASE_URL=https://api.quantarelay.com
export GEMINI_API_KEY=qnt-your-key-here
geminicurl "https://api.quantarelay.com/v1beta/models/gemini-3.8-flash:generateContent" \
-H "x-goog-api-key: qnt-your-key-here" -H "Content-Type: application/json" \
-d '{"contents":[{"role":"user","parts":[{"text":"List three ways to cut token spend on batch jobs"}]}]}'Gemini models speak only their native protocol: :generateContent for a single answer, :streamGenerateContent?alt=sse for streaming. They cannot be called through /v1/chat/completions.
Gemini model IDs on offer:
gemini-3.1-progemini-4-argongemini-3.8-flashgemini-2.5-flash
Claude Code and Claude Desktop
Set two environment variables, then run claude: ANTHROPIC_BASE_URL points at the base address (no /v1) and ANTHROPIC_AUTH_TOKEN carries your key.
export ANTHROPIC_BASE_URL=https://api.quantarelay.com
export ANTHROPIC_AUTH_TOKEN=qnt-your-key-here
claudeClaude models are served only to the official Claude Code and Claude Desktop clients, and Claude Code must be version 2.1.285 or newer — an upstream restriction. GPT, Gemini and the rest work from any compatible client or SDK.