Error Response Format
All errors follow a consistent JSON format:HTTP Status Codes
Error Types
400 Bad Request
Returned when the request is malformed or contains invalid data.Invalid File Type
Invalid File Type
.pdf or .docx file.File Too Large
File Too Large
Empty File
Empty File
Invalid Schema
Invalid Schema
Missing File
Missing File
file field in your multipart form data.Missing Schema
Missing Schema
output_schema field in your request.401 Unauthorized
Authentication failed.- Missing
Authorizationheader - Incorrect API key
- Typo in the Bearer token format
- Using an expired or revoked key
Authorization: Bearer pk_your_key.
403 Forbidden
Origin not allowed (playground endpoint only)./v1/extract.
429 Too Many Requests
Rate limit exceeded.500 Server Error
An unexpected error occurred during processing.- Corrupted document
- Document format not actually PDF/DOCX
- Encrypted or password-protected file
- Temporary service issues
SDK Error Handling
Python
JavaScript/TypeScript
Extraction-Level Errors
Even when the HTTP request succeeds (200), the extraction itself might fail. These errors are returned in the response:Error Codes
When extraction fails, you’re still charged credits for the processing attempt. The
metadata field shows resource usage.Best Practices
Always Check Errors
Check both HTTP errors (try/catch) and extraction errors (response.error).
Implement Retries
Use exponential backoff for 429 and 500 errors.
Log Errors
Log error details for debugging. Include the document name and schema.
Validate Inputs
Check file type and size before sending to avoid 400 errors.
