AI platform · IDE · agents · models
控制台/API

开发者 · API

对标 xAI / OpenAI 控制台文档结构:Base URL、鉴权、模型 ID、示例请求、CLI 设备登录。

模型 API 定价

DeepSeek V4 × 1/3

标价单位 ¥ / 1M tokens(人民币展示)。Fast 对标 V4 Flash÷3;Standard / Flagship 对标 V4 Pro÷3。结算仅支付宝 / 微信。

档位锚定输入输出
FastV4 Flash ÷ 3¥0.34¥0.67
Standard / FlagshipV4 Pro ÷ 3¥1.04¥2.09

对标 DeepSeek V4 ÷ 3。Flash 参考 $0.14/$0.28 · Pro $0.435/$0.87(USD)。Clavue:¥0.34 / ¥0.67 per 1M(Fast)· ¥1.04 / ¥2.09 per 1M(Pro 档)

auto
¥0.34 / ¥0.67
clavue
¥1.04 / ¥2.09
clavue-2.1
¥1.04 / ¥2.09
clavue-2.1-fast
¥0.34 / ¥0.67
clavue-2.1-pro
¥1.04 / ¥2.09
clavue-2.1-rev
¥1.04 / ¥2.09

四档:Free · 付费(×1,首月免费) · ×5 · ×20。支持包月 / 包年(约等于送 2 个月)。人民币结算,支付宝 / 微信。额度按 ×1 基准线性放大,价格低于线性。

快速开始

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

鉴权

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

Web

Cookie imux_membership_session

CLI / API

Authorization: Bearer …

端点

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"}'

错误与额度

  • 401 未登录 / token 无效
  • 429 RPM 或设备码频率限制
  • 额度耗尽:升级 Pro/Max 或购买 On-demand 加油包(/pricing · /account)。