Guide

Formati di output

Markdown, JSON strutturato, metadati, HTML, link, immagini, riassunto, domanda/risposta, highlights

Thunderbit può restituire qualsiasi combinazione dei formati seguenti. Usa l'array formats su /distill, /extract e /search per chiedere più del default. L'array legacy include resta supportato per metadata / html.

Formati disponibili

FormatoCome richiederloRestituito comeNote
Markdownformats: ["markdown"] (default per /distill)data.markdownGratis — incluso di default.
JSON strutturatoDefault per /extract; fornisci uno schema o lascia che Thunderbit lo auto-generidata.dataLo schema è opzionale dal 2026-05-19.
Metadatiinclude: ["metadata"]data.metadataGratis. Disponibile su /distill.
HTML originaleinclude: ["html"]data.htmlUsalo con parsimonia — payload grandi.
Linkformats: ["links"]data.links (array di {text, href})Gratis.
Immaginiformats: ["images"]data.images (array di {src, alt, width, height})Gratis.
Riassuntoformats: [{"type":"summary"}]data.summary (Markdown)+4 crediti al successo.
Domanda / Rispostaformats: [{"type":"question","question":"…"}]data.answer+4 crediti al successo.
Highlightsformats: [{"type":"highlights","query":"…"}]data.highlights (array di stringhe)+4 crediti al successo.

Combinare i formati

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"}
    ]
  }'

La risposta porta ogni chiave richiesta in datadata.markdown, data.links, data.images, data.summary, data.answer, data.highlights. Le chiavi non richieste sono omesse, non impostate a null.

Calcolo dei crediti

I formati LLM (summary, question, highlights) vengono addebitati solo quando restituiscono un risultato. La risposta include un campo creditsUsed nelle risposte batch e search; per chiamate a singola pagina controlla il ledger del tuo account.

  • Distill con un formato LLM → 1 + 4 = 5 credits
  • Distill con tre formati LLM → 1 + 3×4 = 13 credits
  • Extract con un formato LLM → 20 + 4 = 24 credits
  • Search con limit: 5 e summary → 5 × (1 + 4) + 1 = 26 credits

Booleani legacy e include

Le richieste più vecchie usavano includeHtml: true ed extractLinks: true. Entrambi funzionano ancora; nel codice nuovo preferisci formats (e include per metadata / html) — sono componibili e più chiari nelle code review.