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

POST/v1/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.

Document
{
  "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
}
GET/v1/documents

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.

GET/v1/documents/{id}

A document, as above. Use it to wait for a document that came back processing.

DELETE/v1/documents/{id}

Deletes the document and everything made from it: {"object": "document", "id": "doc_…", "deleted": true}.

Search

POST/v1/documents/{id}/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).
Request
{
  "questions": ["What was capital expenditure in 2018?", "Who is the CEO?"],
  "top_k": 5
}
Response
{
  "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

GET/v1/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).

Response
{
  "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"}}
StatusCodeMeaning
401invalid_api_keyThe Authorization header is missing, or the key is not valid.
402insufficient_balanceYour credit is used up. Add credit in the console.
403storage_limit_reachedYou have the most pages stored you can keep. Delete documents, or wait for unused ones to expire.
404document_not_foundNo such document, or it was deleted.
409document_processingThe document is still being processed. Try again shortly.
410document_expiredThe document expired after going unsearched. Upload it again.
413file_too_largeThe file is over 100 MB.
415not_a_pdfThe file is not a PDF.
422invalid_requestA field is missing or invalid, such as more than 10 questions.
422document_failedThe document could not be read.
502model_unavailableThe model failed on every page. Try again.
500internal_errorSomething went wrong on our side. Try again.