> For the complete documentation index, see [llms.txt](https://docs.mansafi.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mansafi.xyz/agents/x402.md).

# x402

x402 is an open standard for machine-to-machine payment, built on the long-dormant HTTP 402 Payment Required response. MansaFi speaks it natively, which lets an agent account pay for API calls, compute, and services with no card, no OAuth dance, and no prepaid balance to keep topped up. Value moves at the pace of an HTTP round trip.

Robinhood Chain was designed for exactly this population — agents trading, swapping, and paying is the stated purpose of the chain — and x402 is its natural payment grammar. A service gets a standard way to state a price; an agent gets a standard way to settle it, in band, inside the request it was already making.

***

## The loop

```
Agent requests a resource from an x402-enabled service
        ↓
Service answers: 402 Payment Required
  Headers carry amount, asset, recipient
        ↓
Agent's MansaFi wallet weighs the demand against its spend policy
        ↓
Inside policy: agent signs and submits a confidential USDG transfer
        ↓
Agent repeats the request, now carrying proof of payment
        ↓
Service confirms on-chain and serves the resource
```

None of that requires a person, unless the payment clears the agent's approval threshold as configured in its [spend policy](/agents/policy-engine.md). Commerce at machine speed, with your guardrails still standing.

***

## Shapes it takes

* **Pay-per-call:** the common case — every request carries its own micropayment.
* **Metered:** a service bills incrementally as consumption accrues, instead of charging up front.
* **Recurring:** a periodic x402 charge, still weighed against the spend policy on every cycle.

***

## The case for encrypting these

x402 traffic is high frequency by nature — a busy agent may settle many small payments a minute. Left public, that stream broadcasts an operation's usage curve and cost structure to anyone who cares to watch, which is competitive intelligence handed over at no charge. MansaFi's confidential token contracts hold these payments — USDG, bridged USDC, or ETH — to the same amount-hiding standard as everything else. Machine commerce without the telemetry leak.

***

## Turning it on

Nothing to turn on: x402 is live for every Agent account by default. The only setup that matters is a spend policy permitting the payees you expect. [API: Agents](/api-reference/agents.md) covers configuring that programmatically.

***

## Continue

* [Policy Engine](/agents/policy-engine.md)
* [Event Stream](/agents/event-stream.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mansafi.xyz/agents/x402.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
