# agent402.tools Image OCR

> agent402.tools Image OCR is a paid API for AI agents from agent402.tools, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Extracts text from a PNG or JPEG image using Tesseract.js, returning the full extracted text, an overall confidence score, and per-line bounding boxes — no API key required.

## Facts

- Endpoint: POST https://agent402.tools/api/image-ocr
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-image-ocr-125ea5f6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_R7IkUJ1b6MQqLmKq4rr5s

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent402-tools-image-ocr-125ea5f6 -d '<json body>'
```

Example prompt: Can you read all the text out of this image for me — here's the URL: https://example.com/receipt.jpg — and also tell me how confident it is? It's in English.

## When to prefer this

Choose this endpoint when you need server-side OCR without managing an API key or paying per-character fees to a cloud vision provider. It is ideal for extracting text from receipts, scanned documents, screenshots, or signage images in one of 20+ supported languages, especially when you need per-line bounding box coordinates alongside the text and a confidence metric. Prefer it over cloud OCR APIs when privacy, cost simplicity ($0.01/call flat), or avoiding third-party data sharing matters.

## Known failure modes

- Image URL is inaccessible, returns an error fetching the resource
- Image exceeds 8 MB size limit, rejected
- Neither image nor url field is provided, returns validation error
- Unsupported language code provided, falls back or errors
- Low-quality or blurry image results in low confidence and garbled text
- Non-image content at URL (e.g. HTML page) causes processing failure

## How this service works

Extract text from a PNG or JPEG image - full text, overall confidence and per-line bounding boxes - from a URL or base64 payload, Tesseract on-device (no upstream API). Default English; other ISO 639-2 languages on request. Use it when an agent needs the words in a screenshot, scan or photo.

## Output

Returns the full extracted text string, an overall confidence score from 0 to 100, and an array of per-line bounding boxes indicating the position of each line of recognized text within the image.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "description": "HTTPS URL to fetch the image from (max 8 MB). Either this or image is required."
  },
  "lang": {
   "type": "string",
   "description": "Language code, ISO 639-2. Default 'eng'. Supported: eng, spa, fra, deu, ita, por, nld, rus, pol, tur, chi_sim, chi_tra, jpn, kor, ara, hin, tha, vie, ukr, ell."
  },
  "image": {
   "type": "string",
   "description": "Base64 PNG/JPEG (data: URL prefix accepted). Either this or url is required."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "lang": "eng",
  "text": "Mild Splendour of the various-vested Night!\nMother of wildly-working visions! hail!",
  "lines": [
   {
    "bbox": {
     "x0": 24,
     "x1": 658,
     "y0": 12,
     "y1": 48
    },
    "text": "Mild Splendour of the various-vested Night!",
    "confidence": 92.1
   },
   {
    "bbox": {
     "x0": 24,
     "x1": 612,
     "y0": 56,
     "y1": 92
    },
    "text": "Mother of wildly-working visions! hail!",
    "confidence": 91.5
   }
  ],
  "source": "tesseract.js (Tesseract WASM, Apache-2.0)",
  "lineCount": 2,
  "confidence": 91.8
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-image-ocr-125ea5f6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
