Best for
Scanned PDFs and page images that need normalized text and line confidence.
Service / document.ocr
01 / Outcome
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
02 / Price
The amount shown is the complete skill checkout price. Preparation fixes the exact amount before approval.
Exact terms
Preparation fixes the exact checkout amount before approval. The live payment challenge is binding.
03 / First call
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.
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.
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 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.
[ -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 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.
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
04 / Contract
These values are generated from the active, digest-verified catalog revision.
05 / Invoke
Start with SKILL.md for agents, HTTP + x402 for HTTP integrations, or MCP for generated tools.
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.
curl --fail --silent --show-error https://ausca.com/skills/document-ocr/SKILL.md npx -y skills add auscahq/ausca --skill document-ocr Exact identity: ausca/document-ocr@0.3.1, digest sha256:d59ab8841129d4d398ed1cb306a386cc8fec5c5a9fbe618bc5823cde1be7e84d.
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.
npm install ausca viem # or: pip install ausca 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.
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.
curl --request POST https://ausca.com/v1/extract-text \
--header 'Content-Type: application/json' \
--data @ausca-document-ocr-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"
} Expected first response: 402 with matching x402 v2 PAYMENT-REQUIRED header and body. A
valid paid retry returns the admitted or replayed invocation.
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.
{
"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
A connection can end while durable work continues. Read back the invocation; do not create a second purchase.
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
Replace the example artifact commitment and idempotency key. Keep the same key when retrying an uncertain purchase.
{
"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"
} {
"lines": [
{
"confidence": 0.99,
"page": 1,
"text": "scan me"
}
],
"schema": "ausca.document_ocr.output.v1",
"source_digest": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
"text": "scan me"
} 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.