Quanta

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 verbFull pathWire familyWhat it does
HTTP GETapi.quantarelay.com/v1/modelsOpenAILists callable models except Gemini; needs a key; free
HTTP POSTapi.quantarelay.com/v1/chat/completionsOpenAIChat completions, streaming supported
HTTP POSTapi.quantarelay.com/v1/responsesOpenAIResponses API, streaming supported
HTTP POSTapi.quantarelay.com/v1/messagesAnthropicMessages API, streaming supported
HTTP POSTapi.quantarelay.com/v1/messages/count_tokensAnthropicCounts tokens; never billed
HTTP GETapi.quantarelay.com/v1beta/modelsGeminiLists Gemini models; needs a key; free
HTTP POSTapi.quantarelay.com/v1beta/models/{model}:generateContentGeminiReturns the whole answer at once
HTTP POSTapi.quantarelay.com/v1beta/models/{model}:streamGenerateContent?alt=sseGeminiStreams the answer as SSE
HTTP POSTapi.quantarelay.com/v1beta/models/{model}:countTokensGeminiCounts 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 valueWhat it does
400 · invalid_request_errorModel missing or unknown, or not available on this protocol
401 · authentication_errorKey missing or not recognised
402 · insufficient_quotaBalance exhausted — top up, then retry
403 · permission_errorAccount suspended
404 · not_foundNo such route
413 · invalid_request_errorRequest body over 25 MB
429 · rate_limit_errorPer-key rate or per-account concurrency limit reached
502 · api_errorProvider unreachable; nothing charged
503 · api_errorUpstream 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-sol
  • gpt-6-astra
  • gpt-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
gemini
curl "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-pro
  • gemini-4-argon
  • gemini-3.8-flash
  • gemini-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
claude

Claude 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.

Sign up