FastHand Studio · Product

FastHand OCR

Reading a printed label shouldn't need a human or a cloud vendor. FastHand OCR turns a photo into its text: send an image, get back what is printed on it — labels, ID cards, documents, packaging, signs. One POST request, protected by your API key, answered from the edge.

Workers · Llama 3.2 11B Vision · TypeScript · MIT

What it does

Four properties that make it safe to ship

Each card states a fact from the product README, not a promise: this is what happens when your app calls the endpoint.

01

One request in, text out

No OCR SDK and no page to host: post the image, read the text. Built on Llama 3.2 11B Vision, which reads small and mixed-script print character-for-character.

@cf/meta/llama-3.2-11b-vision-instruct

02

Only key-holders get answers

Requests without your secret X-API-Key header are rejected before the model runs. Wrong keys are compared in constant time, so guessing reveals nothing.

X-API-Key · timing-safe compare

03

Runs at the edge

“Edge” means the code runs on Cloudflare's global network instead of a server you manage — answers come back fast from whichever location is closest to the caller, and the free tier covers the requests.

Cloudflare Workers

04

Bad input is refused cheaply

8 MB per request, 6 MB per decoded image, and strict base64 rules (base64: the image bytes written out as plain text so JSON can carry them) stop garbage before it costs anything.

8 MB · 6 MB · strict base64

  1. 1A photographed noticeSmall print, three type sizes, shot at an angle.
  2. 2Words are boxedThe endpoint finds each word region, even where the far end loses focus.
  3. 3JSON comes backThe full text plus a confidence score for each word.
Figure 1 — the claim, drawn: a notice photographed at an angle, small Cyrillic print at three sizes, the far end falling out of focus. Dashed boxes are the endpoint's word regions; the response card is what comes back.

See which scripts it reads →

Languages

Printed text in all major world scripts

The table is the model's supported-script list, taken from the README. Under it: the one condition that decides real-world accuracy.

Supported scripts and example text
Script / languageExample
English & other Latin scriptsEnglish, French, Spanish, German, Portuguese
Bengaliবাংলাদেশ
Arabicالعربية
Hindi & Devanagariहिन्दी
Chinese中文
Japanese日本語
Korean한국어
CyrillicРусский

Proof of the claim: verified against a real Bangladesh National ID card — the Bengali-English government header, holder and parents' names, date of birth and NID number all came back correct. Accuracy note: crisp, upright, well-lit images transcribe almost perfectly; blur, glare and heavily stylized text reduce accuracy, and handwriting is less reliable than print.

See how a request flows →

How it works

Five steps, all inside one Worker invocation

The diagram is the whole product — nothing runs outside these five stops. The numbered list repeats the same flow in words.

1 · Your appphoto → base64 text2 · Worker: authX-API-Key or 4013 · Worker: validation8 MB · 6 MB · base644 · Llama 3.2 11B Visionvia Workers AI5 · JSON replytext + words + confidence

Figure 2 — a request's full path. Auth and validation (2–3) run before any model time is spent.

  1. 1Your app sends the imageThe photo is converted to base64 text and put in a JSON body with your X-API-Key header.
  2. 2The Worker checks the keyThe key must match the secret you set with wrangler secret put. No key or wrong key: 401, and no model time is spent.
  3. 3The payload is validatedSize caps (8 MB request, 6 MB image) and strict base64 rules reject anything malformed with 413 or 400.
  4. 4Llama 3.2 11B Vision reads the imageWorkers AI — Cloudflare's built-in machine-learning models — transcribes the printed text character-for-character.
  5. 5You get JSON backThe full transcription plus a per-word list with confidence scores, ready to render or store.

Read the API reference →

How to use it

One endpoint: POST /

Four blocks, in reading order: how to call it, what to send, what success looks like, and every way the API says no. All names are placeholders — never put a real key in client-side code.

request · cURL
curl -X POST https://YOUR-DOMAIN.workers.dev/ \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{"image": "<base64-encoded-image>"}'

Replace YOUR-DOMAIN and YOUR_API_KEY with your Worker's domain and your secret.

request · JSON body
{
  "image": "<base64-encoded JPEG, PNG or WebP>"
}

image takes a base64-encoded picture (the image bytes written as plain text, so JSON can carry them). JPEG, PNG, WebP; a data:image/…;base64, prefix is stripped automatically. Max 8 MB per request, 6 MB per decoded image.

response · 200 OK
{
  "success": true,
  "text": "Government of the People's Republic of Bangladesh\nNational ID Card\n...",
  "words": [
    { "text": "Government", "confidence": 0.85 },
    { "text": "National", "confidence": 0.85 }
  ]
}

text is the full transcription; words carries each word with a confidence score — Workers AI exposes no real scores, so each one defaults to 0.85.

response · every failure, with its cause

Error responses and their causes
StatusCause
401Missing or invalid X-API-Key
400Missing or invalid image field, or bad base64
413Body over 8 MB, or decoded image over 6 MB
405Any method other than POST
500Model or processing failure

Get the code →

How to get it

You deploy this yourself — that's the whole point

FastHand OCR is not a hosted service. Clone the repository, set one secret with Wrangler (Cloudflare's command-line deploy tool), and the API is live on your own workers.dev domain.

https://github.com/FastHand-Studio/Fasthand-ocr

Everyone calling your worker uses the same API_KEY value. Rotate it whenever you like — another wrangler secret put with a new value, no code change.

deploy · three commands
wrangler login
echo "put-a-strong-random-key-here" | wrangler secret put API_KEY
npm run deploy

Needs Node 18+ and a Cloudflare account with Workers and Workers AI enabled. The key lives as a Cloudflare secret, never in the repo.

Stack and licence →

Stack and licence

One Worker, one model, MIT licensed

What the service is made of, and what it costs to run — both quoted from the README.

Runtime
Cloudflare Workers
Language
TypeScript
Model
Llama 3.2 11B Vision (@cf/meta/llama-3.2-11b-vision-instruct)
Licence
MIT

Pricing, small print
Estimate: about $0.13 per 1,000 scans. The Workers AI free daily allowance (10,000 neurons, roughly $5 of model usage) covers approximately 30,000–40,000 scans a day before anything is billed; exact numbers depend on image size and text density. Full breakdown in the README pricing section.

Browse all FastHand products →