> ## Documentation Index
> Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> How HTTP 402 pay-per-request flows work with Dynamic, and how to choose an integration path

## 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:

* **[Using Dynamic with x402](/recipes/integrations/x402/implementation)** — The [x402](https://www.x402.org/) protocol, facilitator tooling (for example [Coinbase Developer Platform](https://docs.cdp.coinbase.com/x402/core-concepts/facilitator)), and official `x402-fetch` / `x402-axios` clients. Use this path for x402-protected APIs and CDP-style facilitators.
* **[Machine Payments on Tempo (Node.js)](/recipes/integrations/tempo-mpp)** — [Tempo](https://docs.tempo.xyz) **Machine Payment Protocol (MPP)** with Dynamic's Node SDK and the `mppx` client. Use this path when your API or settlement targets Tempo.
