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

# Top-up Gateway

> Gasless USDC funding from 11 chains, credited to a prepaid inference balance

Prepaid suppliers need an onchain balance before they will serve a paid request,
and putting that balance onchain is normally the one step that demands gas. The
**top-up gateway** removes it. You sign a gasless USDC authorization; Meridian
settles it, bridges it to Base if needed, and a relayer performs the onchain
credit on your behalf.

## The lifecycle

<Steps>
  <Step title="Ask for a challenge">
    `POST /v1/{merchant}/topups` with a `buyer` and no payment returns
    `402 Payment Required`. The response carries one payment requirement per
    eligible source chain in `accepts[]` and per-source bounds in
    `topup.sources[]`. Omit `amount` and the gateway quotes your full headroom.
  </Step>

  <Step title="Sign a gasless authorization">
    Pick a source and sign an EIP-3009 `TransferWithAuthorization` against that
    chain's token domain. The signature fixes the token, amount, facilitator,
    validity window, payer, and nonce.
  </Step>

  <Step title="Submit and poll">
    Retry the same request with the base64 payment in the `X-PAYMENT` header.
    Same-chain payments settle directly; other sources enter `bridging` while
    Across delivers to Base. The gateway then measures the exact Base credit and
    calls the merchant contract from its relayer wallet.
  </Step>
</Steps>

Every response reports the source `settlementTx`, the optional Base `fillTx`, the
Base `depositTx`, and the exact credited amount, so the whole path is auditable
onchain.

## Payment sources

Most sources pay in USDC; Robinhood Chain pays in USDG. Cross-chain payments are
delivered as USDC on Base. Always use the token address and EIP-712 domain
returned in the payment requirements rather than a local table.

| Source          | Chain id | Token | Settlement     |
| --------------- | -------: | ----- | -------------- |
| Base            |   `8453` | USDC  | Same-chain     |
| Arbitrum        |  `42161` | USDC  | Across to Base |
| BSC             |     `56` | USDC  | Across to Base |
| HyperEVM        |    `999` | USDC  | Across to Base |
| Ink             |  `57073` | USDC  | Across to Base |
| Monad           |    `143` | USDC  | Across to Base |
| Optimism        |     `10` | USDC  | Across to Base |
| Polygon         |    `137` | USDC  | Across to Base |
| Robinhood Chain |   `4663` | USDG  | Across to Base |
| Unichain        |    `130` | USDC  | Across to Base |
| World Chain     |    `480` | USDC  | Across to Base |

## Why it's gasless

| Step                                | Who pays gas                        |
| ----------------------------------- | ----------------------------------- |
| You sign the EIP-3009 authorization | Nobody; it is an offchain signature |
| Meridian settles the payment        | The facilitator                     |
| Cross-chain delivery                | Across relayers                     |
| The onchain merchant credit         | Meridian's relayer wallet           |
| A refund, if one is needed          | Meridian's relayer wallet           |

Payments pass through the verified
[`X402ProxyFacilitator`](https://basescan.org/address/0x8E7769D440b3460b92159Dd9C6D17302b036e2d6#code)
contract on Base. The relayer holds settled funds only in the window between
settlement and merchant fulfilment, and every transaction it makes is recorded in
the top-up status.

<Columns cols={2}>
  <Card title="Top-up API" icon="terminal" href="/api-reference/topup/overview">
    Endpoints, request shapes, status codes, and reject codes.
  </Card>

  <Card title="Suppliers" icon="server" href="/inference/suppliers">
    Which supplier balances can be funded.
  </Card>
</Columns>
