CheapTokens Skill

给 Cursor / Agent 用的本站能力

安装通用 Skill 后,用你自己的 API Key 即可让 Agent 列模型、比价选型、发起 OpenAI 兼容调用。 Key 只存在你本机环境,不会写进 Skill 文件。

1. 安装到 Cursor

把官方 Skill 拉到本机 ~/.cursor/skills/cheaptokens。装完后在对话里提到 CheapTokens / 找模型 / 调推理时即可触发。

终端一键安装
mkdir -p ~/.cursor/skills/cheaptokens
curl -fsSL https://cheaptokens.com/skills/cheaptokens/SKILL.md \
  -o ~/.cursor/skills/cheaptokens/SKILL.md
curl -fsSL https://cheaptokens.com/skills/cheaptokens/reference.md \
  -o ~/.cursor/skills/cheaptokens/reference.md

也可手动下载 SKILL.md · reference.md放到同一目录。

2. 配置你的认证

Skill 只认你自己的 Key。在控制台创建后写入环境变量(或 Cursor / Shell 的 secrets):

环境变量
export CHEAPTOKENS_API_KEY='cheap-你的密钥'
export CHEAPTOKENS_BASE_URL='https://api.cheaptokens.com/v1'

网关默认 https://api.cheaptokens.com/v1。本地开发可改为 http://localhost:47100/v1

3. 让 Agent 做什么

  • GET /models — 发现可用模型,按价格或能力筛选
  • POST /chat/completions — OpenAI 兼容对话(可带 X-Route-Strategy)
  • POST /embeddings — 向量嵌入
  • 说明 cheapest / fastest / stable 路由策略与常见错误处理

示例提示:「用 CheapTokens skill,列出便宜的对话模型,然后用我的 Key 测一句你好。」

安全说明

  • · Skill 正文不含任何平台共用 Key,也不应被改成内嵌密钥。
  • · 建议为 Agent 单独建一把 Key,并在控制台设置月预算。
  • · 完整 API 说明见 文档,智能体部署见 智能体