AI workbench for macOS
控制台/API

开发者 · API

接入说明:Base URL、鉴权、模型 ID、示例请求,以及 CLI 设备登录。

Clavue API

模型 API 定价

限时 −70% / −75%

官方模型按输入 / 输出 token 计费。当前活动价:轻量 −70%,旗舰 −75%(单位 ¥ / 1M tokens)。结账支持支付宝 / 微信。

档位折扣输入输出
Fast / Light70%¥1.01¥2.02
Standard / Flagship75%¥3.13¥6.26

活动价:¥1.01 / ¥2.02 per 1M(Fast)· ¥3.13 / ¥6.26 per 1M(旗舰档)。改折扣只需更新服务端配置。

auto
¥1.01 / ¥2.02
clavue
¥3.13 / ¥6.26
clavue-2.1
¥3.13 / ¥6.26
clavue-2.1-fast
¥1.01 / ¥2.02
clavue-2.1-pro
¥3.13 / ¥6.26
clavue-2.1-rev
¥3.13 / ¥6.26
clavue-2.1-search
¥3.13 / ¥6.26
clavue-img
¥3.13 / ¥6.26
clavue-ocr
¥1.01 / ¥2.02
clavue-music
¥3.13 / ¥6.26

四档:Free · 付费(×1,首月免费) · ×5 · ×20。支持包月 / 包年。人民币结算(支付宝 / 微信)。API 原价对标行业前沿标价,限时促销显示活动价。

快速开始

OpenAI-compatible
  1. /account 登录,或使用 Clavue CLI 设备码登录。
  2. Base URL 使用 https://api.clavue.com(也可用https://www.clavue.com 同源路径)。
  3. 请求头 Authorization: Bearer <token>
  4. 模型字段使用产品 ID:auto · clavue · clavue-2.1 · clavue-2.1-fast · clavue-2.1-pro · clavue-2.1-rev · clavue-2.1-search · clavue-img · clavue-ocr · clavue-music

鉴权

Web 使用 HttpOnly Cookie;CLI / 脚本使用 Bearer sessionToken(设备码授权后下发)。用量计入会员 Free/Pro/Max 的 day·week·month 池。

Web

Cookie imux_membership_session

CLI / API

Authorization: Bearer …

企业 / 商业 Key

cv_ent_

其他产品用组织 Key 连接 api.clavue.com。商业申请自动通过;企业需审核。每次成功鉴权会记录来源服务器 IP。

  1. /enterprise/apply
  2. /enterprise/console 签发 cv_ent_ 并查看 IP
  3. 文档 /docs/enterprise

官方 MCP · web_search

clavue-2.1-search

托管官方 MCP(server=clavue)。工具 web_search → mcp__clavue__web_search。imux Agent 自动注入;chat 调研按钮与 OpenAI model=clavue-2.1-search 等价。输出 clavue.search.v1(非自由对话)。

# 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":"..."}]}'

端点

GET/v1/models

列出模型

返回当前账号可用的产品模型 ID 列表。

Auth: Bearer session or membership token

curl -s https://api.clavue.com/v1/models \
  -H "Authorization: Bearer $CLAVUE_TOKEN"
POST/v1/chat/completions

对话补全

OpenAI 兼容对话。使用产品模型 ID(如 clavue-2.1)。用量计入会员额度池。

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

会员套餐

公开套餐目录(Free / Pro / Max)与 Included 额度。

Auth: None

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

设备码登录 · 开始

CLI 设备码流程(类 RFC 8628)。打开浏览器授权页。

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

设备码登录 · 轮询

轮询直到用户在浏览器授权;返回 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

列出 API Keys

列出个人 API Key 前缀(需网页会话)。

Auth: Cookie session

POST/api/membership/auth/api-keys

创建 API Key

生成 cv_live_… token(仅显示一次)。作为 /v1/* 的 Authorization Bearer。

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/start → 打开 verification_uri_complete → 浏览器登录并授权 → CLI poll 拿到 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"}'

错误与额度(排查友好)

所有 /v1 与 /api/membership/v1 错误都带 requestId + stage + code。imux 原生端与 playground 会展示「排查参考」行;服务端结构化日志可按 requestId 关联。

用户 30 秒排查
  1. 看 code:需要登录 → 重新登录;额度不足 → 升级方案或灵活加量;upstream_* → 重试或换模型。
  2. 复制错误末尾「排查参考」整行(含 mbr_… requestId)再反馈。
  3. 已登录仍失败通常不是登录问题——上游失败会自动退还本次额度。
  • 401 sign_in_required 未登录 / token 无效
  • 429 rate_limited IP / 用户 RPM
  • 402 quota_exceeded 额度耗尽(升级方案 / 灵活加量 / 等待重置)
  • 502/503 upstream_* 官方上游失败(自动退还本次额度)
// 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)