功能建议:为 Cindy 订阅提供可控的终端 API 访问能力
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 401
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
**提交人**: 赵涵
**客户端版本**: 0.1.30
---
## 使用场景
Cindy 用户已经订阅官方托管服务,希望在终端脚本、自动化任务或兼容 OpenAI/Codex 的 CLI 中使用同一 Cindy 账户/订阅可用的模型,而不必再为同一使用场景单独购买一套供应商 API Key。
当前仓库 README 提到:用户可以登录 Cindy 官方服务、授权已有的 Claude Code / Codex Coding Plan,或连接自己的 API Key;但目前没有看到面向终端调用的 Cindy API Key、公开 API 端点或 CLI 鉴权方式说明。
## 诉求
希望 Cindy 提供官方、可撤销、可审计的终端/API 访问能力,使用户能够:
- 使用 Cindy 账户或订阅对应的模型额度;
- 在终端工具或自定义脚本中调用 Cindy 支持的模型;
- 清楚知道请求消耗的是 Cindy 订阅额度,还是用户自己的 BYOK / 外部供应商额度。
## 建议方案
1. 在 Cindy 设置中提供生成、轮换和撤销 API Key / Access Token 的入口;如果长期密钥不合适,也可以优先提供浏览器 OAuth 登录的 CLI 流程,例如 `cindy auth login`。
2. 提供公开的 API 文档、Base URL、支持的协议(例如 OpenAI-compatible / Responses API)、模型列表和最小终端示例。
3. 对终端访问设置明确的额度、速率限制、权限范围和用量展示,并在计费页面区分 Cindy 订阅消耗与 BYOK / 外部供应商费用。
4. 从安全角度支持单次显示、按设备或用途创建、独立撤销、过期时间和审计记录;密钥不进入日志、会话历史或错误消息。
## 相关讨论
- #1463:Codex CLI 已能通过自定义 OpenAI 兼容 API 调用,但 Cindy 内置 Codex 当前固定使用 `cindy_gateway`,无法继承外部 provider。
- #1415:讨论了订阅 OAuth 登录与 API key 登录的区别。
- #774:建议在 Cindy 官方订阅与自定义 Provider 之间明确区分用量和费用。
---
**OS**: darwin arm64 (25.5.0)
**界面语言**: zh-CN
Contributor guide
Research direction
Start by reading the README sections describing Cindy-hosted services, Claude Code, Codex Coding Plan, and API keys. Review related issues #1463, #1415, and #774 to understand existing gateway, OAuth, and billing constraints. Done requires an agreed implementation scope covering terminal authentication, API compatibility, usage attribution, limits, and key security.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, authentication, authorization, backend-api-design, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100