指南

輸出格式

Markdown、結構化 JSON、metadata、HTML、連結、圖片、摘要、問題/回答、高亮

Thunderbit 可以回傳下列格式的任意組合。要超出預設的內容,在 /distill/extract/search 使用 formats 陣列。舊的 include 陣列對 metadata / html 仍持續支援。

可用格式

格式請求方式回傳位置備註
Markdownformats: ["markdown"]/distill 預設)data.markdown免費 —— 預設包含。
結構化 JSON/extract 預設;提供 schema 或讓 Thunderbit 自動產生data.dataSchema 從 2026-05-19 起為選用。
Metadatainclude: ["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)只在實際回傳結果時才計費。batch 與 search 回應會附帶 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

舊版 boolean 與 include

舊請求用 includeHtml: trueextractLinks: true。兩者仍可用;新程式碼建議改用 formats(以及用於 metadata / htmlinclude)—— 可組合且在 code review 時更清楚。