Home / Docs

QuantoPort API documentation

One gateway, every protocol. Get from zero to your first model call in two minutes.

Quickstart

1. Sign up at console.quantoport.com and create an API key (sk-tp-…).
2. Point your tool at the base URL below.
3. Send your first request.

Your tool speaks…Base URLExample call
OpenAI SDK / Chathttps://quantoport.com/v1POST /v1/chat/completions
Anthropic SDK / Messageshttps://quantoport.comPOST /v1/messages
Responses (Codex)https://quantoport.com/v1POST /v1/responses

Try it with curl (OpenAI-compatible chat):

curl https://quantoport.com/v1/chat/completions \
  -H "Authorization: Bearer $QUANTOPORT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-5","messages":[{"role":"user","content":"Say hello in one line"}]}'

Tip: query your live model list at any time with GET /v1/models using the same key — the catalogue is always current and per-key.

Protocols & endpoints

All three wire formats share one key and one credit balance. Request bodies and responses are byte-compatible with the upstream APIs — point any official SDK at the matching base URL.

  • Chat Completions — OpenAI-format messages, function calling, streaming via SSE. Use with OpenAI SDKs, Cherry Studio, most tools.
  • Anthropic Messages — x-api-key header + anthropic-version. Use with Claude Code and Anthropic SDK.
  • Responses — the modern OpenAI agent protocol used by Codex CLI/extension.

If a third-party client appends paths oddly, add or remove /v1 in the base URL — the gateway accepts both spellings and normalizes internally.

Video generation

HappyHorse 1.1 generates video from text, an image, or a reference clip. It uses the same API key and the same balance as your chat models.

  • Web UI: open /video, paste your key, describe the shot and generate.
  • API: POST /v1/videos with {model, prompt, resolution, seconds, image_url} and header Authorization: Bearer <key> (base https://console.quantoport.com) → returns an id; poll GET /v1/videos/{id} until status = completed, then download the clip from GET /v1/videos/{id}/content.
  • Models: happyhorse-1.1-t2v (text), happyhorse-1.1-i2v (image), happyhorse-1.1-r2v (reference).
  • Pricing: 480P/720P $0.35 per 5-second clip (10s = ×2). Charged when the job is accepted; failed jobs are refunded automatically.
  • Resolution always pass resolution explicitly (480P / 720P / 1080P). If it is missing or misspelled, the upstream produces a 1080P clip and bills at the 1080P rate.
  • Notes: generation usually takes 1–3 minutes; output links are temporary, download promptly.

Tool configuration

Claude Code
export ANTHROPIC_BASE_URL=https://quantoport.com
export ANTHROPIC_AUTH_TOKEN=$QUANTOPORT_KEY
claude
Codex CLI
codex --config set model_provider thunderpeak
codex --config set model gpt-6-astra
# base_url https://quantoport.com/v1 · responses
Cursor
Settings → Models → OpenAI-compatible: base URL https://quantoport.com/v1, key sk-tp-…, model prefix off.
Cherry Studio
添加 OpenAI 兼容提供商 → API 地址 https://quantoport.com/v1 → API Key → 模型列表自动拉取。
CodeWhale
# ~/.codewhale/config.toml
provider = "openai"
base_url = "https://quantoport.com/v1"
api_key = "sk-tp-…"
model = "glm-5.3" # any model we serve
Terminal coding agent, open models first — custom gateways supported.
Python OpenAI SDK
client = OpenAI(base_url="https://quantoport.com/v1", api_key="sk-tp-…")
VS Code extensions
Use the OpenAI-compatible provider option, paste base URL + key; many extensions auto-discover models.

Billing & tokens

  • Credits never expire. Top up with USDT on TRC-20 / BSC / Solana (min $10): copy the address on the Plans page, send the transfer, then paste your TXID back on that page — your balance is credited automatically, usually within a minute.
  • Per-request metering covers input, output, cache-write, cache-read and thinking tokens. Streaming costs the same as non-streaming.
  • Listed prices: Claude & GPT, DeepSeek, Kimi K3, Qwen at official list rates; GLM-5.3 15% off. Discounts are a standing policy, not a promo.
  • Your balance and per-key usage are visible in the console; query balance server-side with GET /v1/balance.

Account API

Check your balance from your own code — with the same key you already use for inference, no extra token. Read-only, so it is safe to poll (say every 5 minutes) for your own alerting.

  • Balance: GET /v1/balance with Authorization: Bearer sk-tp-… returns your account balance in USD, what you spent today / in the last 7 and 30 days, that key's own remaining quota and expiry, and your top-up link.
  • Main fields: balance_usd, usage.today_usd, usage.last_7d_usd, usage.last_30d_usd, key.remaining_usd, key.expires_at, is_available.
  • A missing, disabled or expired key gets 401 / 403 plus an error code, so it is easy to wire into your own monitoring.
  • Anything that writes — creating keys, per-model usage, top-up history — stays in the console.
  • Running low? We email you automatically once your balance drops below roughly three days of your recent average spend — you do not need to poll for that.

Vision

qwen3-vl-plus understands images: describe screenshots, read documents, OCR, or analyse photos. It uses the same API key and balance as your chat models.

  • Call format (OpenAI-compatible):
    POST /v1/chat/completions
    {
      "model": "qwen3-vl-plus",
      "messages": [{
        "role": "user",
        "content": [
          {"type": "text", "text": "Describe this image"},
          {"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}
        ]
      }]
    }
  • Pricing: $0.2 / $1.6 per 1M tokens. Images are billed as image tokens (roughly 100–1200 tokens per image depending on size).
  • Image sources: use a publicly reachable URL, or inline the image as a base64 data URL (data:image/png;base64,...).
  • Image proxy (recommended for images hosted abroad): our inference region sits in mainland China, so overseas image hosts may time out. Wrap any external URL with our proxy and it works everywhere:
    https://quantoport.com/img-proxy?u=<URL-encoded image url>
    Example: https://quantoport.com/img-proxy?u=https%3A%2F%2Fpicsum.photos%2F400%2F300
    The proxy fetches the image once, caches it, and serves it from our domain — sub-second on repeat calls.

Errors & rate limits

StatusMeaningAction
400Malformed request / unknown model for your keyCheck model ID against GET /v1/models
401Missing or invalid keyRe-check the key header
402Insufficient balanceTop up (USDT)
404Wrong endpoint for the model familyUse the correct base URL per protocol table
429Per-key rate limit hitBack off or raise your key limit in console
5xxUpstream provider issueWait and retry; check /healthz

Keys default to a conservative requests-per-minute limit; raise or lower it per key in the console. During upstream outages the gateway returns 5xx while GET /v1/models and /healthz stay green — that distinction means the problem is upstream, not your key.

Questions? Telegram — we reply in your language.