Chat with a PDF
A 90-page equipment manual has the answer on page 47; ask your question and get it straight from the file, with the passage attached, instead of reading the table of contents. Answers stay inside your PDF. Pay per use, no subscription.
Run it online
Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.
A 200-page contract, manual or report is easier to interrogate than to read cover to cover.
Why searching inside a PDF often disappoints
The PDF format was designed in the early 1990s to make a document look identical on any printer or screen. It is a fixed, portable layout, not a text source built for questions. That is why searching inside a long PDF so often fails: the search matches literal words, not meaning, and misses the passage that answers you in different phrasing. Asking the document a question works differently. It looks for the passages that match what you actually mean, then writes an answer only from them and shows you where they are, so you can jump to the right page.
When to use it, and what it will not do
It suits anyone who keeps returning to the same long document: staff asking the employee handbook how much parental leave they get, a procurement team checking whether a signed contract has a specific liability clause, or a student asking a research paper to explain its method in plain terms. The answer only reflects what is written in the PDF you send. It will not invent a clause that is not there or answer about a document you did not include, so a missing answer usually means the file does not cover the question.
PDF was never meant to be searched this way
The format was designed in the early 1990s to make a document look identical on any printer or screen — a fixed, portable layout, not a structured, queryable text source. That's exactly why free-text search inside a long PDF is so often disappointing: it matches literal words, not meaning, and misses a passage that answers your question using different phrasing. Retrieval-based question answering sidesteps that by understanding what the question is really asking, not just which words appear on the page.
Where the boundaries are
The answer only reflects what's actually written in the PDF you send — it won't invent a clause that isn't there or answer questions about a different document you didn't include. That constraint is deliberate: an answer confined to the source material is one you can trust enough to act on, which is the entire point of asking a document a question instead of guessing.
What you can do with it
Employee handbook lookup
An HR team lets staff ask the employee handbook a direct question — like how much parental leave they're entitled to — instead of searching a long PDF manually.
Contract clause lookup
A procurement team asks a signed vendor contract whether a specific liability clause exists, without re-reading the whole document.
Research paper Q&A
A student asks a lengthy research paper to explain its methodology in plain terms, cited to the exact section it came from.
FAQ
Does it work on scanned PDFs or only text PDFs?
It works on PDFs where the text content can be extracted; a heavily scanned image-only PDF should be processed with OCR first for reliable answers.
Can I ask multiple questions about the same PDF?
Yes, send a separate request per question; each one runs independently and returns its own cited answer.
How accurate are the answers?
Answers are grounded in the passages retrieved from your PDF and cited to them, so you can check any claim directly against the source page.
Is my PDF stored after I get an answer?
No, uploaded PDFs and results are deleted after the retention window and never used for training.
How do I know where in the PDF the answer came from?
Each answer comes with the passage it was drawn from, so you can jump straight to the relevant page instead of taking the answer on faith.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/rag/chat-pdf \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"pdf":"https://ejemplo.com/documento.pdf","query":"¿Cuánto dura la garantía?"}'const res = await fetch("https://api.kit.forhosting.com/rag/chat-pdf", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"pdf": "https://ejemplo.com/documento.pdf",
"query": "¿Cuánto dura la garantía?"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/rag/chat-pdf",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"pdf": "https://ejemplo.com/documento.pdf",
"query": "¿Cuánto dura la garantía?"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/rag/chat-pdf", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"pdf":"https://ejemplo.com/documento.pdf","query":"¿Cuánto dura la garantía?"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"pdf":"https://ejemplo.com/documento.pdf","query":"¿Cuánto dura la garantía?"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/rag/chat-pdf", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"pdf": "https://ejemplo.com/documento.pdf",
"query": "¿Cuánto dura la garantía?"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "rag.chat_pdf",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_chunks | 10000 |
max_tokens | 20000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
422 | task_failed | The task failed after 3 retries. You are never charged for it. |
Technical notes
This endpoint turns a PDF into something you can ask a question and get back an answer grounded in that exact file, with the passage it came from attached.
Reading isn't always the point, finding is
Nobody opens a 90-page equipment manual because they enjoy reading it; they open it because a machine is making a noise and page 47 has the answer. rag.chat_pdf is built for that moment: point it at the document, ask the actual question, and skip the table of contents entirely. It works as well on a single contract as it does on a lengthy technical spec — the document defines the boundaries of what it will and won't answer.
The request and what you get back
The response pairs the answer with the passage in the PDF it was drawn from, so the person reading it can jump straight to the relevant page instead of taking the answer on faith. POST /rag/chat-pdf with the PDF and a question, and the task runs asynchronously — a task_id comes back immediately, and the answer follows through a signed webhook call or a signed link that stays live for 24 hours.
Where it fits in a document workflow
Teams that field the same handful of questions against the same document over and over — a policy, a manual, a signed agreement — stop re-reading it from scratch each time and instead ask it directly.
Integration use cases
Technical manual troubleshooting
A field technician asks an equipment manual what an error code means and gets the exact procedure from the relevant page.
Technical questions
How do I chat with a PDF using the API?
POST the PDF file and your question to /rag/chat-pdf, and collect the cited answer by webhook or a signed link valid for 24 hours.
Is the chat with PDF API free?
No, there's no free tier or trial; it costs $0.003 per request plus $0.015 per query, and a failed task is never billed.
Can I chat with very long PDFs?
Yes, the endpoint retrieves the relevant passages from within the document regardless of its overall length before generating the answer.
Is this endpoint live?
Yes, /rag/chat-pdf is live and ready for production traffic.