Reference
API reference
The base URL is https://api.search.pageindex.ai/v1. Requests and responses are JSON, except uploads.
Authentication
Send your API key as a bearer token. Keys start with pis_live_; create them in the console.
Authorization: Bearer pis_live_...Documents
Upload a PDF as the form field file (multipart). Waits up to wait seconds (query, 0–60, default 10) for the document to be ready: 200 with a ready document, or 202 while it is still processing. Uploading a file you already have returns that document with "duplicate": true.
{
"object": "document",
"id": "doc_60a07bcef3094b68806070f2",
"filename": "report.pdf",
"status": "ready", // "processing", "ready" or "failed"
"pages": 160, // null while processing
"image_pages": 0, // pages also read from their image
"bytes": 1252586,
"created_at": "2026-10-26T06:52:57Z",
"expires_at": "2026-11-25T06:52:57Z",
"duplicate": false // on uploads: true when you had this file already
}Your documents, newest first: {"object": "list", "data": [documents], "has_more": false}. Query: limit (1–100, default 20) and after, the last id of the previous page.
A document, as above. Use it to wait for a document that came back processing.
Deletes the document and everything made from it: {"object": "document", "id": "doc_…", "deleted": true}.
Search
Judges every page against your questions. If the document is still processing, the call waits for it, up to a minute.
questions: 1 to 10 strings.top_k(optional, 1–1,000): list exactly this many pages a question, the most relevant. Without it, each question lists the pages likely to help, and at least 3 (every page, for a shorter document).
{
"questions": ["What was capital expenditure in 2018?", "Who is the CEO?"],
"top_k": 5
}{
"object": "search",
"id": "srch_51b0c2…",
"document_id": "doc_60a07bcef3094b68806070f2",
"results": [
{
"question": "What was capital expenditure in 2018?",
"pages": [{"page": 39, "relevance": 0.98}, {"page": 126, "relevance": 0.96}, …]
}
],
"failed_pages": [],
"usage": {"pages": 160, "questions": 2, "billable_pages": 160, "cost_usd": 0.112, "balance_usd": 4.888},
"seconds": 0.88
}failed_pages lists pages the model could not judge; they are not charged. usage.cost_usd is what the search cost and usage.balance_usd the credit left after it.
Usage
Uploads, searches and cost a day (UTC), your credit, and the pages you have stored. Query: start and end (dates, both included; default the last 30 days, at most a year).
{
"object": "usage",
"start": "2026-09-27",
"end": "2026-10-26",
"data": [
{"date": "2026-10-26", "uploads": 1, "pages_uploaded": 160, "searches": 3, "questions": 6,
"billable_pages": 480, "cost_usd": 0.336}
],
"total": {"uploads": 1, "pages_uploaded": 160, "searches": 3, "questions": 6, "billable_pages": 480, "cost_usd": 0.336},
"balance_usd": 4.664,
"storage": {"stored_pages": 160, "free_pages": 100000}
}Errors
Errors have one shape. Every response carries an X-Request-Id header; include it when you contact us.
{"error": {"code": "insufficient_balance", "message": "Your balance is used up. …", "request_id": "req_b4bde006eba94b069cec"}}| Status | Code | Meaning |
|---|---|---|
| 401 | invalid_api_key | The Authorization header is missing, or the key is not valid. |
| 402 | insufficient_balance | Your credit is used up. Add credit in the console. |
| 403 | storage_limit_reached | You have the most pages stored you can keep. Delete documents, or wait for unused ones to expire. |
| 404 | document_not_found | No such document, or it was deleted. |
| 409 | document_processing | The document is still being processed. Try again shortly. |
| 410 | document_expired | The document expired after going unsearched. Upload it again. |
| 413 | file_too_large | The file is over 100 MB. |
| 415 | not_a_pdf | The file is not a PDF. |
| 422 | invalid_request | A field is missing or invalid, such as more than 10 questions. |
| 422 | document_failed | The document could not be read. |
| 502 | model_unavailable | The model failed on every page. Try again. |
| 500 | internal_error | Something went wrong on our side. Try again. |