Skip to main content

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 carries extract, read, write and operations, 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.
Set your key
export TALONIC_API_KEY="tlnc_..."

Do it in the app

  1. Open Sources and drop a file onto the upload area, or press Extract (Cmd+J / Ctrl+J) from any page.
  2. Pick a saved Spec, type the fields you want, or leave it empty to let Talonic list every field it finds.
  3. 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
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"}'
Node (@talonic/node)
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)
Response (200, document of 5 pages or fewer)
{
  "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.

Read the evidence for each 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.

MCP client config (local, API key)
{
  "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 202 and a poll_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-Credits and your remaining balance in X-Talonic-Balance-Credits.
  • Rate limits: a daily request quota per namespace, by tier. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset.
  • Retries: send an Idempotency-Key header and a repeat of the same request within 24 hours returns the first result instead of extracting again.

Errors

Errors from POST /v1/extract

ParameterTypeDescription
400 missing_documentfix requestNo `file`, `file_url` or `document_id`. Send exactly one.
400 ambiguous_documentfix requestMore than one document source. Send exactly one.
400 unsupported_file_typefix requestAccepted: PDF, PNG, JPG, TIFF, WEBP, DOCX, TXT, CSV.
401 unauthorizedfix keyMissing, invalid or revoked API key.
402 insufficient_creditstop upBalance too low. Top up and resubmit the same request unchanged.
413 FILE_TOO_LARGEfix requestThe file is above your tier's upload limit.
422 extraction_failedcheck inputNo usable output. Check the document quality or the field definitions.
429 rate_limitedretry laterDaily quota reached. Wait until `X-RateLimit-Reset`.

Next

Frequently asked questions

Do I need to define fields before my first extraction?+
No. Leave out 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.
Why did I get 202 instead of 200?+
Documents over five pages, or requests with async set to true, are processed in the background. Poll the returned poll_url until the status is completed, then read the extractions, or subscribe to the extraction.complete event.
How do I see where a value came from?+
Call GET /v1/documents/{id}/claims with grounded=true. Each claim carries the verbatim evidence quote from the document. In the app, click any value to see the highlighted passage on its page.