Ask questions about your documents
What you get
You get answers, not search results to read through: ask "Which invoices are overdue, and by how much?" and Talonic replies in plain text, with each claim citing the document and passage it came from. When you know what you are looking for, search finds any document, value or field in one box, and filters narrow your documents by the values Talonic extracted. This guide is for anyone who needs facts out of their documents, and for developers building that into their own tools.
Before you start
- Documents in your workspace. Answers and filters use what Talonic has read from them.
- Any role can ask and search. Answers respect what you are allowed to see, and asking never changes your data.
- For the API: a key with the
readscope. Asking costs credits, so the workspace needs a balance.
Do it in the app
- Ask: press
Cmd+I(Ctrl+Ion Windows) on any page, or use the question box on the home page. Opened from a document, the question already has that document in view. - Read the answer and click a citation to open the document with the cited passage highlighted. A check mark shows whether the claims held up on a second look; treat "issues" as a pointer to verify, not a verdict.
- Search: press
Cmd+K(Ctrl+K) and type an invoice number, a name, a field or a Spec. Results are grouped by documents, values, fields, Specs and sources. A value found in many documents opens the Documents list already filtered to it. - Filter: on Documents, type into the filter bar with
facet:value(for exampletype:Invoice,source:,tag:,batch:), or add a condition on an extracted field such as total amount greater than 10,000. Bookmark or save the view as a preset.
Do it with the API
POST /v1/ask takes a question and returns 202 with an ask_id at once. Poll GET /v1/ask/{id} about every 2 seconds (answers usually take 10 to 60 seconds) or stream GET /v1/ask/{id}/stream. Narrow the question with scope (document_ids, pipeline_id, data_product_id, document_type, source_id, tags, dates), keep a conversation going with conversation_id, and shape the reply with output_format. GET /v1/search?q= searches everything at once, and POST /v1/documents/filter returns documents matching field conditions (eq, neq, gt, gte, lt, lte, between, contains, is_empty, is_not_empty).
curl -s -X POST https://api.talonic.com/v1/ask \
-H "Authorization: Bearer $TALONIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "question": "Which invoices are overdue, and by how much?",
"scope": { "document_type": "Invoice" },
"output_format": { "instruction": "Answer as a table: invoice, due date, days overdue." } }'
# -> { "ask_id": "3fa85f64-...", "status": "processing", "poll_url": "/v1/ask/3fa85f64-...", ... }
curl -s https://api.talonic.com/v1/ask/$ASK_ID \
-H "Authorization: Bearer $TALONIC_API_KEY"import { Talonic } from '@talonic/node';
const talonic = new Talonic({ apiKey: process.env.TALONIC_API_KEY });
const hits = await talonic.search('Acme Corp', { limit: 10 });
console.log(hits.documents, hits.fieldMatches);
const invoices = await talonic.documents.filter({
conditions: [
{ fieldId: vendorFieldId, operator: 'eq', value: 'Acme Corp' },
{ fieldId: dateFieldId, operator: 'between', value: '2026-01-01', valueTo: '2026-12-31' },
],
limit: 50,
});
console.log(invoices.total);{
"ask_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "completed",
"conversation_id": "8c4f2a1e-0b6d-4e2f-9a3c-5d7e1f2a3b4c",
"answer": "Two invoices are overdue: [INV-1041](https://app.talonic.com/documents/1b6f...?cite=due_date) by 12 days and INV-1055 by 3 days.",
"citations": [
{ "quote": "INV-1041", "document_id": "1b6f2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
"kind": "field", "reference": "due_date", "filename": "invoice-1041.pdf",
"app_url": "https://app.talonic.com/documents/1b6f2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d?cite=due_date" }
],
"verification": { "verdict": "supported", "checks_total": 3, "checks_unsupported": 0 },
"usage": { "tokens": 18432, "credits_charged": 100 }
}A filter condition names a field by its ID; search results with a resolvedFieldId can be passed straight into a filter. Use GET /v1/search/autocomplete to find field IDs by name and GET /v1/search/field-values for the values a field holds, with counts.
Do it with an agent
Use talonic_ask for questions, talonic_search to find documents and values, and talonic_filter to list documents by field conditions. Ask, for example: "Using Talonic, which supplier contracts renew in the next 90 days? Cite the clause for each."
Limits and costs
- Each accepted question costs a flat 100 credits, charged once when it starts. Polling, streaming and retrying the same
ask_idnever charge again.usage.credits_chargedon the answer shows the charge. - Daily question limits by plan: free 200, individual 100, pro 5,000, enterprise unlimited. Polling counts as an ordinary read, not as a question. At most 20 streams can be open per workspace at once.
questionup to 20,000 characters;scope.document_idsup to 1,000 andscope.tagsup to 100. An emptydocument_idslist matches nothing.- Search and filter cost no credits. Filter pages hold up to 500 documents (default 50); search returns up to 20 results per group by default.
Errors
| Parameter | Type | Description |
|---|---|---|
| 400 | bad_request | Missing `question`, a scope over its limits, or a malformed filter body (condition without `fieldId` or `operator`, sort direction other than `asc`/`desc`). |
| 402 | insufficient_credits | The balance cannot cover one question. Nothing ran; the body carries `buy_credits_url`. Top up and ask again. |
| 403 | insufficient_scope | The key lacks the `read` scope. |
| 404 | not_found | No ask with this ID in your workspace. |
| 429 | rate_limit_exceeded | Daily question limit or stream ceiling reached. Retry after `Retry-After`, or fall back to polling. |
Next
- Trust every value: confidence and evidence.
- Route and organise documents: types and tags you can filter on.
- Ask API reference.