Browse the docsImage

Image

POSThttps://labs-api.petpooja.com/v1/chat/completions

Send the image as a base64 data URI inside an image_url content part, alongside a text part describing the output you want. The text part is what makes this endpoint OpenWorld - ask for JSON with seller, buyer and line items, and that is what you get back.

Request body

FieldTypeDescription
modelstringrequiredMust be chitragupta. Anything else returns 404 model_not_found.
messagesarrayrequiredRoles user and assistant only. A system message returns 422 system_message_not_allowed - the system prompt is owned server-side so behaviour stays consistent for every caller.
messages[].content[]arrayrequiredMix of text parts and image_url parts. Each image_url.url is a data URI: data:image/jpeg;base64,…. Up to 10 images per request.
max_tokensintegerOptional. Defaults to 40000, which is also the ceiling.
import base64, mimetypes
from openai import OpenAI

API_KEY  = "Your API Key"
BASE_URL = "https://labs-api.petpooja.com/v1/"
MODEL    = "chitragupta"

client = OpenAI(api_key=API_KEY, base_url=BASE_URL)

IMAGE_PATH = "<IMAGE_PATH>"

mime = mimetypes.guess_type(IMAGE_PATH)[0] or "image/jpeg"
img_b64 = base64.b64encode(open(IMAGE_PATH, "rb").read()).decode()
image_data_uri = f"data:{mime};base64,{img_b64}"

response = client.chat.completions.create(
  model=MODEL,
  messages=[{
    "role": "user",
    "content": [
      {"type": "text", "text": ""},
      {"type": "image_url", "image_url": {"url": image_data_uri}},
    ],
  }],
)
print(response)