Skip to content
Last updated

Extract structured data from images using AI-powered OCR and vision analysis.

POSThttps://api.aitronos.com/v1/vision/analyze-image

Request Body (multipart/form-data)

image_file file required

Image file to analyze. Supported formats: JPEG, PNG, GIF, BMP, TIFF. Max size: 50 MB.

schema string required

JSON schema as string defining the structure of data to extract.

organization_id string required

Organization ID (org_ prefixed string).

prompt string optional

Custom analysis instructions to guide the extraction process.

model string optional

Model to use. Values: gpt-4o (default), gpt-4o-mini.

provider string optional

Provider to use. Values: openai (default).

Returns

Returns extracted data matching your schema with confidence score and cost information.

Bash
curl -X POST "https://api.aitronos.com/v1/vision/analyze-image" \
  -H "X-API-Key: $FREDDY_API_KEY" \
  -F "image_file=@receipt.jpg" \
  -F 'schema={"properties":{"merchant":{"type":"string"},"total":{"type":"number"},"date":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"price":{"type":"number"}}}}}}' \
  -F "organization_id=org_abc123" \
  -F "model=gpt-4o"

Response:

{
  "success": true,
  "extracted_data": {
    "product_name": "Wireless Headphones",
    "price": 79.99,
    "brand": "AudioTech",
    "color": "Black"
  },
  "confidence": 0.92,
  "cost_chf": 0.018,
  "model_used": "gpt-4o",
  "provider": "openai"
}