Gas-free payments and pay per request
Switched off unless this deployment turns it on.
GET /v1/billing/methodsanswersmeridian.enabled; when it isfalse, nothing on this page is available and the Billing page does not show the panel.
In plain English
You can pay Sable two new ways, both without paying a network fee yourself:
- Top up by signing. On the Billing page, choose an amount, pick your wallet and sign. You do not send a transaction; you sign a permission slip for that exact amount. A company called Meridian turns it into a real payment and pays the network fee.
- Pay per request, no account. A program can call Sable with no API key. Sable answers "payment required" with the terms, the program signs a payment, sends the request again, and gets its answer.
Three things to know:
- Meridian is a separate company, not Sable. It keeps its own fee, about 1%. If you pay $5.00, about $4.95 reaches Sable.
- Sable adds only what actually arrives. Sable reads the payment on the blockchain itself. If Meridian says a payment went through but Sable cannot see the money arrive, nothing is added and the team is alerted.
- Top-ups are credit, not a deposit you can withdraw. Prepaid credit is non-refundable and non-transferable, the same as a USDT top-up.
The one exception to point 2 is Circle nanopayments, below: those are added on Circle's word and settle later, so they are small and capped.
What you can pay with
| Coin | Network | How it is signed | First time |
|---|---|---|---|
| USDC | NetworkBase | How it is signedEIP-3009 TransferWithAuthorization | First timeNothing extra |
| USDG | NetworkRobinhood Chain | How it is signedPermit2 PermitWitnessTransferFrom | First timeOne approval transaction (a small network fee), then gas-free |
The deployment decides which coins it offers: GET /v1/billing/methods →
meridian.assets is the list. A top-up is between $0.10 and $1,000 by
default (meridian.caps).
Topping up from the Billing page
- Link the wallet you will pay from (Wallets page). A signature from a wallet that is not linked to your account is refused. This is what stops anyone who sees your signed payment from spending it on their own account.
- Open Billing → Pay gas-free, choose the amount and the coin.
- Pick your wallet. It switches network if it needs to, then asks you to sign.
- Sable sends the signed payment through Meridian, reads the transaction on the chain, and adds what arrived. The page shows the amount added, Meridian's fee, and a link to the transaction.
The page sends your signature to one place only: Sable's own gateway. A signed payment is like a signed cheque until it settles, so never paste one into another site.
A top-up made this way is presented to Meridian straight away, and Sable does
not store the signed payment. There are two cases where Sable does hold one,
both described below: an upto
payment, which can only be settled after the request it pays for, and
automatic top-up, which is built but switched off by
default, where you sign several payments in advance and Sable holds them,
sealed, until each is used or expires.
For developers
Where the money goes
For USDC and USDG, the payment you sign is made out to Meridian's
facilitator contract (0x8E7769D440b3460b92159Dd9C6D17302b036e2d6), not to
Sable. In one transaction the facilitator takes its fee and forwards the rest to
Sable's treasury. Sable credits the amount it reads reaching the treasury, never
the amount you signed and never Meridian's report of it.
The X-PAYMENT payload
Any metered request (chat, embeddings, messages, responses, sandboxes, images)
accepts a standard x402 payment in the X-PAYMENT header: base64 of
{
"x402Version": 1,
"scheme": "exact",
"network": "base",
"payload": {
"signature": "0x…",
"authorization": {
"from": "0xYourWallet",
"to": "0x8E7769D440b3460b92159Dd9C6D17302b036e2d6",
"value": "5000000",
"validAfter": "0",
"validBefore": "1790000000",
"nonce": "0x…32 random bytes…"
}
}
}
The result comes back in X-PAYMENT-RESPONSE (base64 JSON:
success, transaction, network, payer, status, creditedMicroUsd,
kind, note). Where to sign what: a 402's accepts array, or
GET /v1/billing/methods → meridian.
- With an API key, an
exactpayment tops up that key's account. The paying wallet must be linked to the account. - With no API key, the paying wallet is the account: Sable finds the
account that wallet signs in with (or opens one, with no signup grant), credits
it, and serves the request. A settled payment can be reused as the wallet's
identity for ten minutes (
caps.keyless_reuse_secs), never past its own deadline. - From the portal,
POST /v1/billing/meridian/topupwith{"payment": <the X-PAYMENT value or its JSON>}settles a top-up with no request attached, through the same path.
Signing an EIP-3009 payment (TypeScript, no viem)
The SDK signs and retries for you, with @noble only:
import { fetchWithX402, privateKeySigner, decodePaymentResponse } from "@sable-network/sdk";
// An agent's own hot wallet holding a little USDC on Base. Never a treasury key.
const signer = privateKeySigner(process.env.AGENT_WALLET_KEY!);
const res = await fetchWithX402(
signer,
"https://api.buildsable.com/v1/chat/completions",
{
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
model: "sable-llama-3.3-70b",
messages: [{ role: "user", content: "hi" }],
}),
},
{ network: "base", maxAmount: 5_000_000n }, // never sign more than 5 USDC
);
console.log(await res.json());
console.log(decodePaymentResponse(res)); // what was credited, and the transactionThe typed data is the token's own EIP-712 domain (name and version from
extra, the chain id, the token as verifyingContract) and the
TransferWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce) type. The Python SDK has the same
helper (eip3009_payment_header).
Pay per request with a maximum (upto)
An upto payment signs a maximum instead of an amount (Permit2, through the
x402 upto proxy). Sable serves the request, measures what it actually cost, and
settles only that, adding about 1% so Meridian's fee comes out of the payment
rather than the price. It never settles more than you signed. upto is for
requests with no API key only (a keyed caller already has a balance to draw
on), and one signature may cover at most $5 by default
(caps.upto_max_micro_usd).
Because the amount is only known once the request has run, Sable stores the
signed upto payment with its payment record, so that it can be settled
afterwards, including for a request that was abandoned part-way. It is stored
sealed, and it is erased once the payment is settled, released or failed, or
once its deadline has passed. What it could move while it is held is bounded
by the maximum you signed and by its deadline.
Circle nanopayments
If you hold USDC in a pre-funded Circle Gateway Wallet, you can pay tiny
amounts with no transaction at all: you sign an authorization over Circle's
GatewayWalletBatched domain, made out to Sable's treasury, and Circle settles
many of them later in one batch. Because the money arrives later, Sable credits
these on Circle's verification plus its own check of your signature, and caps
them: $1 per payment and $20 per wallet per day by default
(caps.gateway_max_payment_micro_usd, caps.gateway_daily_cap_micro_usd).
Everything else on this page is credited only after Sable reads the money
arriving on-chain.
Refusals
A payment Sable does not accept is answered with a fixed error class and credits nothing. The common ones:
| Class | Meaning |
|---|---|
payer_not_linked_to_account | MeaningThe paying wallet is not linked to the account (keyed or portal top-ups). |
amount_below_minimum / amount_above_maximum | MeaningOutside the top-up bounds. |
authorization_expired | MeaningThe signature's deadline passed before it was settled. |
authorization_not_to_facilitator | MeaningThe payment was made out to someone other than Meridian's facilitator. |
payment_already_used | MeaningThat signature was already settled. |
no_transfer_to_treasury | MeaningMeridian reported success but nothing reached Sable's treasury. Nothing was credited; the operator is alerted. |
sender_sanctioned / screening_unavailable | MeaningThe paying wallet was refused by sanctions screening, or the screener could not be reached (fail closed). |
Meridian's own error text is never passed through; you get the class.
Automatic top-up
Built, and switched off unless a deployment sets
SABLE_AUTO_TOPUP_ENABLED(it also needs the gas-free rail above).GET /v1/billing/auto-topupanswersenabled. There is no portal page for it yet: it is set up over the API.
An agent running on a Sable key stops when the prepaid balance runs out. Automatic top-up refills the balance without you being there, inside limits you fix in advance.
What it is, exactly
It is not a pull payment, a subscription or a standing allowance. Neither gas-free rail has one: an EIP-3009 authorization and a Permit2 signature transfer are each a single transfer of a fixed amount, with its own nonce and its own deadline. So Sable cannot be given permission to "take up to $X when needed". What you can do instead is this:
- You sign several one-time payments in advance, all from the same wallet,
in the same coin on the same network, all for the same amount. Each is
exactly the
exactpayment a manual top-up signs. - You file them with a low-balance threshold and a hard cap.
- Sable keeps them sealed and presents one through Meridian when your spendable credit (balance minus credit reserved by requests in flight) falls below the threshold.
What bounds it, none of which can be raised without a new signature from your wallet:
- The payments you signed. Sable can never take more than those. A deployment accepts at most 10 per authorization by default.
- The cap. The total Sable will ever try to take, counted when a payment is claimed, so an attempt that fails still counts. The payments you file may not add up to more than it. A deployment sets the largest cap it accepts ($500 by default).
- The deadline in each signature. Each payment must be valid for at least an hour when filed and no longer than the deployment allows (30 days by default). The authorization ends shortly before its earliest deadline.
- One at a time, not in a loop. One top-up may be in flight per account, and there is a minimum interval between two (5 minutes by default).
upto payments and Circle nanopayments cannot be filed. An upto maximum is a
budget for one keyless request and is never account credit, and a nanopayment
is credited on Circle's word; an unattended refill has to rest on a transfer
Sable read itself.
What Sable is holding while it is active
This is the part to decide on before you use it. Until they are used or expire, Sable holds signed payments that can move your funds, up to the cap.
- They are stored AES-GCM sealed under the gateway's master key, each bound to its own row. No endpoint returns one to anyone, including you.
- One is opened only at the moment it is presented, and each is destroyed the moment it is used, fails, is revoked or expires.
- A copy of the database alone cannot use them. A copy of the database together with the master key could, until each signature's deadline.
That is a real difference from a manual top-up, where Sable never keeps your signature. A short validity, a small number of payments and a cap you would be comfortable losing are the controls that are yours.
What happens on each top-up
A top-up is started when a billed request finds spendable credit under your
threshold. It runs separately from that request, which is never held up
waiting for it and can still be answered 402. When an automatic top-up is
set up, the 402 message says so, and a retry a few seconds later may succeed.
Each one goes through the same path as a manual gas-free top-up, with the same checks every time: the signature is verified locally first, the paying wallet must still be linked to the account, the wallet is sanctions-screened (refused if the screener cannot be reached), a signed payment settles at most once, and Sable credits only the net amount it reads reaching its treasury on-chain. Meridian keeps about 1%, as on any gas-free payment. The credit is an ordinary deposit in your ledger.
A failed top-up switches automatic top-up off. It does not retry. The unused payments are destroyed and you are told by webhook; to continue you set it up again with new signatures. It also ends if the paying wallet is unlinked from the account, when the payments run out, when the cap is reached, or at expiry.
Revoking
DELETE /v1/billing/auto-topup ends it immediately, and works even on a
deployment that has since switched the feature off. Every unused signed payment
Sable holds is destroyed in the same step. Two things to know:
- A top-up that was already in flight may still complete.
- Destroying Sable's copy does not cancel the signature. It stays valid
on-chain until its own deadline. The response lists each payment's
nonceso you can cancel them from your wallet, and you should do that for any payment that was presented and refused: Meridian has seen it, and it stays usable until its deadline.
The API
All three are session-authed. Reading takes any role; creating and revoking need Admin.
| Method | Path | What it does |
|---|---|---|
| GET | Path/v1/billing/auto-topup | What it doesWhat the deployment offers (enabled, limits, the rails to sign for), your active authorization or null, and recent history. Never a signature. |
| POST | Path/v1/billing/auto-topup | What it doesFile the signed payments. Body {threshold_micro_usd, cap_micro_usd, payments: [...]}, each entry exactly what POST /v1/billing/meridian/topup takes as payment. 201 with the authorization; 501 when the feature is off. One active authorization per account. |
| DELETE | Path/v1/billing/auto-topup | What it doesRevoke. Returns the authorization with destroyed_payments and each payment's nonce. |
A filing Sable does not accept is answered with a fixed class and stores nothing:
| Class | Meaning |
|---|---|
auto_topup_exact_only | MeaningOnly exact gas-free payments made out to Meridian's facilitator can be filed. |
payments_not_uniform | MeaningThe payments differ in wallet, coin, network or amount. |
no_payments / too_many_payments | MeaningNone, or more than one authorization may hold. |
topup_below_minimum | MeaningEach payment is smaller than the smallest automatic top-up accepted ($1 by default). |
duplicate_nonce / payment_already_used / payment_already_filed | MeaningTwo share a nonce, or one was already settled or filed. |
authorization_expires_too_soon / authorization_validity_too_long | MeaningA signature is valid for less than an hour, or for longer than the deployment accepts. |
threshold_out_of_range / cap_out_of_range / payments_exceed_cap | MeaningThe threshold or cap is outside the allowed range, or the payments add up to more than the cap. |
payer_not_linked_to_account | MeaningThe paying wallet is not linked to this account. |
auto_topup_already_active | MeaningThe account already has one; revoke it first. |
Three webhook events report what happened:
auto_topup_credited, auto_topup_failed and auto_topup_exhausted. They
carry ids, amounts, a network name, a transaction hash and a fixed error class,
never a signature.
What has not been done yet: this has been tested against a stand-in for Meridian, not against Meridian itself, a real chain or a real wallet. In particular we have not confirmed that Meridian accepts signatures that stay valid for days. If it does not, every automatic top-up will fail and switch itself off.