最后更新
更新日志/chat5 credits per call聊天
向 Duck.ai 模型发送提示词,返回完整回复及其传输时的原始流。
Authorization: Bearer <key> on every request.Parameters
the user message to send (up to 16000 characters).
which model answers: gpt-6-luna (GPT-6 Luna), gpt-5.4-mini, claude-haiku-5-5, mistral-small-2603 (Mistral Small 4), tinfoil/gpt-oss-120b, tinfoil/gemma4-31b. See /models.
how hard a reasoning model thinks; "none", "low" or "medium" (falls back to the closest level the model supports).
optional earlier turns of the conversation as a JSON list, e.g. [{"role":"user","content":"My name is Ana"},{"role":"assistant","content":"Hi Ana!"}].
Response fields
modele.g."gpt-6-luna"reasoning_efforte.g."none"replye.g."Hello there, hope you’re well today."titlee.g."Five-word greeting"message_ide.g."msg_0f8e6cc9a8dd4647016b0da061c9d087d283ef136858cf5f65"chunks
texte.g."Hello"createde.g.1796055137846chunk_counte.g.9total_mse.g.2311pagination
counte.g.9has_moree.g.falsenext_cursorfetched_ate.g."2026-11-30T16:12:18.056Z"agee.g.0curl "https://api.maviapi.com/v1/sites/duck/chat?prompt=Say%20hello%20in%20five%20words.&model=gpt-6-luna&reasoning_effort=none" \-H "Authorization: Bearer $MAVI_KEY"
{
"model": "gpt-6-luna",
"reasoning_effort": "none",
"reply": "Hello there, hope you’re well today.",
"title": "Five-word greeting",
"message_id": "msg_0f8e6cc9a8dd4647016b0da061c9d087d283ef136858cf5f65",
"chunks": [
{
"text": "Hello",
"created": 1796055137846
}
],
"chunk_count": 9,
"total_ms": 2311,
"pagination": {
"count": 9,
"has_more": false,
"next_cursor": null
},
"fetched_at": "2026-11-30T16:12:18.056Z",
"age": 0
}Get all the data, no code
Collect every page of GET /chat into a dataset, for one request or for a whole list of them, then download it as CSV or JSON. A page costs the same as one call of the endpoint; the download is free.
Use duck.ai API from Claude, ChatGPT and your coding tools
Add this URL as a custom connector and sign in to maviapi. Nothing to install.
https://mcp.maviapi.com/mcpOr run it locally, with each endpoint of duck.ai API as its own tool:
claude mcp add maviapi -e MAVIAPI_TOOLS=duck -- npx -y '@maviapi/mcp'Import duck.ai API into Postman and other tools
How to importPaste a link into Postman, Insomnia, an agent framework or a no-code tool to get every endpoint with its parameters and response fields. The link always serves the current endpoints, so importing it again picks up new ones.
- OpenAPI 3.1
https://api.maviapi.com/v1/apis/duck/openapi.json - Postman
https://api.maviapi.com/v1/apis/duck/postman.json
The Postman collection sends the shared demo key until you put your own key in its maviapi_key variable.
使用 duck.ai API 进行开发
选择一个端点开始
- 聊天
GET /chat向 Duck.ai 模型发送提示词,返回完整回复及其传输时的原始流。
GET /chat 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 prompt string / query 否 the user message to send (up to 16000 characters). model string / query 否 which model answers: gpt-6-luna (GPT-6 Luna), gpt-5.4-mini, claude-haiku-5-5, mistral-small-2603 (Mistral Small 4), tinfoil/gpt-oss-120b, tinfoil/gemma4-31b. See /models. 可选值: gpt-6-luna, gpt-5.4-mini, claude-haiku-5-5, mistral-small-2603, tinfoil/gpt-oss-120b, tinfoil/gemma4-31b. reasoning_effort string / query 否 how hard a reasoning model thinks; "none", "low" or "medium" (falls back to the closest level the model supports). 可选值: none, low, medium. history string / query 否 optional earlier turns of the conversation as a JSON list, e.g. [{"role":"user","content":"My name is Ana"},{"role":"assistant","content":"Hi Ana!"}]. 响应字段 字段 类型 说明 model string reasoning_effort string reply string title string message_id string chunks object[] chunks[].text string chunks[].created integer chunk_count integer total_ms integer pagination object pagination.count integer pagination.has_more boolean pagination.next_cursor null fetched_at string age integer - 模型
GET /models列出 Duck.ai 免费访客可以对话的模型,以及每个模型支持的推理强度。
GET /models 的参数和响应字段
响应字段 字段 类型 说明 default string models object[] models[].id string models[].name string models[].creator string models[].reasoning_efforts string[] pagination object pagination.count integer pagination.has_more boolean pagination.next_cursor null fetched_at string age integer - 聊天补全
GET /v1/chat/completions向 Duck.ai 模型发送提示词,以 OpenAI chat-completions 格式返回回答,并以 OpenAI chunk 形式返回流。
GET /v1/chat/completions 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 prompt string / query 否 the user message to send (up to 16000 characters). model string / query 否 which model answers: gpt-6-luna, gpt-5.4-mini, claude-haiku-5-5, mistral-small-2603, tinfoil/gpt-oss-120b, tinfoil/gemma4-31b. See /models. 可选值: gpt-6-luna, gpt-5.4-mini, claude-haiku-5-5, mistral-small-2603, tinfoil/gpt-oss-120b, tinfoil/gemma4-31b. reasoning_effort string / query 否 how hard a reasoning model thinks; "none", "low" or "medium" (falls back to the closest level the model supports). 可选值: none, low, medium. history string / query 否 optional earlier turns as a JSON list, e.g. [{"role":"user","content":"My name is Ana"},{"role":"assistant","content":"Hi Ana!"}]. 响应字段 字段 类型 说明 id string object string created integer model string choices object[] choices[].index integer choices[].message object choices[].message.role string choices[].message.content string choices[].finish_reason string stream object[] stream[].id string stream[].object string stream[].created integer stream[].model string stream[].choices object[] stream[].choices[].index integer stream[].choices[].delta object stream[].choices[].delta.role string stream[].choices[].delta.content string stream[].choices[].finish_reason null fetched_at string age integer
将 duck.ai 数据导出为 CSV
下面的每个列表都可以下载为 CSV 文件,每条记录一行。用上方控制台下面的 "Get all the data, no code" 卡片把列表收集到数据集中。数据集会逐页读取列表,之后可下载为 CSV、JSON 或 JSONL。
| 列表 | CSV 列 |
|---|---|
模型GET /models | id, name, creator, reasoning_efforts |
嵌套的值(列表或对象)以 JSON 写入同一个单元格。 数据集和导出如何工作
duck.ai API 常见问题
能获取什么数据、费用多少、如何调用。
duck.ai 有官方 API 吗?
这个 duck.ai API 不是官方 API。它是 maviapi 针对 duck.ai 上的公开数据提供的独立托管 API,并非由 duck.ai 开发、认可或支持。duck.ai 是否提供自己的开发者 API,请向 duck.ai 咨询。这个 API 用一个 maviapi 密钥即可调用,它的每个端点和返回的每个字段都在本页有文档说明。
duck.ai API 可以获取哪些数据?
duck.ai API 有 3 个端点。每个端点都返回 JSON,参数和字段见上方的文档:
- GET
/chat: 向 Duck.ai 模型发送提示词,返回完整回复及其传输时的原始流。 - GET
/models: 列出 Duck.ai 免费访客可以对话的模型,以及每个模型支持的推理强度。 - GET
/v1/chat/completions: 向 Duck.ai 模型发送提示词,以 OpenAI chat-completions 格式返回回答,并以 OpenAI chunk 形式返回流。
duck.ai API 的价格是多少?
调用用您 maviapi 套餐中的积分支付,只有成功的调用才会计费。各端点每次调用消耗 1 到 5 个积分,每个端点的价格都标在上方。在 Hobby 套餐下(每月 $49,含 250,000 个积分),1,000 次调用约 $0.20 到 $0.98,视端点而定。失败的调用不收费。Free 套餐每月提供 1,000 个积分,无需信用卡。超出部分请查看套餐和积分价格。
如何调用 duck.ai API?
向端点发送 HTTPS 请求,并在 Authorization 请求头中带上您的 API 密钥。例如 GET /chat:
curl 'https://api.maviapi.com/v1/sites/duck/chat' \
-H "Authorization: Bearer $MAVI_KEY"在您的 API 密钥页面创建密钥,或者先在上方的控制台中用免费测试密钥试用任意端点。
以 JSON 获取 duck.ai 数据有哪些方式?
以 JSON 获取 duck.ai 数据的每种方式适合不同的需求:
- 自己写爬虫: 完全由自己掌控,不依赖任何服务商,但解析、被拦截的请求以及 duck.ai 每次改版后的修复都要自己负责。更适合从很少变化的页面一次性获取数据。
- Apify: 一个 Actor 市场,Actor 由您自己运行,输入、输出和价格由各个 Actor 决定。当已有 Actor 能返回您需要的数据,或者您想托管自己的代码时更合适。参见maviapi 与 Apify 的对比。
- RapidAPI: 一个汇集了众多提供方 API 的平台,用一个 RapidAPI 密钥调用,每个 API 单独定价。当您已经在使用该平台,并且其中某个 API 能满足需求时更合适。来源:RapidAPI docs。
- maviapi: 本页的 duck.ai API:3 个带文档的端点、公开的响应结构,以及一个可用于整个目录的密钥。当这些数据是您产品的一部分,而您不想维护爬虫时更合适。
duck.ai 改版后会怎样?
更新会破坏我的 duck.ai API 集成吗?
不会。您正在使用的端点,其结构永远不会改变:新的字段、可选参数和端点只会加在旁边,会破坏调用的变更则作为新端点发布。请忽略您不认识的响应字段,新内容请关注更新日志。
相关 API
- Tripadvisor API
来自 Tripadvisor 的行程规划数据:支持地点搜索,并可按地点(geo_id)获取景点、餐厅和酒店,包含评分、评论、价格和坐标。先用 /search 解析地名,再通过…
- Songkick 演唱会 API
从 Songkick 获取任意城市在指定日期范围内即将举行的演唱会和音乐节,包含场馆、演出者、票价和购票链接。
- Eventbrite API
Eventbrite 上指定城市和日期范围内的活动:日期、场地(含地址和坐标)、图片和简介,以及网站给出的总数。