指南

输出格式

Markdown、结构化 JSON、元数据、HTML、链接、图片、摘要、问题/回答、高亮

Thunderbit 可以返回下面格式的任意组合。需要默认之外的内容时,在 /distill/extract/search 上用 formats 数组指定。旧的 include 数组仍然支持 metadata / html

可用格式

格式请求方式返回位置备注
Markdownformats: ["markdown"]/distill 默认)data.markdown免费 —— 默认包含。
结构化 JSON/extract 默认;提供 schema,或让 Thunderbit 自动生成data.dataSchema 自 2026-05-19 起为可选。
元数据include: ["metadata"]data.metadata免费。/distill 可用。
原始 HTMLinclude: ["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.markdowndata.linksdata.imagesdata.summarydata.answerdata.highlights。没请求的 key 会被省略,而不是置 null。

积分算法

LLM 格式(summaryquestionhighlights)只有真的返回结果时才会计费。批量与搜索响应会附带 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: trueextractLinks: true。这两个仍然能用;但新代码里更推荐 formats(以及用于 metadata / htmlinclude)—— 可组合,并且在代码评审里更清晰。