Skip to main content

Error Handling

PROOF API uses standard HTTP status codes. Error responses include a detail field with a human-readable message.

Error codes​

StatusMeaningAction
400Bad request — invalid file type, missing fieldsCheck request format
401Invalid or missing API keyVerify your API key
402Insufficient creditsPurchase more credits at /payment
403Forbidden — missing scope or not a developerCheck key scopes
404Job or resource not foundVerify the job ID
413File too large or too many pagesReduce file size or split PDF
429Rate limit exceededWait and retry after Retry-After header
502Downstream processing errorRetry with exponential backoff

Error response format​

{
"detail": "Insufficient credits"
}

Retry strategy​

For 429 and 502 errors, use exponential backoff:

import time
import requests

def retry_request(url, max_retries=3):
for attempt in range(max_retries):
resp = requests.get(url, headers=HEADERS)
if resp.status_code == 429:
wait = int(resp.headers.get("Retry-After", 5))
time.sleep(wait)
continue
if resp.status_code == 502 and attempt < max_retries - 1:
time.sleep(2 ** attempt)
continue
return resp
return resp

Job errors​

When a job fails, GET /jobs/{id} returns:

{
"job_id": "job-abc123",
"status": "error",
"error_log": "LLM inference timeout after 120s"
}

Common job errors:

  • LLM inference timeout — model took too long, try again or reduce page count
  • Unsupported file format — check supported formats
  • Storage upload failed — transient infrastructure error, retry
  • Insufficient credits — caught at confirm step, purchase more at /payment