API 快速开始
按下面 5 步就能打通。
1. 注册登录
https://www.cokeapi.com/sign-in
2. 创建令牌
控制台 → 令牌 / API Keys → 添加令牌 → 复制 sk-... 并保存好。
3. 填 Base URL
不同软件写法不一样,优先这个:
https://www.cokeapi.com/v1
不行再试:
https://www.cokeapi.com
https://www.cokeapi.com/v1/chat/completions
4. 选模型
打开 https://www.cokeapi.com/pricing ,复制要用的模型名。
5. 发一条请求
curl https://www.cokeapi.com/v1/chat/completions \
-H "Authorization: Bearer sk-你的令牌" \
-H "Content-Type: application/json" \
-d '{
"model": "模型名",
"messages": [{"role":"user","content":"ping"}]
}'
不想写 curl,也可以登录后用 Playground:https://www.cokeapi.com/playground
配置模板
{
"base_url": "https://www.cokeapi.com/v1",
"api_key": "sk-你的令牌",
"model": "模型名"
}
下一步:
- 看 聊天补全
- 配 Cursor / Cherry Studio
- 用 OpenAPI 导入你自己的 Apifox:
https://doc.cokeapi.com/openapi.json