Developers · API
Console-style API docs: base URL, auth, model ids, sample requests, and CLI device login.
Model API pricing
Promo −70% / −75%List matches industry frontier API rates; sale = list × (1 − discount). Discounts from server config (api-pricing.json / env). Now: light −70%, flagship −75%. ¥ / 1M tokens. Checkout: Alipay / WeChat.
| Tier | Off | Input | Output |
|---|---|---|---|
| Fast / Light | −70% | $0.042 | $0.084 |
| Standard / Flagship | −75% | $0.109 | $0.218 |
Sale: $0.042 / $0.084 per 1M (Fast) · $0.109 / $0.218 per 1M (flagship). Change discounts via server config only.
autoclavueclavue-2.1clavue-2.1-fastclavue-2.1-proclavue-2.1-revclavue-2.1-searchGlobal: Paid $9 · ×5 $19 · ×20 $39. API list matches industry frontier rates with a limited launch discount. Checkout today: Alipay / WeChat (CNY SKUs). Card billing soon.
Quickstart
OpenAI-compatible- Create a session via /account or Clavue CLI device-code login.
- Set base URL to
https://api.clavue.com(orhttps://www.clavue.comsame-origin paths). - Header
Authorization: Bearer <token> - Use product model ids: auto · clavue · clavue-2.1 · clavue-2.1-fast · clavue-2.1-pro · clavue-2.1-rev · clavue-2.1-search
Authentication
Web uses HttpOnly cookies; CLI/scripts use Bearer sessionToken from device approval. Usage counts against Free/Pro/Max day·week·month pools.
Cookie imux_membership_session
Authorization: Bearer …
Official MCP · web_search
clavue-2.1-searchHosted Official MCP (server=clavue). Tool web_search → mcp__clavue__web_search. Injected in imux Agent; chat Research and OpenAI model=clavue-2.1-search are equivalent. Output clavue.search.v1 (not free-form chat).
# Discover
curl -s https://api.clavue.com/v1/mcp -H "Authorization: Bearer $TOKEN"
# Call
curl -s https://api.clavue.com/v1/mcp/tools/call \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"web_search","arguments":{"query":"..."} }'
# OpenAI-compatible
curl -s https://api.clavue.com/v1/chat/completions \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"model":"clavue-2.1-search","stream":false,"messages":[{"role":"user","content":"..."}]}'Endpoints
/v1/modelsList models
Returns product model ids available to the authenticated account.
Auth: Bearer session or membership token
curl -s https://api.clavue.com/v1/models \
-H "Authorization: Bearer $CLAVUE_TOKEN"/v1/chat/completionsChat completions
OpenAI-compatible chat. Use product model ids (e.g. clavue-2.1). Usage counts against membership pools.
Auth: Bearer session or membership token
curl -s https://api.clavue.com/v1/chat/completions \
-H "Authorization: Bearer $CLAVUE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "clavue-2.1",
"messages": [{"role":"user","content":"Review this diff"}]
}'/api/membership/plansMembership plans
Public plan catalog (Free / Pro / Max) and included usage.
Auth: None
curl -s https://www.clavue.com/api/membership/plans/api/membership/auth/device/startDevice code start
CLI device-code flow (RFC 8628-ish). Opens browser approve-page.
Auth: None (rate-limited)
curl -s https://www.clavue.com/api/membership/auth/device/start \
-H "Content-Type: application/json" \
-d '{"client":"clavue-cli"}'/api/membership/auth/device/pollDevice code poll
Poll until the user approves in the browser; returns sessionToken.
Auth: None (rate-limited)
curl -s https://www.clavue.com/api/membership/auth/device/poll \
-H "Content-Type: application/json" \
-d '{"device_code":"$DEVICE_CODE"}'/api/membership/auth/api-keysList API keys
List personal API key prefixes (web session required).
Auth: Cookie session
/api/membership/auth/api-keysCreate API key
Mint a cv_live_… token (shown once). Use as Authorization Bearer for /v1/*.
Auth: Cookie session
curl -s https://www.clavue.com/api/membership/auth/api-keys \
-H "Content-Type: application/json" \
-H "Cookie: imux_membership_session=…" \
-d '{"name":"production"}'Clavue CLI device login
CLI calls device/start → open verification_uri_complete → sign in & approve in browser → poll returns sessionToken.
# 1) start
curl -s https://www.clavue.com/api/membership/auth/device/start \
-H "Content-Type: application/json" \
-d '{"client":"clavue-cli"}'
# 2) open verification_uri_complete in browser
# 3) poll
curl -s https://www.clavue.com/api/membership/auth/device/poll \
-H "Content-Type: application/json" \
-d '{"device_code":"$DEVICE_CODE"}'Errors & quotas (support-ready)
Every /v1 and /api/membership/v1 error carries requestId + stage + code. imux native + playground show a Ref line; server logs correlate by requestId.
- Read code: sign_in_required → sign in; quota_exceeded → account/boost; upstream_* → retry or switch model.
- Copy the full Ref line (mbr_… requestId) when reporting.
- Signed-in failures are often upstream, not auth — failed turns refund quota.
401sign_in_required— unsigned / invalid token429rate_limited— IP / user RPM402quota_exceeded— quota exhausted (upgrade / top-up / wait)502/503upstream_*— official upstream failure (turn quota refunded)
// Error envelope (OpenAI-compatible + membership)
{
"ok": false,
"requestId": "mbr_…",
"error": { "message": "…", "type": "…", "code": "upstream_error" },
"message": "…",
"messageZh": "…",
"code": "upstream_error",
"stage": "upstream",
"actions": ["retry_later", "switch_model"],
"debug": {
"productModel": "auto",
"upstreamStatus": 500,
"upstreamHost": "…",
"quotaRefunded": true,
"latencyMs": 320
}
}
// Headers: x-imux-request-id · x-imux-error-code · x-imux-error-stage
// Optional client header: x-imux-request-id (end-to-end trace)