X402 Contract
x402_contractRead the canonical SqueezeOS x402 v2 discovery contract. Use this when an agent needs the payment protocol's rules, for example challenge and response header names, before attempting any paid call. Returns the contract document; exact spend terms remain authoritative only in the target resource's fresh PAYMENT-REQUIRED challenge. Read-only and idempotent; no side effects. On error, returns a structured error. For example, read it once per session to learn the PAYMENT-SIGNATURE header name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | Whether the upstream HTTP status is 2xx; not settlement proof. | |
| body | No | Unmodified upstream JSON, or bounded response text. Consult that capability's live schema. | |
| error | No | ||
| charged | No | Present on local/transport failures; these do not establish an upstream charge. | |
| message | No | ||
| auto_spent | No | ||
| status_code | No | Observed upstream HTTP status, or null when no response was obtained. | |
| substituted | No | ||
| content_type | No | ||
| payment_required | No | Observed PAYMENT-REQUIRED header; a challenge does not prove payment. | |
| payment_response | No | Observed PAYMENT-RESPONSE header. Assess it together with accepted delivery. | |
| caller_supplied_authorization | No |