> For the complete documentation index, see [llms.txt](https://whitepaper.lacunalabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whitepaper.lacunalabs.io/x402-and-the-agent-economy/private-x402-payments.md).

# Private x402 Payments

x402 is a payment standard that lets clients and autonomous agents pay for resources directly over HTTP, reviving the long-reserved `402 Payment Required` status code. It's ideal for machine-to-machine and AI-agent payments — but x402 payments settle on public chains.

Lacuna adds privacy on top: agents and services can pay through the shielded pool, so the payment settles without exposing the payer, the amount, or the relationship between counterparties.

## What This Enables

* Confidential pay-per-use API and data access.
* Private machine-to-machine settlement at scale.
* Agents that transact without broadcasting their strategy.

```ts
// A private x402 payment from an agent
await wallet.payX402({
  endpoint: "https://api.example.com/resource",
  amount: "5",
  token: "USDC",
});
```

Lacuna is infrastructure here: any agent or service can integrate private x402 payments via the [SDK](/for-developers/sdk.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:

```
GET https://whitepaper.lacunalabs.io/x402-and-the-agent-economy/private-x402-payments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
