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
| Formato | Come richiederlo | Restituito come | Note |
|---|---|---|---|
| Markdown | formats: ["markdown"] (default per /distill) | data.markdown | Gratis — incluso di default. |
| JSON strutturato | Default per /extract; fornisci uno schema o lascia che Thunderbit lo auto-generi | data.data | Lo schema è opzionale dal 2026-05-19. |
| Metadati | include: ["metadata"] | data.metadata | Gratis. Disponibile su /distill. |
| HTML originale | include: ["html"] | data.html | Usalo con parsimonia — payload grandi. |
| Link | formats: ["links"] | data.links (array di {text, href}) | Gratis. |
| Immagini | formats: ["images"] | data.images (array di {src, alt, width, height}) | Gratis. |
| Riassunto | formats: [{"type":"summary"}] | data.summary (Markdown) | +4 crediti al successo. |
| Domanda / Risposta | formats: [{"type":"question","question":"…"}] | data.answer | +4 crediti al successo. |
| Highlights | formats: [{"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 data — data.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: 5esummary→ 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.