---
name: document-analysis
description: Extract structured document data through Ausca's measured asynchronous document analysis service.
---

# Ausca Document Analysis

Use this service when an agent or application needs structured document data
from one immutable artifact. The service is asynchronous. Its Ausca price is
measured from artifact size within the active catalog's bounded range.

## Authority

Resolve the active `document.analysis` revision from
`https://ausca.com/catalog.json`. Use the linked input and output schemas and
keep the revision, schema digests, canonicalizer, and idempotency key in the
invocation envelope exactly as declared. This file explains the workflow; the
catalog and schemas define the machine contract.

## Prepare and invoke

1. Supply the immutable artifact commitment and requested feature types
   required by the input schema. Do not place document bytes in invocation JSON.
2. Send the exact input to `POST https://ausca.com/v1/invocations/prepare`.
   Preparation validates the input and fixes binding terms from the committed
   artifact size before money moves.
3. Send the resulting exact invocation envelope to
   `POST https://ausca.com/v1/invocations` without payment material to discover
   the live x402 v2 requirement.
4. After explicit payment authorization, retry the same request bytes and
   idempotency key with the required `PAYMENT-SIGNATURE` header.
5. Read `GET /v1/invocations/{invocation_id}` until the invocation reaches a
   terminal state. An HTTP connection may end while durable work continues.

The unsigned request is discovery only. It does not settle payment or admit
work. A successful paid retry returns the admitted or replayed invocation and
may include `PAYMENT-RESPONSE` settlement evidence.

## Retry and evidence

Reuse the same preparation and idempotency key only for retransmission of the
same intended purchase. Never re-prepare or mint a second purchase because a
connection ended. Completion requires the expected receipt class and an output
commitment that validates against the published schema. Cancellation is a
bounded request and may lose a race with completion.

Ausca owns provider access, credentials, durable execution, and receipt
production. Callers supply service input and bounded payment authority; they do
not need a provider SDK, cloud credential, wallet implementation, or database
connection.
