Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt

Use this file to discover all available pages before exploring further.

Introduction

HTTP 402 Payment Required is for responses where the client must pay (or otherwise satisfy payment terms) before accessing a resource. Stacks built on 402 use it for machine-to-machine traffic and agents: the client requests an API, receives payment requirements instead of the payload, fulfills them with a wallet (and retries as the protocol defines), and the server returns the resource after verification and settlement. Exact headers, payloads, and settlement differ by protocol; you avoid redirects and hosted checkouts for many of these flows.

How 402 payment flows work

Most stacks follow the same shape:
  1. Request: Client calls an HTTP API
  2. 402 response: Server returns payment requirements instead of the resource
  3. Payment: Client signs or builds payment proof and retries (mechanism is protocol-specific)
  4. Verification: Server or a service validates the payment
  5. Settlement: Funds or state update onchain (or per your stack)
  6. Delivery: Server returns the requested resource

Buyers and sellers

For buyers

  • Often no accounts: Requirements are carried in the HTTP exchange instead of a separate signup
  • In-request payments: Pay as part of calling the API
  • Wallet options: Embedded wallets, external wallets, or server wallets with Dynamic
  • Programmatic: Fits agents and automated clients

For sellers

  • API-native pricing: Charge per request, call, or resource
  • Minimal checkout UI: Many flows need no separate payment page
  • Usage-based models: Micropayments and pay-per-use access

Dynamic’s role

Dynamic provides wallet infrastructure—signing, key handling, embedded and external wallet connectivity, and server wallets—for 402-style integrations. Wire format, headers, and settlement are defined by the protocol you integrate (for example x402 or Tempo MPP).

Use cases

  • AI billing: Per inference or API call
  • API monetization: Usage-based access instead of flat subscriptions
  • Autonomous agents: Automatic payment for services
  • Micropayments: Per article, video, or data point
  • Premium content: Access after payment in the same request flow

Integration paths

Dynamic documents two 402 stacks: