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

# Overview

> How x402 works on Sui through the Tentacle Pay facilitator.

[x402](https://x402.org) is an open payment standard built on the HTTP `402 Payment Required` status code. It lets any server charge for any resource, and any client — including AI agents — pay for it, with no accounts, API keys, or off-chain escrow.

Tentacle Pay runs a production x402 facilitator for **Sui**, so sellers and agents skip the blockchain plumbing and settle stablecoins gasless.

## The flow

<Steps>
  <Step title="Client requests a resource">
    The client makes a normal HTTP request to the seller's endpoint.
  </Step>

  <Step title="Server responds with 402">
    If payment is required, the server returns `402 Payment Required` with an `accepts` list describing the price, network, token, and recipient.
  </Step>

  <Step title="Client signs a payment">
    The client picks an option it supports, signs a Sui transaction authorizing the transfer, and retries the request with the signed payload attached.
  </Step>

  <Step title="Server verifies with the facilitator">
    The server forwards the payload to `https://facilitator.tentaclepay.com/verify`. The facilitator checks the signature, amount, recipient, and network.
  </Step>

  <Step title="Server settles and returns the resource">
    On success the server calls `/settle`. The facilitator submits the transaction to Sui, waits for finality, and returns the transaction digest in the response headers.
  </Step>
</Steps>

## Roles

* **Seller** — an API, MCP server, or agent that charges for a resource. Runs the x402 middleware and points it at the Tentacle Pay facilitator. See [Quickstart for sellers](/x402/quickstart-for-sellers).
* **Agent (buyer)** — a client, script, or agent that pays for resources. Wraps its HTTP client with the x402 SDK and supplies a Sui signer. See [Quickstart for agents](/x402/quickstart-for-agents).
* **Facilitator** — the Tentacle Pay service at `facilitator.tentaclepay.com`. Verifies payloads, sponsors gas, submits to Sui, and returns settlement results. See [Facilitator](/x402/facilitator).

## What Tentacle Pay adds on top of x402

* **Sui support out of the box** — both `sui:mainnet` and `sui:testnet`, using [CAIP-2](https://chainagnostic.org/CAIPs/caip-2) network identifiers.
* **USD-priced endpoints.** `@tentaclepay/sui-x402` resolves human prices like `"$0.001"` to the correct token amount for Sui's default stablecoin.
* **Gasless settlement.** Sui covers gas for stablecoin transfers natively, and the facilitator sponsors the rest — sub-cent stablecoin payments and any non-stablecoin coin — so buyers never need SUI.
* **Standards-compatible.** Any x402 client or server library that speaks the v2 protocol works with the facilitator.

## The SDK

`@tentaclepay/sui-x402` implements the `exact` payment scheme for Sui across three roles:

<CardGroup cols={3}>
  <Card title="Client" icon="credit-card">
    `@tentaclepay/sui-x402/exact/client` — sign and attach payments from a wallet.
  </Card>

  <Card title="Server" icon="server">
    `@tentaclepay/sui-x402/exact/server` — build payment requirements and price routes in USD.
  </Card>

  <Card title="Facilitator" icon="shield-check">
    `@tentaclepay/sui-x402/exact/facilitator` — verify and settle on-chain.
  </Card>
</CardGroup>

```bash theme={null}
npm install @tentaclepay/sui-x402
```

The package is published on [npm](https://www.npmjs.com/package/@tentaclepay/sui-x402) and built on `@x402/core`. Go, Java, and Python implementations are on the way.

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart for sellers" icon="server" href="/x402/quickstart-for-sellers">
    Add an x402 paywall to your API.
  </Card>

  <Card title="Quickstart for agents" icon="robot" href="/x402/quickstart-for-agents">
    Pay for x402 resources from your agent.
  </Card>
</CardGroup>
