All demosReceipt Reader

Receipt Reader

A receipt photo becomes a structured record.

Examples are free. Bring a key for your own inputs. Get a free key

Performance & cost

This session

Ready to run
Delivery time · median
Live model compute
Live input tokens
0
Est. cost · USD
$0.00

Free examples. Switch on to measure live inference with your key and quota.

Measurement details · 0 successful requests
Successful requests
0

Run an example for free to see its measurements.

Model compute is the average per measured request. Delivery time is the median browser time for successful requests, including queue, network, and retries. Cached delivery speed is not inference speed. Model compute can exceed browser time when one request processes many inputs.

Tokens come from response headers. Inference costs use $0.04 per million input tokens, before plan credits. The estimate includes live and recorded tokens at the same rate; cached examples are not charged again. Missing usage is unavailable or a partial total (≥). Demo resets keep these totals; reload to start a new session.

Try it

Run the receipt, or drop in your own image.

Build with the SDKTypeScript · Python · dm1

One request from this demo. Copy it into your app.

Uses your MS_API_KEY and quota. Keep the key on your server.

Install · set your key
npm install @cloudraker/milliseconds
export MS_API_KEY="your-api-key"
example.ts
import { readFile } from "node:fs/promises";
import { DecisionMachine } from "@cloudraker/milliseconds";

// Run on your server; reads MS_API_KEY from the environment.
// The image carries the input; the leading text is optional context.
const dm = new DecisionMachine();

const { result, usage } = await dm.extract(
  await readFile("image.png"),
  {
    "type": "object",
    "title": "receipt",
    "description": "A printed receipt. Copy every amount exactly as printed and leave a field empty when it is not on the receipt.",
    "properties": {
      "merchant": {
        "type": "string",
        "description": "business name printed at the top of the receipt"
      },
      "date": {
        "type": "string",
        "description": "date of purchase as printed"
      },
      "total": {
        "type": "number",
        "description": "final total amount paid"
      },
      "items": {
        "type": "array",
        "description": "line items purchased, in printed order",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "item name as printed"
            },
            "price": {
              "type": "number",
              "description": "price charged for this line"
            }
          }
        }
      }
    }
  },
  { detail: "medium" }
).withUsage();

console.log(result);
console.log({ inputTokens: usage.inputTokens, modelMs: usage.inferenceMs });

Under the hood How it works & limitations

API calls/extract

From a photo to a checked record

One extract call sends the image and a JSON Schema. The response returns the record, shaped by that schema. Nothing is parsed to text first: the model reads the pixels, so layout stays available.

Keep a person in the loop

An extracted value is a reading, not a proof. Amounts, dates and item names still need review before they reach a ledger. Runs use real model responses, with cached or live provenance shown in Performance & cost.

This demo sends one image of at most 5 MB as JPEG, PNG or WebP. It does not accept image URLs, PDFs, multi-page documents or batches of images. Images are processed in memory, never written to disk and never logged.