Image to Text (OCR)
Read text from an image, including screenshots and document photos. Returns extracted text, a confidence estimate and detected language.
image-to-text Example
{
"text": "",
"text_type": null,
"confidence": "high",
"language_detected": null
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
base64 | string | No | Base64-encoded image |
image_url | string | No | URL to image |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
text | string | Always (present in every successful answer) |
text_type | string | Always (present in every successful answer) |
confidence | string | Always (present in every successful answer) |
language_detected | string | Always (present in every successful answer) |
How to call it
The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.
# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "image-to-text",
"inputs": {
"image_url": "https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg"
},
"max_price_cents": 5
}' {
"tool": "strale_execute",
"arguments": {
"slug": "image-to-text",
"inputs": {
"image_url": "https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg"
},
"max_price_cents": 5
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "image-to-text",
inputs: {
"image_url": "https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg"
},
max_price_cents: 5,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="image-to-text",
inputs={
"image_url": "https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg",
},
max_price_cents=5,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i 'https://api.strale.io/x402/v2/image-to-text?image_url=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fa%2Fa9%2FExample.jpg' Limitations
Handwriting and complex layouts reduce OCR accuracy
AI-powered OCR — handwritten text, low-resolution images, and complex layouts (multi-column, overlapping) have lower accuracy
What to do instead: Pre-process images to improve contrast and resolution before submission for better OCR results
Input images are limited to 4 MiB decoded
Images supplied by URL or base64 are refused above 4 MiB of decoded data, with a caller_input error naming the input field and no charge. Resize or compress the image before submitting.
Related tools
- HTML to PDF €0.10
- Image Resize €0.03
- Markdown to HTML €0.02
- Scanned Document OCR €0.10
- URL to Base64 €0.02