Browse the docsQuickstart
Getting started
Quickstart
The Petpooja API extracts structured data from invoices, receipts and other documents. It is OpenAI-compatible: point any OpenAI SDK at our base URL, send an image or PDF, and read the result off a standard chat completion.
Contact us for an API key
Keys are issued by our team. Reach out and we will provision one for your workspace, along with the page volume you need.
Point your SDK at us
Set
base_urltohttps://labs-api.petpooja.com/v1and pass your key as theapi_key. Everything else stays the OpenAI SDK you already use.Send a document
Attach an image as an
image_urlpart or a PDF as afilepart, both base64 data URIs. The response is a standard chat completion.
https://labs-api.petpooja.com/v1 for OpenWorld, and https://labs-api.petpooja.com/v1/extract for Default. The path is what selects the endpoint - the model name never changes.
import os
from openai import OpenAI
API_KEY = "Your API Key"
BASE_URL = "https://labs-api.petpooja.com/v1" || "https://petpoojalabs-api.petpooja.com/v1/extract"
MODEL = "chitragupta"
client = OpenAI(api_key=API_KEY, base_url=BASE_URL)
r = client.chat.completions.create(
model="chitragupta",
messages=[{"role": "user", "content": "What can you extract from an invoice?"}],
)curl https://labs-api.petpooja.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "chitragupta",
"messages": [{"role": "user", "content": "What can you extract from an invoice?"}]
}'