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

# Concepts

### Concepts: x402, AI Agents, MCP

#### x402 in one minute

x402 brings “402 Payment Required” to modern APIs. Instead of subscriptions, dashboards, and key rotation, a caller attaches proof of payment to the request. If payment is valid, the request goes through; if not, the server returns 402. In xPay, this is enforced by Faremeter’s middleware on Solana, with USDC as the default token.

Why this matters:

* Per-request pricing that’s simple and transparent
* Works for humans and autonomous agents
* Payments settle instantly to your wallet

#### AI Agents

Agents are software that browse, plan, and call APIs on their own. They prefer protocols over custom dashboards, and they need pay-per-call rails. x402 is built for this world: agents can find your service, pay for a single call, and move on—no human sign-up or billing.

#### MCP (Model Context Protocol)

MCP is a standard that lets agents discover and call tools (like your endpoints) in a uniform way. xPay automatically exposes your endpoints as MCP tools, with friendly names, descriptions, and input shapes. Agents can list your tools, select one, pay via x402, and call it - all without bespoke integration work from you.


---

# 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.usexpay.xyz/learn-more/concepts.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.
