Browse the docsEndpoint overview

Endpoint overview

Both endpoints run chitragupta and speak the same OpenAI wire format. They differ in who writes the prompt and how many model calls your document turns into.

OpenWorld
POST /v1/chat/completions
  • Ask for anything - JSON, a summary, or a single field.
  • Every page and image goes into one model call, so the model reasons across the whole document at once.
  • Response is based on what you asked for in the input (prompt and image).
  • Up to 10 pages or images per request.
Default
POST /v1/extract/chat/completions
  • Your text is ignored - the extraction prompt is fixed server-side and cannot be overridden.
  • Each image and each PDF page becomes its own model call, run concurrently.
  • Results come back source-tagged per page - pdf1_page1, image1.
  • Up to 25 pages or images per request.

Which one do I want?

Use OpenWorld for generic question-and-answer over a document. Use Default for extraction.

# OpenWorld — generic question and answer over a document.
BASE_URL = "https://labs-api.petpooja.com/v1/"

# Default — extraction with a fixed prompt, one call per page.
BASE_URL = "https://labs-api.petpooja.com/v1/extract"