Service / document.ocr

Document OCR

Extract normalized text from a scanned document.

01 / Outcome

What this service does

Returns inline when the bounded wait completes; otherwise continues under the same invocation.

Best for

Scanned PDFs and page images that need normalized text and line confidence.

Returns

Normalized text, page lines, confidence, output digest, and a notarized receipt; results above 64 KiB arrive as an output_artifact reference.

Before you buy

  • Commit one PDF, JPEG, PNG, or TIFF through the free keyless artifact ingress, then carry only its verified immutable commitment. The active input limit is 10 MiB.
  • OCR returns normalized text and line confidence, not forms, tables, signatures, layout interpretation, or a correctness guarantee for difficult source material.
  • Results larger than 64 KiB are delivered as an output_artifact reference; mint a 60-second download URL with POST /v1/artifacts/{artifact_uri}/access. Result artifacts are retained for 24 hours.

02 / Price

One clear skill checkout.

The amount shown is the complete skill checkout price. Preparation fixes the exact amount before approval.

Price · all in

$0.25

One complete admitted call.

Read the service SKILL.md

Exact terms

Exact pricing units
Model
Fixed per call
Minimum
25 USD-minor
Maximum
25 USD-minor

Preparation fixes the exact checkout amount before approval. The live payment challenge is binding.

03 / First call

Extract text from a document.

Commit one document for free, buy OCR at $0.25, and read the text with line confidence. Each step runs as written.

Needs bash or zsh, curl, jq, openssl, Node.js, AUSCA_PRIVATE_KEY exported from your secret store, and one PDF, JPEG, PNG, or TIFF up to 10 MiB.

  1. 01

    Commit the document

    Committing is free and returns an immutable commitment, which is all the purchase carries. The $0.25 cap comes first because the CLI will not start with a key and no spend limit. Point doc at your file.

    Step 1 of 3 bash
    doc="$PWD/document.pdf"
    umask 077; mkdir -p ausca-ocr && cd ausca-ocr
    export AUSCA_MAX_PAYMENT_USD=0.25
    [ -s upload.key ] || echo "upload-$(openssl rand -hex 12)" > upload.key
    npx -y ausca commit "$doc" --idempotency-key "$(cat upload.key)" \
      > artifact.next && mv artifact.next artifact.json
    jq -c '{artifact: {artifact_uri: .artifactUri,
      content_digest: .contentDigest, media_type: .mediaType}}' \
      artifact.json > input.json
  2. 02

    Buy the extraction

    The cap refuses any charge above $0.25. The key is saved before paying, so running this again recovers the same purchase instead of buying another, and a failed run never overwrites the last good answer.

    Step 2 of 3 bash
    [ -s purchase.key ] || echo "ocr-$(openssl rand -hex 12)" > purchase.key
    npx -y ausca invoke document.ocr @input.json \
      --idempotency-key "$(cat purchase.key)" > admission.next &&
      mv admission.next admission.json
    jq -r '.result.status, .result.invocation.state' admission.json
  3. 03

    Read the text and the receipt

    Most documents finish inside the purchase. Otherwise the loop reads the same invocation until it is terminal. Page lines and their confidence are in output.lines.

    Step 3 of 3 bash
    inv="https://ausca.com$(jq -r .result.inspect_url admission.json)"
    for attempt in 1 2 3 4 5 6 7 8 9 10; do
      curl -fsS "$inv" > state.json
      jq -e '.invocation.state | IN("succeeded", "failed", "cancelled")' \
        state.json > /dev/null && break
      sleep 6
    done
    jq -r '.invocation.state, (.invocation.output.text // empty)' state.json
    jq -r '.invocation.receipt_ref.public_url // empty' state.json

When it does not go straight through

No answer in step 1 or 2
Run that step again unchanged. The saved key returns the same commitment or the same purchase, and never charges twice.
Still running after step 3
Run step 3 again. The invocation continues on the server whether or not you are reading it; do not buy again.
refused or failed
A refusal names its reason in .result.code. A failed invocation is refunded, and .result.invocation.failure says why. Nothing is extracted from a refused purchase.
output_artifact, no text
Results above 64 KiB arrive as an artifact. POST https://ausca.com/v1/artifacts/{artifact_uri}/access with no body and a fresh Idempotency-Key header to mint a 60-second download link; check the bytes against content_digest before reading them. Results are kept for 24 hours.

04 / Contract

Pinned before execution.

These values are generated from the active, digest-verified catalog revision.

Status
Active
Offer
document.ocr
Revision
ocr-fixed-r17
Execution
Bounded
Input artifact
Up to 10 MiB
Bounded wait
90 seconds
Result retention
24 hours
Inline result
Up to 64 KiB
Receipt evidence
Sealed at success, then notarized by an independent party, not by Ausca.
Revision digest
sha256:0e714cc84793875097fafd08f8f4b30352cc6dda6070d3b09412723c1151a6c2
Input schema digest
sha256:aa86a0fc7e01438f3f99dc35550f4c3d710795e4302e489de32eae7e403ffd5d
Output schema digest
sha256:d9f05704955fca53ed5813e2522f56d4b9fb95e072f84771a369f780b77741d6

05 / Invoke

Use the entry point that fits.

Start with SKILL.md for agents, HTTP + x402 for HTTP integrations, or MCP for generated tools.

SKILL.md Recommended for agents

Start from the exact versioned instructions for this service. The skill describes the capability, inputs, payment boundary, retry identity, and evidence without requiring an agent to scrape this page.

Fetch the skill sh
curl --fail --silent --show-error https://ausca.com/skills/document-ocr/SKILL.md
Install with Skills sh
npx -y skills add auscahq/ausca --skill document-ocr

Exact identity: ausca/document-ocr@0.3.1, digest sha256:d59ab8841129d4d398ed1cb306a386cc8fec5c5a9fbe618bc5823cde1be7e84d.

ausca package npm and PyPI

The front door package wraps this exact flow as a typed client, a CLI, and a local MCP server. Payment signs on your machine under a hard per-call USD cap; the catalog binding, idempotent retry identity, and settlement receipt are built in.

Install sh
npm install ausca viem   # or: pip install ausca
Paid invocation js
import { AuscaClient } from "ausca";

const client = AuscaClient.withLocalKey({
  privateKey: process.env.AUSCA_PRIVATE_KEY,
  maxPaymentUsd: 0.25,
});

// Save one key per intended purchase before paying; reuse it only to recover.
const savedPurchaseKey = "document-ocr-purchase-0001";
const outcome = await client.invoke(
  "document.ocr",
  {
    "artifact": {
      "artifact_uri": "runx:artifact:sha256:1111111111111111111111111111111111111111111111111111111111111111",
      "content_digest": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
      "media_type": "application/pdf"
    }
  },
  { idempotencyKey: savedPurchaseKey },
);
console.log(outcome.result, outcome.payment?.transaction);

MCP hosts: npx ausca mcp serves this offer as ausca_extract_text, paying locally within AUSCA_MAX_PAYMENT_USD.

HTTP + x402 HTTP client

Send the exact invocation envelope without payment material to discover live binding terms. Use a supported x402 client for the authorized retry; do not paste a sample signature.

Unsigned discovery sh
curl --request POST https://ausca.com/v1/extract-text \
  --header 'Content-Type: application/json' \
  --data @ausca-document-ocr-request.json
ausca-document-ocr-request.json json
{
  "idempotency_key": "ausca-document-ocr-example-0001",
  "input": {
    "artifact": {
      "artifact_uri": "runx:artifact:sha256:1111111111111111111111111111111111111111111111111111111111111111",
      "content_digest": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
      "media_type": "application/pdf"
    }
  },
  "input_schema_digest": "sha256:aa86a0fc7e01438f3f99dc35550f4c3d710795e4302e489de32eae7e403ffd5d",
  "offer_id": "document.ocr",
  "offer_revision": "ocr-fixed-r17",
  "offer_revision_digest": "sha256:0e714cc84793875097fafd08f8f4b30352cc6dda6070d3b09412723c1151a6c2",
  "output_schema_digest": "sha256:d9f05704955fca53ed5813e2522f56d4b9fb95e072f84771a369f780b77741d6"
}

Expected first response: 402 with matching x402 v2 PAYMENT-REQUIRED header and body. A valid paid retry returns the admitted or replayed invocation.

MCP Discovery and control

MCP projects the same Ausca contract. Paid invocation is disabled by default and must be enabled deliberately by a compatible host. MCP does not carry x402 HTTP headers.

ausca_extract_text json
{
  "jsonrpc": "2.0",
  "id": "document-ocr-example",
  "method": "tools/call",
  "params": {
    "name": "ausca_extract_text",
    "arguments": {
      "idempotency_key": "ausca-document-ocr-example-0001",
      "input": {
        "artifact": {
          "artifact_uri": "runx:artifact:sha256:1111111111111111111111111111111111111111111111111111111111111111",
          "content_digest": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
          "media_type": "application/pdf"
        }
      },
      "input_schema_digest": "sha256:aa86a0fc7e01438f3f99dc35550f4c3d710795e4302e489de32eae7e403ffd5d",
      "offer_id": "document.ocr",
      "offer_revision": "ocr-fixed-r17",
      "offer_revision_digest": "sha256:0e714cc84793875097fafd08f8f4b30352cc6dda6070d3b09412723c1151a6c2",
      "output_schema_digest": "sha256:d9f05704955fca53ed5813e2522f56d4b9fb95e072f84771a369f780b77741d6"
    }
  }
}

Expected response: the generated invocation result shape. Use ausca_get_invocation for authoritative state and the receipt reference; a result above the inline bound arrives as output_artifact, readable through ausca_artifact_access.

06 / Lifecycle

One purchase identity to terminal state.

A connection can end while durable work continues. Read back the invocation; do not create a second purchase.

  1. 01 payment terms
  2. 02 admitted
  3. 03 running
  4. 04 terminal

A 202 response means the invocation was admitted, not that execution failed to finish inline. Read the same invocation until it reaches a terminal state.

Cancellation is a bounded request and can lose a race with completion. Results remain available for 24 hours. Retry uncertain purchases with the same idempotency key.

07 / Contract examples

A complete request, from authority.

Replace the example artifact commitment and idempotency key. Keep the same key when retrying an uncertain purchase.

Invocation request json
{
  "idempotency_key": "ausca-document-ocr-example-0001",
  "input": {
    "artifact": {
      "artifact_uri": "runx:artifact:sha256:1111111111111111111111111111111111111111111111111111111111111111",
      "content_digest": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
      "media_type": "application/pdf"
    }
  },
  "input_schema_digest": "sha256:aa86a0fc7e01438f3f99dc35550f4c3d710795e4302e489de32eae7e403ffd5d",
  "offer_id": "document.ocr",
  "offer_revision": "ocr-fixed-r17",
  "offer_revision_digest": "sha256:0e714cc84793875097fafd08f8f4b30352cc6dda6070d3b09412723c1151a6c2",
  "output_schema_digest": "sha256:d9f05704955fca53ed5813e2522f56d4b9fb95e072f84771a369f780b77741d6"
}
Result shape json
{
  "lines": [
    {
      "confidence": 0.99,
      "page": 1,
      "text": "scan me"
    }
  ],
  "schema": "ausca.document_ocr.output.v1",
  "source_digest": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
  "text": "scan me"
}

Recommended agent entry

ausca/document-ocr@0.3.1

Extract normalized text from one immutable document through Ausca's fixed-price document OCR service.

Read the exact SKILL.md
Digest-bound skill reference text
SKILL.md: https://ausca.com/skills/document-ocr/SKILL.md
Service: https://ausca.com/services/document-ocr
Endpoint: POST https://ausca.com/v1/extract-text
Offer: document.ocr
Revision: sha256:0e714cc84793875097fafd08f8f4b30352cc6dda6070d3b09412723c1151a6c2
Input schema: https://ausca.com/schemas/offers/text-extract.input.schema.json
Output schema: https://ausca.com/schemas/offers/text-extract.output.schema.json
Pricing: fixed; resolve binding terms from live preparation or payment challenge.

Executed through an Ausca-owned document capability behind the governed provider boundary.