API Overview

Shared concepts across all Developer API endpoints — error codes, rate limits, billing, idempotency, and input formats.

Base URL

https://image-to-text.org/api/v1

All endpoints are synchronous — results are returned in the same HTTP response.

Authentication

Every request must include an API key. See Getting Started for setup.

Authorization: Bearer YOUR_API_KEY

or:

x-api-key: YOUR_API_KEY

Requests without a valid key receive 401 Unauthorized. Keys must have the correct scope for the endpoint (e.g., ocr scope for OCR endpoints, image scope for image processing endpoints).

Request ID

Every response includes a request_id — a unique identifier for that request. Include it when contacting support. It also appears in your API request logs for billing and debugging.

Error Codes

All errors follow a consistent contract:

StatusCodeRetryableMeaning
401unauthorizedNoMissing, invalid, or disabled API key
402credits_insufficientNoNot enough processing credits
400file_errorNoNo input, multiple inputs, or invalid input format
409idempotency_conflictNoReused idempotency key with different input
413limit_exceededNoFile too large or too many pages
415invalid_inputNoUnsupported image format
422empty_resultNoNo readable text found in the file
429rate_limitedYesToo many requests — retry after the specified seconds
429limit_exceededNoDaily request limit reached
500config_errorNoService not configured
502network_errorYesUnable to reach the processing provider
504upstream_timeoutYesProvider timed out — retry

Retryable errors are safe to retry. Use exponential backoff (start at 1s, double each retry, max 3 retries).

Rate Limits

Per-key rate limits apply separately to OCR and Image Processing scopes:

  • Minimum interval between requests (configurable, default ~5s)
  • Daily request limit — separate limits for free and paid-tier users

When rate-limited, the response includes a Retry-After header with the seconds to wait.

Billing

Requests are billed in Processing Credits:

EndpointCost Basis
OCR (Simple mode)1 credit per page
OCR (Formatted mode)10 credits per page
Image ConvertBased on pixel workload
Image CompressBased on pixel workload

Credits are deducted only after successful processing. Failed requests are not charged.

Idempotency

For billable endpoints, include an Idempotency-Key header to prevent duplicate charges on retry:

Idempotency-Key: <alphanumeric string, max 191 chars>
  • Keys are scoped to your API key and valid for 24 hours
  • Same key + same input → returns the cached result without charging again
  • Same key + different input → 409 idempotency_conflict error
  • Recommended format: {operation}-{timestamp}-{unique_suffix}

Input Formats

OCR

FormatFile ExtensionNotes
JPEG.jpg, .jpeg
PNG.png
GIF.gif
WebP.webp
BMP.bmp
TIFF.tif, .tiffSingle-image only
PDF.pdfUp to 20MB

Image Processing

Input formats: JPEG, PNG, WebP, AVIF, GIF, TIFF (static)
Output formats: JPEG, PNG, WebP, AVIF

Multiple Input Sources

Every endpoint accepts three ways to provide your source file:

SourceContent-TypeField
File uploadmultipart/form-datafile
Public URLmultipart/form-data or application/jsonimage_url
Base64multipart/form-data or application/jsonbase64 + mime_type

Remote URLs must be publicly accessible. Private, local, link-local, and cloud metadata addresses are blocked.