Quickstart: first extraction in 5 minutes
What you get
In five minutes you send one document and get its fields back as JSON, each with a confidence score, and then read the passage in the document that backs each value. This page is for developers and agent builders; if you prefer the browser, follow Bring documents in instead.
Before you start
- A Talonic account. Sign up at app.talonic.com; the free tier includes 50 extractions per day with no credit card.
- An API key. Open Settings → API Keys → Create New Key and copy the
tlnc_value; it is shown once. A new key carriesextract,read,writeandoperations, which is all this page needs. See Authentication. - A document to try, for example an invoice PDF of five pages or fewer so the answer comes back in the same response.
export TALONIC_API_KEY="tlnc_..."Do it in the app
- Open Sources and drop a file onto the upload area, or press Extract (Cmd+J / Ctrl+J) from any page.
- Pick a saved Spec, type the fields you want, or leave it empty to let Talonic list every field it finds.
- Open the result. Hover a value to see its confidence; click it to see the highlighted passage on the page it came from.
Do it with the API
Send the file to POST /v1/extract as multipart/form-data. Pass schema to name the fields you want (here a flat map of field name to type), or leave it out and Talonic returns every field it finds. Instead of file you can send file_url (a public URL) or document_id (a document already in your workspace); send exactly one of the three.
curl -X POST https://api.talonic.com/v1/extract \
-H "Authorization: Bearer $TALONIC_API_KEY" \
-F "file=@invoice.pdf" \
-F 'schema={"vendor_name":"string","invoice_number":"string","total_amount":"number","due_date":"date"}'import { Talonic } from '@talonic/node'
const talonic = new Talonic({ apiKey: process.env.TALONIC_API_KEY })
const result = await talonic.extract({
file_path: './invoice.pdf',
schema: {
vendor_name: 'string',
invoice_number: 'string',
total_amount: 'number',
due_date: 'date',
},
})
console.log(result.data, result.confidence?.fields)
console.log('document id:', result.document.id){
"extraction_id": "d1a2b3c4-5678-9abc-def0-1234567890ab",
"request_id": "req_x7y8z9a0b1c2d3e4",
"status": "complete",
"document": {
"id": "f0e1d2c3-b4a5-9687-8765-432109876543",
"filename": "invoice.pdf",
"pages": 2,
"type_detected": "Invoice",
"language_detected": "en"
},
"data": {
"vendor_name": "Acme GmbH",
"invoice_number": "INV-2025-0042",
"total_amount": 14250.00,
"due_date": "2025-04-15"
},
"confidence": {
"overall": 0.96,
"fields": { "vendor_name": 0.97, "invoice_number": 0.99, "total_amount": 0.94, "due_date": 0.99 }
},
"processing": { "duration_ms": 1840, "pages_processed": 2, "region": "eu-west" },
"links": {
"self": "/v1/extractions/d1a2b3c4-5678-9abc-def0-1234567890ab",
"document": "/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543"
}
}See the evidence. Read the document's claims with GET /v1/documents/{id}/claims?grounded=true, using document.id from the response. Each claim pairs a value with evidence, the verbatim quote from the document it rests on, and grounded: true when a located passage backs it. Field-level detail for one value, including where it sits on the page, is on Trust every value.
curl "https://api.talonic.com/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543/claims?grounded=true" \
-H "Authorization: Bearer $TALONIC_API_KEY"
# {
# "data": [
# { "subject": "Invoice INV-2025-0042", "predicate": "has_total_amount", "object": "14250.00",
# "qualifier": "EUR", "evidence": "Total due: EUR 14,250.00", "grounded": true, "confidence": 0.97 }
# ],
# "total": 1
# }Documents longer than five pages, or any request with options={"async": true}, return 202 Accepted with a poll_url. Poll GET /v1/documents/{id} until status is completed, then read GET /v1/documents/{id}/extractions, or subscribe to extraction.complete and skip polling (see Going headless). Always handle both 200 and 202.
Do it with an agent
Add the Talonic MCP server to your client, then ask in plain words. The agent calls talonic_extract and shows the fields with their confidence. On the hosted connector, a file that lives on your own computer goes up through talonic_request_upload, which hands you a one-time upload page. Setup per client: Install the MCP server.
{
"mcpServers": {
"talonic": {
"command": "npx",
"args": ["-y", "@talonic/mcp@latest"],
"env": { "TALONIC_API_KEY": "tlnc_your_key_here" }
}
}
}
// Then ask: "Extract the vendor, invoice number, total and due date from invoice.pdf
// and show me where each value is in the document."Limits and costs
- File size: up to 500 MB per file; lower caps apply on the Free and Pro tiers.
- Response mode: documents of 5 pages or fewer answer in the same request; longer ones answer with
202and apoll_url. - Cost: 100 credits per page read, plus 20 credits for each value Talonic fills by reading the document. Values Talonic already knows from your workspace are free. 1,000 credits = 1 EUR. Each synchronous response reports its own cost in
X-Talonic-Cost-Creditsand your remaining balance inX-Talonic-Balance-Credits. - Rate limits: a daily request quota per namespace, by tier. Every response carries
X-RateLimit-Limit,X-RateLimit-RemainingandX-RateLimit-Reset. - Retries: send an
Idempotency-Keyheader and a repeat of the same request within 24 hours returns the first result instead of extracting again.
Errors
Errors from POST /v1/extract
| Parameter | Type | Description |
|---|---|---|
| 400 missing_document | fix request | No `file`, `file_url` or `document_id`. Send exactly one. |
| 400 ambiguous_document | fix request | More than one document source. Send exactly one. |
| 400 unsupported_file_type | fix request | Accepted: PDF, PNG, JPG, TIFF, WEBP, DOCX, TXT, CSV. |
| 401 unauthorized | fix key | Missing, invalid or revoked API key. |
| 402 insufficient_credits | top up | Balance too low. Top up and resubmit the same request unchanged. |
| 413 FILE_TOO_LARGE | fix request | The file is above your tier's upload limit. |
| 422 extraction_failed | check input | No usable output. Check the document quality or the field definitions. |
| 429 rate_limited | retry later | Daily quota reached. Wait until `X-RateLimit-Reset`. |
Next
- Define what to extract: Specs: save the fields once and reuse them.
- Run a Spec and get results: process many documents into one table.
- Going headless: webhooks, the event feed and browser handoffs.
- POST /v1/extract reference: every option and response field.
Frequently asked questions
Do I need to define fields before my first extraction?+
schema and Talonic returns every field it finds in the document. Pass a schema when you want exactly your fields back, and save it as a Spec to reuse it.