POST /v1/ask
POST /v1/ask asks a natural-language question over every document in your workspace and returns a cited, checked answer. 100 credits per question, flat.
POST /v1/ask answers a natural-language question from your own documents. You get back a markdown answer in which every load-bearing claim cites the document and passage it came from, plus a verdict on whether the answer holds up against those sources. It is for developers and agents who want answers over a document corpus without building and running their own search stack.
Only one field is required: question, up to 20,000 characters. The optional fields narrow, shape, or thread the turn: scope restricts it to a slice of the workspace as a hard filter, conversation_id continues a thread, model and model_class pick a processing option allowed by your AI policy, output_format shapes the answer, and on_behalf_of applies a named user's visibility. All of them are covered in Scope, Models & Access. The endpoint answers 202 Accepted immediately with an ask_id, a poll_url, a stream_url, and the conversation_id the turn threads into. Collect the answer with GET /v1/ask/:id or stream it with GET /v1/ask/:id/stream. A turn typically takes 10 to 60 seconds, which is why the endpoint is asynchronous. Authenticate with a workspace-scoped tlnc_ Bearer key that has the read scope; asks are isolated per workspace.
What an answer gives you
Every document you ingest with ingestion_target: "ingest" (the default on POST /v1/run) is askable, and a question runs over the whole workspace, not a sample of it. Questions about a single value ("what is the notice period in the Globex agreement?"), comparisons across documents ("which suppliers raised prices this year?") and counts or totals ("how many of our contracts auto-renew?") all work, because Talonic answers from the values it already read out of each document as well as from the document text.
Answers are grounded and checkable. Each claim links to its source document and passage, a negative answer ("no agreement contains an exclusivity clause") states how many documents it covered, and the completed response includes a verification verdict saying whether the claims match the cited evidence. See Citations & Verification for how to use both.
/v1/askRequest body (JSON)
curl
curl -s -X POST https://api.talonic.com/v1/ask \
-H "Authorization: Bearer $TALONIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"question": "Which of our agreements auto-renew, and what notice period does each one require?"}'Node (fetch)
const res = await fetch('https://api.talonic.com/v1/ask', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
question: 'Which of our agreements auto-renew, and what notice period does each one require?',
}),
});
const { ask_id, poll_url, stream_url, conversation_id } = await res.json();Response (202)
{
"ask_id": "7c2f0a4e-9d31-4b8a-b3e6-2f1c5d9a8e07",
"status": "processing",
"poll_url": "/v1/ask/7c2f0a4e-9d31-4b8a-b3e6-2f1c5d9a8e07",
"stream_url": "/v1/ask/7c2f0a4e-9d31-4b8a-b3e6-2f1c5d9a8e07/stream",
"conversation_id": "8c4f2a1e-0b6d-4e2f-9a3c-5d7e1f2a3b4c"
}Conversations
Every ask belongs to a conversation. Pass conversation_id to continue a thread, and follow-ups like "and only the ones above 50,000 EUR?" are answered in the context of the earlier turns. Omit it and Talonic creates a fresh conversation, returning its id on the 202, so the first ask of a session already gives you the handle for the next one. Conversations are listed, read, renamed and deleted through the Conversations endpoints.
Pricing
Each accepted ask charges one flat agent_ask unit: 100 credits, or 0.10 EUR (1,000 credits = 1 EUR). The charge is taken when the ask is accepted and is keyed to the turn, so a network retry of the same submission, or polling and streaming the result any number of times, never bills twice. A question over 10 documents and a question over 10,000 cost the same. The completed response reports the charge in usage.credits_charged, and the full catalog is public at GET /v1/pricing.
When your balance cannot cover one unit, the ask is rejected up front with 402 insufficient_credits before any work starts. The 402 body names the unit, the shortfall and a buy_credits_url, so an automated integration can top up and resubmit without a person reading the error.
Rate limits
Ask submissions are counted in their own daily rate-limit namespace, ask, separate from extraction and platform reads. Polling GET /v1/ask/:id counts against the general read namespace, never the ask budget. Stream connects are counted in the separate ask_stream namespace, sized above ask to leave room for reconnects, and direct tool invocations in agent_tools; see Streaming and Invoke a Tool.
Daily ask caps by plan
Getting a key and documents to ask
If your workspace already has documents, any read-scoped key works immediately. A new self-serve workspace starts with two example documents, a Northwind invoice and an Acme/Globex master services agreement, so your first POST /v1/ask has something real to answer against; see the Quickstart. To make your own documents askable, ingest them via POST /v1/run with the default ingestion_target: "ingest".
Errors
Error responses