Process multiple documents in parallel with a single schema.
POSThttps://api.aitronos.com/v1/documents/extract/batch
files file[] required
Array of document files to process. Maximum 50 files per batch. Each file must be under 50 MB.
schema string required
JSON schema as string. All documents will be processed with the same schema.
organization_id string required
Your organization ID.
prompt string optional
Custom extraction instructions applied to all documents.
model string optional · Defaults to ftg-3.0
Model selection: ftg-3.0, gpt-4o, or gpt-4o-mini.
vision_model string optional · Defaults to gpt-5
Vision analysis model for processing images and PDFs. Used for OCR and visual understanding.
Returns a batch object with job IDs for each document. Use the job IDs to check individual extraction status.
import requests
import json
API_URL = "https://api.aitronos.com/v1/documents/extract/batch"
TOKEN = "your_bearer_token_here"
headers = {"Authorization": f"Bearer {TOKEN}"}
schema = {
"properties": {
"invoice_number": {"type": "string"},
"total_amount": {"type": "number"}
}
}
files = [
("files", open("invoice1.pdf", "rb")),
("files", open("invoice2.pdf", "rb")),
("files", open("invoice3.pdf", "rb"))
]
data = {
"schema": json.dumps(schema),
"organization_id": "org_abc123",
"model": "gpt-4o-mini"
}
response = requests.post(API_URL, headers=headers, files=files, data=data)
result = response.json()
if result['success']:
print(f"Batch submitted with {len(result['job_ids'])} jobs")
for job_id in result['job_ids']:
print(f"Job ID: {job_id}"){
"success": true,
"batch_id": "batch_abc123",
"job_ids": [
"job_abc123def456",
"job_def456ghi789",
"job_ghi789jkl012"
],
"total_documents": 3,
"created_at": "2024-12-16T10:30:00Z"
}