PDF.chat API

Upload a PDF and chat with it from your own app — ask questions and get answers cited to the page, in 100+ languages. Metered per page, no surprises.

Incamake

The PDF.chat API is a small REST interface. First you POST A Inyandiko Kuri na Kubona Inyuma A Na: i Umwandiko na A - Ipaji: (Umwandiko, Akazu,). POST na Kubona in i Inyandiko, i Ipaji: Kuva:. Bya 5 Amapaji Cyangwa Gusubiramo Inzira% s; Gusubiramo Na: A pending Imimerere done.

  • URL: https://pdf.chat
  • Inyandiko zisanzwe Umwandiko na Ishusho
  • Chat out: Na: Ipaji:; i Urutonde Impera Akadomo
  • Umwandiko Inyuma: txt, md, docx, pdf, csv, json
  • Amashanyarazi cpu (Byoroheje, Byacapwe Inyandiko na vlm (, Imigaragarire, Imigaragarire, Imibare)

Igaragazambere ry'Inyandiko

Na: API (Gushaka ku Aderesi Ipaji) Nka A Umutwe:

Authorization: Bearer YOUR_API_TOKEN

Gushyiraho ?api_token=… Nka A Ikibazo: Igenamiterere. ni Ipaji: Konti:.

a Inyandiko

POST /api/v1/ocr/, Ifishi% S: Itangira.

curl -X POST https://pdf.chat/api/v1/ocr/ \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "file=@invoice.pdf" \
  -F "tier=vlm" \
  -F "language=auto"

i. - Ipaji: Idosiye ni done Na: i Umwandiko; Idosiye Inyuma pending/processing, i Imimerere Impera Akadomo.

{
  "uuid": "9f2c1b7e4a...",
  "status": "done",
  "tier": "vlm",
  "language": "auto",
  "page_count": 1,
  "mean_confidence": 0.98,
  "text": "INVOICE\nAcme Corp\nTotal: 215.00 USD",
  "markdown": "# INVOICE\n\n**Acme Corp** ...",
  "pages": [ { "index": 0, "text": "...", "blocks": [ { "text": "...", "bbox": [x0,y0,x1,y1], "confidence": 0.98 } ] } ]
}

Igisubizo

GET /api/v1/ocr/<uuid>/, Kuri status ni done Cyangwa failed.

curl https://pdf.chat/api/v1/ocr/9f2c1b7e4a.../ \
  -H "Authorization: Bearer YOUR_API_TOKEN"

a Imiterere

GET /api/v1/ocr/<uuid>/download/?format=md, Kohereza i Igisubizo. format ni Rimwe Bya txt, md, docx, pdf, csv, json.

curl -L "https://pdf.chat/api/v1/ocr/9f2c1b7e4a.../download/?format=docx" \
  -H "Authorization: Bearer YOUR_API_TOKEN" -o result.docx

Chat with a document

Ask questions about a finished job. Answers are grounded only in the extracted text and cite the source page. Requires an account token, the chat feature is account-gated.

POST /api/v1/chat/<uuid>/, Ibiro {"message": "your question"}.

curl -X POST https://pdf.chat/api/v1/chat/9f2c1b7e4a.../ \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"message": "What is the invoice total and due date?"}'

i & Ubutumwa Na: na A Urutonde Bya Amapaji:

{"conversation": "a1b2…", "message": {
   "role": "assistant",
   "content": "The total is $42, due on March 3 (p. 1).",
   "citations": [{"page": 1, "cited_text": "The invoice total is $42…", "document_id": "9f2c1b7e4a…"}]
}}

GET /api/v1/chat/<uuid>/history/, i Cyuzuye ya: A Ibikorwa:.

Urugero:

import requests, time

BASE = "https://pdf.chat/api/v1"
H = {"Authorization": "Bearer YOUR_API_TOKEN"}

# 1. Upload a PDF
with open("contract.pdf", "rb") as f:
    job = requests.post(BASE + "/ocr/", headers=H, files={"file": f}).json()

# 2. Wait until it's ready to chat
while job["status"] in ("pending", "processing"):
    time.sleep(2)
    job = requests.get(f"{BASE}/ocr/{job['uuid']}/", headers=H).json()

# 3. Ask questions — every answer is cited to the page
ans = requests.post(f"{BASE}/chat/{job['uuid']}/", headers=H,
    json={"message": "What is the termination notice period?"}).json()
print(ans["message"]["content"])
print(ans["message"]["citations"])
import fs from "fs";

const BASE = "https://pdf.chat/api/v1";
const H = { Authorization: "Bearer YOUR_API_TOKEN" };

// 1. Upload a PDF
const form = new FormData();
form.append("file", new Blob([fs.readFileSync("contract.pdf")]), "contract.pdf");
let job = await (await fetch(`${BASE}/ocr/`, { method: "POST", headers: H, body: form })).json();

// 2. Wait until it's ready to chat
while (["pending", "processing"].includes(job.status)) {
  await new Promise(r => setTimeout(r, 2000));
  job = await (await fetch(`${BASE}/ocr/${job.uuid}/`, { headers: H })).json();
}

// 3. Ask questions — every answer is cited to the page
const ans = await (await fetch(`${BASE}/chat/${job.uuid}/`, {
  method: "POST", headers: { ...H, "Content-Type": "application/json" },
  body: JSON.stringify({ message: "What is the termination notice period?" })
})).json();
console.log(ans.message.content, ans.message.citations);
# 1. Upload a PDF
curl -X POST https://pdf.chat/api/v1/ocr/ \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "file=@contract.pdf"

# 2. Ask questions (use the uuid from step 1) — answers cited to the page
curl -X POST https://pdf.chat/api/v1/chat/UUID/ \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"message": "What is the termination notice period?"}'

Ibigenga

UbusoUbwoko bw'agakandishoIsobanuramiterere
filefileBya ngombwa Ishusho Cyangwa Kuri
tierstringcpu ( Mburabuzi, Bihuta / Cyangwa vlm (: Imigaragarire, Imigaragarire, Imibare).
languagestringauto ( Mburabuzi) Cyangwa A Ururimi: Ikosa (en, ch, ja, ar,...
toolstringIbikoresho (& eg; summarize-pdf, ask-pdf) to pre-frame the chat for that task.

Amakosa na Imipaka

InyandikoporogaramuIsobanuramiterere
400IDOSIYE Ubwoko Cyangwa Idosiye
401Cyangwa Sibyo
402Bya Ipaji:, Ku munsi / Byarangiye Kigenga Impera:, Cyangwa Oya. used/cap.
404OYA Byabonetse
409Mbere i Ibikorwa:.

Ipaji: (1 / Ipaji: ku i Bihuta, Birenzeho ku). - Idosiye Ipaji: na & Ongera Ikintu. Itangira....

Ibibazo bizwa kenshi

a Konti: na Gufungura Aderesi Ipaji, ni Na: A Gukoporora Akabuto.

, Idosiye Bya 5 Amapaji Cyangwa Gusubiramo i Cyuzuye Igisubizo in i, Oya ni ya: Ishusho na Gitoya.

100, na. language=auto Kuri, Cyangwa A Inyandikoporogaramu.

Kuri Kuri na Cyasibwe mu buryo bwikora:. Nta na rimwe, Gusangiza, Cyangwa ku.

ni Ipaji: Konti:: Kubona A - & Ku munsi, Kigenga A, na Koresha Na: - Idosiye Ipaji: na Ibanga. Gukoresha Inyuma Kubona A Na: Byakoreshejwe na in i.

Kohereza, na Igikubo - Ipaji:. Iyimura Nka, MD, PDF (), CSV, Cyangwa Biturutse i Iyimura Imiterere Igenamiterere.

ni A Idosiye, Ubwoko:, Cyangwa Idosiye; A Cyangwa Sibyo; Inyuma Bya; Kitazwi; na A Iyimura Mbere i. Gushyiramo A Gitoya & Ubutumwa.

A Igikoresho Na: Imimerere, Ubwoko:,, na, i Cyuzuye Umwandiko na. Ipaji: Porogaramu Ipaji: Na: Umwandiko, Agasanduku (), na -.

CPU (i Mburabuzi) ya: Gihinguranya, Hasi: - Bya Byacapwe Inyandiko., i, ya:, Cyangwa Igikubo - Inkingi, Imibare, na Imisobanuro:, ni Birenzeho.

Pass tool with a slug (for example summarize-pdf or ask-pdf) to pre-frame the chat for that task, so the assistant is tuned to summarize or answer questions about the document.

Idosiye Bya 5 Amapaji Cyangwa Gusubiramo in i Idosiye Nka Cyangwa, na / / v1 / /<uuid>/ & Kugeza Imimerere ni Cyangwa. i - Idosiye Ipaji:.

ni Bisanzwe KURI, Kuva: Icyo ari cyo cyose Ururimi: Na: Umukiriya, i,, na Ingero hejuru. ni Oya Kuri Kwinjiza porogaramu; A Imirongo Bya Bisanzwe Inyandikoporogaramu Byose.