AI command center for macOS
Console/API

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.

TierOffInputOutput
Fast / Light70%$0.042$0.084
Standard / Flagship75%$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.

auto
$0.042 / $0.084
clavue
$0.109 / $0.218
clavue-2.1
$0.109 / $0.218
clavue-2.1-fast
$0.042 / $0.084
clavue-2.1-pro
$0.109 / $0.218
clavue-2.1-rev
$0.109 / $0.218
clavue-2.1-search
$0.109 / $0.218

Global: 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
  1. Create a session via /account or Clavue CLI device-code login.
  2. Set base URL to https://api.clavue.com (or https://www.clavue.com same-origin paths).
  3. Header Authorization: Bearer <token>
  4. 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.

Web

Cookie imux_membership_session

CLI / API

Authorization: Bearer …

Official MCP · web_search

clavue-2.1-search

Hosted 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

GET/v1/models

List 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"
POST/v1/chat/completions

Chat 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"}]
  }'
GET/api/membership/plans

Membership plans

Public plan catalog (Free / Pro / Max) and included usage.

Auth: None

curl -s https://www.clavue.com/api/membership/plans
POST/api/membership/auth/device/start

Device 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"}'
POST/api/membership/auth/device/poll

Device 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"}'
GET/api/membership/auth/api-keys

List API keys

List personal API key prefixes (web session required).

Auth: Cookie session

POST/api/membership/auth/api-keys

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

User 30-second triage
  1. Read code: sign_in_required → sign in; quota_exceeded → account/boost; upstream_* → retry or switch model.
  2. Copy the full Ref line (mbr_… requestId) when reporting.
  3. Signed-in failures are often upstream, not auth — failed turns refund quota.
  • 401 sign_in_required unsigned / invalid token
  • 429 rate_limited IP / user RPM
  • 402 quota_exceeded quota exhausted (upgrade / top-up / wait)
  • 502/503 upstream_* 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)