Home / Docs

ThunderPeak API documentation

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

Quickstart

1. Sign up at console.thunder-peak.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://thunder-peak.com/v1POST /v1/chat/completions
Anthropic SDK / Messageshttps://thunder-peak.comPOST /v1/messages
Responses (Codex)https://thunder-peak.com/v1POST /v1/responses

Try it with curl (OpenAI-compatible chat):

curl https://thunder-peak.com/v1/chat/completions \
  -H "Authorization: Bearer $THUNDERPEAK_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 Messagesx-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 /api/video/generate with {key, model, prompt, size, duration} → returns a task_id; poll POST /api/video/status until state = SUCCEEDED and read the url.
  • Models: happyhorse-1.1-t2v (text), happyhorse-1.1-i2v (image), happyhorse-1.1-r2v (reference).
  • Pricing: 720P $0.38 per 5-second clip · 1080P $0.68 per 5-second clip (10s = ×2). Charged when the job is accepted; failed jobs are refunded automatically.
  • Notes: generation usually takes 1–3 minutes; output links are temporary, download promptly.

Tool configuration

Claude Code
export ANTHROPIC_BASE_URL=https://thunder-peak.com
export ANTHROPIC_AUTH_TOKEN=$THUNDERPEAK_KEY
claude
Codex CLI
codex --config set model_provider thunderpeak
codex --config set model gpt-6-astra
# base_url https://thunder-peak.com/v1 · responses
Cursor
Settings → Models → OpenAI-compatible: base URL https://thunder-peak.com/v1, key sk-tp-…, model prefix off.
Cherry Studio
添加 OpenAI 兼容提供商 → API 地址 https://thunder-peak.com/v1 → API Key → 模型列表自动拉取。
CodeWhale
# ~/.codewhale/config.toml
provider = "openai"
base_url = "https://thunder-peak.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://thunder-peak.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.
  • New accounts receive $2.50 of free test credit after email verification — try the gateway before buying credits.
  • Per-request metering covers input, output, cache-write, cache-read and thinking tokens. Streaming costs the same as non-streaming.
  • Listed prices: Claude & GPT at 66% of official rates; DeepSeek & Kimi K3 88%; GLM-5.3 80%, GLM-5.2 70%; Qwen at official rates. 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.

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.32 / $1.28 per 1M tokens (official rates). 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://thunder-peak.com/img-proxy?u=<URL-encoded image url>
    Example: https://thunder-peak.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 @thunderpeak_support — we reply in your language.