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

模型 API 定价
限时 −70% / −75%官方模型按输入 / 输出 token 计费。当前活动价:轻量 −70%,旗舰 −75%(单位 ¥ / 1M tokens)。结账支持支付宝 / 微信。
| 档位 | 折扣 | 输入 | 输出 |
|---|---|---|---|
| Fast / Light | −70% | ¥1.01 | ¥2.02 |
| Standard / Flagship | −75% | ¥3.13 | ¥6.26 |
活动价:¥1.01 / ¥2.02 per 1M(Fast)· ¥3.13 / ¥6.26 per 1M(旗舰档)。改折扣只需更新服务端配置。
autoclavueclavue-2.1clavue-2.1-fastclavue-2.1-proclavue-2.1-revclavue-2.1-searchclavue-imgclavue-ocrclavue-music四档:Free · 付费(×1,首月免费) · ×5 · ×20。支持包月 / 包年。人民币结算(支付宝 / 微信)。API 原价对标行业前沿标价,限时促销显示活动价。
快速开始
OpenAI-compatible- 在 /account 登录,或使用 Clavue CLI 设备码登录。
- Base URL 使用
https://api.clavue.com(也可用https://www.clavue.com同源路径)。 - 请求头
Authorization: Bearer <token> - 模型字段使用产品 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 池。
Cookie imux_membership_session
Authorization: Bearer …
企业 / 商业 Key
cv_ent_其他产品用组织 Key 连接 api.clavue.com。商业申请自动通过;企业需审核。每次成功鉴权会记录来源服务器 IP。
- /enterprise/apply
- /enterprise/console 签发 cv_ent_ 并查看 IP
- 文档 /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":"..."}]}'端点
/v1/models列出模型
返回当前账号可用的产品模型 ID 列表。
Auth: Bearer session or membership token
curl -s https://api.clavue.com/v1/models \
-H "Authorization: Bearer $CLAVUE_TOKEN"/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"}]
}'/api/membership/plans会员套餐
公开套餐目录(Free / Pro / Max)与 Included 额度。
Auth: None
curl -s https://www.clavue.com/api/membership/plans/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"}'/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"}'/api/membership/auth/api-keys列出 API Keys
列出个人 API Key 前缀(需网页会话)。
Auth: Cookie session
/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 关联。
- 看 code:需要登录 → 重新登录;额度不足 → 升级方案或灵活加量;upstream_* → 重试或换模型。
- 复制错误末尾「排查参考」整行(含 mbr_… requestId)再反馈。
- 已登录仍失败通常不是登录问题——上游失败会自动退还本次额度。
401sign_in_required— 未登录 / token 无效429rate_limited— IP / 用户 RPM402quota_exceeded— 额度耗尽(升级方案 / 灵活加量 / 等待重置)502/503upstream_*— 官方上游失败(自动退还本次额度)
// 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)