# Reference

## What is x402?

[x402](https://x402.org) is an open standard for internet-native payments over HTTP. It brings back the original intent of the HTTP `402 Payment Required` status code, enabling any HTTP resource to require a micro-payment before delivering its response.

The protocol is designed to be stateless and works for both traditional applications and autonomous AI agents. The payment flow follows six steps:

1. The client requests a paid resource.
2. The server responds with `402 Payment Required` and a `PaymentRequirements` object describing the accepted network, scheme, asset, and amount.
3. The client builds a signed `PaymentPayload` and replays the request with a `PAYMENT-SIGNATURE` header.
4. The server forwards the payload to a **facilitator** for verification and settlement.
5. The facilitator validates the payload and submits the payment on-chain.
6. The server delivers the protected resource upon confirmation.

## What is a facilitator?

A facilitator is a service that handles the verification and on-chain settlement of x402 payments on behalf of resource servers. It operates as an independent layer between clients, resource servers, and blockchain networks.

The facilitator's three core responsibilities are:

* **Verification** — Confirms that a client's signed payment payload satisfies the server's declared payment requirements without yet submitting anything on-chain.
* **Settlement** — Validates the payload and then submits the payment transaction to the blockchain, monitoring it until confirmation.
* **Abstraction** — Allows resource servers to accept blockchain payments without maintaining direct node connectivity or building their own verification logic.

The facilitator does not hold funds or act as a custodian. It only executes on-chain transactions based on signed payment authorizations provided by clients.

## CSPR.cloud x402 Facilitator

CSPR.cloud provides an x402 facilitator for the Casper Network. It supports the `exact` payment scheme using [CEP-18](https://github.com/casper-ecosystem/cep18) tokens authorized via [EIP-712](https://github.com/casper-ecosystem/casper-eip-712) typed-data signatures.

### Endpoints

| URL                                   | Network             |
| ------------------------------------- | ------------------- |
| <https://x402-facilitator.cspr.cloud> | Mainnet and Testnet |

All endpoints require authorization. Learn how to obtain an access token [here](/documentation/overview/authorization.md).

### Supported networks and schemes

The CSPR.cloud facilitator supports the `exact` scheme on Casper networks:

| Network identifier   | Description    |
| -------------------- | -------------- |
| `casper:casper`      | Casper Mainnet |
| `casper:casper-test` | Casper Testnet |

Network identifiers follow the [CAIP-2](https://github.com/ChainAgnostic/namespaces/blob/main/casper/caip2.md) format.

### API endpoints

The facilitator exposes three endpoints:

| Endpoint                                         | Method | Description                                                      |
| ------------------------------------------------ | ------ | ---------------------------------------------------------------- |
| [/supported](/x402-facilitator-api/supported.md) | GET    | Returns supported payment schemes and networks                   |
| [/verify](/x402-facilitator-api/verify.md)       | POST   | Validates a payment payload without submitting it on-chain       |
| [/settle](/x402-facilitator-api/settle.md)       | POST   | Validates a payment payload and settles it on the Casper Network |

### Examples

The [github.com/make-software/casper-x402](https://github.com/make-software/casper-x402) repository contains end-to-end examples to build a complete x402 payment flow.


---

# Agent Instructions: 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://docs.cspr.cloud/x402-facilitator-api/reference.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.
