All demosInvoice Desk

Invoice Desk

Invoice in. Fields out. Catch the totals that don’t add up.

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

Bypass examples to measure live inference. Uses your 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

Pick an invoice and hit Process invoice.

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 { DecisionMachine } from "@cloudraker/milliseconds";

// Run on your server; reads MS_API_KEY from the environment.
const dm = new DecisionMachine();

const { result, usage } = await dm.extract(
  "INVOICE\n\nInvoice number: NB-1042\nVendor: Northstar Studio\nBilled to: Harbor Works\nInvoice date: 2026-09-12\nPurchase order: PO-208\nCurrency: USD\nSubtotal: 2400.00\nTax: 120.00\nTotal due: 2520.00\nPayment terms: Net 30\n\nServices: Brand identity design\nThank you for your business.",
  {
    "type": "object",
    "title": "invoice headers",
    "properties": {
      "invoice_number": {
        "type": "string",
        "description": "invoice number printed on this invoice"
      },
      "vendor": {
        "type": "string",
        "description": "supplier or vendor issuing this invoice, not the company billed"
      },
      "customer": {
        "type": "string",
        "description": "customer or company being billed"
      },
      "date": {
        "type": "string",
        "description": "date this invoice was issued"
      },
      "po": {
        "type": "string",
        "description": "purchase order reference number"
      },
      "currency": {
        "type": "string",
        "description": "explicit three letter currency code"
      },
      "subtotal": {
        "type": "number",
        "description": "subtotal before tax"
      },
      "tax": {
        "type": "number",
        "description": "total tax amount"
      },
      "total": {
        "type": "number",
        "description": "final total amount due including tax"
      },
      "terms": {
        "type": "string",
        "description": "payment terms printed on the invoice"
      }
    }
  }
).withUsage();

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

Under the hood How it works & limitations

API calls/extract/answer/verify

From invoice to exception review

Extract fills a draft record. Answer locates supporting spans. Verify checks the total against the source. Code compares required fields, subtotal plus tax, purchase-order details and a supplied prior record.

Keep a person in the loop

Model spans can select the wrong company or amount. Scores describe the model’s span confidence, not guaranteed correctness. Sample-preview evidence is curated. Runs use real model responses, with cached or live provenance shown in Performance & cost. A draft is never a payment authorization.

This demo handles text headers and US-style decimal formatting. It does not parse PDFs, extract line items, connect to accounting systems or send payments.