指南
输出格式
Markdown、结构化 JSON、元数据、HTML、链接、图片、摘要、问题/回答、高亮
Thunderbit 可以返回下面格式的任意组合。需要默认之外的内容时,在 /distill、/extract 和 /search 上用 formats 数组指定。旧的 include 数组仍然支持 metadata / html。
可用格式
| 格式 | 请求方式 | 返回位置 | 备注 |
|---|---|---|---|
| Markdown | formats: ["markdown"](/distill 默认) | data.markdown | 免费 —— 默认包含。 |
| 结构化 JSON | /extract 默认;提供 schema,或让 Thunderbit 自动生成 | data.data | Schema 自 2026-05-19 起为可选。 |
| 元数据 | include: ["metadata"] | data.metadata | 免费。/distill 可用。 |
| 原始 HTML | include: ["html"] | data.html | 慎用 —— payload 体积大。 |
| 链接 | formats: ["links"] | data.links({text, href} 的数组) | 免费。 |
| 图片 | formats: ["images"] | data.images({src, alt, width, height} 的数组) | 免费。 |
| 摘要 | formats: [{"type":"summary"}] | data.summary(Markdown) | 成功时 +4 积分。 |
| 问题 / 回答 | formats: [{"type":"question","question":"…"}] | data.answer | 成功时 +4 积分。 |
| 高亮 | formats: [{"type":"highlights","query":"…"}] | data.highlights(字符串数组) | 成功时 +4 积分。 |
组合多种格式
curl -X POST https://openapi.thunderbit.co/openapi/v1/distill \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/article",
"formats": [
"markdown",
"links",
"images",
{"type": "summary"},
{"type": "question", "question": "What is this page about?"},
{"type": "highlights", "query": "key takeaways"}
]
}'响应中每个被请求的 key 都放在 data 下 —— data.markdown、data.links、data.images、data.summary、data.answer、data.highlights。没请求的 key 会被省略,而不是置 null。
积分算法
LLM 格式(summary、question、highlights)只有真的返回结果时才会计费。批量与搜索响应会附带 creditsUsed 字段;单页调用请查看账户账单。
- Distill 带一个 LLM 格式 → 1 + 4 = 5 credits
- Distill 带三个 LLM 格式 → 1 + 3×4 = 13 credits
- Extract 带一个 LLM 格式 → 20 + 4 = 24 credits
- Search 设置
limit: 5并带summary→ 5 × (1 + 4) + 1 = 26 credits
旧版布尔参数与 include
更早的请求使用 includeHtml: true 和 extractLinks: true。这两个仍然能用;但新代码里更推荐 formats(以及用于 metadata / html 的 include)—— 可组合,并且在代码评审里更清晰。