OpenAI-compatible gateway for duck.ai · version v0.4.1
v2 起所有 /v1/* 请求必须携带 API Key(Authorization: Bearer sk-duck-…),首次启动会自动生成 default key 并打印一次,也可在管理后台创建。
| 方法 | 路径 | 说明 |
|---|---|---|
| GET | /v1/models | 模型列表(含免费/付费标记) |
| POST | /v1/chat/completions | 对话补全(stream / web_search / image_generation / reasoning_effort) |
| POST | /v1/responses | OpenAI Responses API |
| POST | /v1/images/generations | 图片生成 |
| POST | /v1/compact | 客户端显式上下文压缩(返回摘要 + 保留的最近消息) |
| — | /admin/api/* | 管理 API(adminToken) |
curl http://127.0.0.1:8787/v1/chat/completions \
-H "Authorization: Bearer $DUCKAI_CPA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-6-luna","messages":[{"role":"user","content":"Hello"}]}'