API 指引 / 快速开始
快速开始
更新时间:2026-05-11
5 分钟完成首次 API 调用。如遇问题可随时在咨询页提交工单。
1. 获取 API Key
登录控制台 → API Key → 点击"创建 Key",妥善保存返回的明文密钥(仅显示一次)。
2. 发起首次请求
在请求 Header 中附加 Authorization: Bearer YOUR_API_KEY,POST 至 /chat/completions 即可。
cURL
curl -X POST "https://www.tokenwell.com.cn/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seed-2-0-lite-260215",
"messages": [{"role": "user", "content": "你好"}]
}'3. 查看响应
服务端会返回 OpenAI 兼容的 JSON 响应:
JSON
{"id": "chatcmpl-7xN3f2k...","object": "chat.completion","model": "doubao-seed-2-0-lite-260215","choices": [{"index": 0,"message": {"role": "assistant","content": "你好!有什么可以帮你?"},"finish_reason": "stop"}],"usage": {"prompt_tokens": 9,"completion_tokens": 12,"total_tokens": 21}}
没有找到想看的内容?联系我们 →