billing.offers
x402 and MPP payment offers to buy credits without signing in.
Details
- Endpoint
- GET /v1/billing/offers
- Credits
- Free
- Rate class
- Light. Counts against your light requests per second.
Returns the same payment offers a 402 carries (x402 `accepts` plus MPP challenges), so an agent can buy a prepaid session before it calls anything. Pay one offer, then POST /v1/billing/pay with the payment in the PAYMENT-SIGNATURE (or X-PAYMENT) header, or Authorization: Payment for MPP. `credits` asks for an offer that covers at least that many credits.
Parameters
| Name | Type | Description |
|---|---|---|
| credits | integer | Smallest session wanted, in credits. Default: the standard offers. |
Request
Send your key in the x-api-key header, or leave it out to use the keyless tier.
curl
curl "https://api.tide.ad/v1/billing/offers" \
-H "x-api-key: YOUR_API_KEY"TypeScript
const res = await fetch("https://api.tide.ad/v1/billing/offers", {
headers: {
"x-api-key": process.env.TIDE_API_KEY!,
},
});
const data = await res.json();Response
JSON
{
"x402Version": 2,
"accepts": [
{
"scheme": "exact",
"network": "sui:mainnet",
"amount": "10000",
"asset": "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
"payTo": "0x3d651ddf154835f6cd20e107a9a957b05cc701b9a492a7f680a0a4c3b5d8b0f1",
"maxTimeoutSeconds": 600,
"extra": {
"nonce": "tpay_...",
"credits": 3333
}
}
],
"mpp": [
"Payment id=\"tpay_....0\", realm=\"api.tide.ad\", method=\"sui\", intent=\"charge\", request=\"...\""
]
}