Buy credits by machine payment
buy_creditsGet the offer for a pay-as-you-go credit top-up: the exact URL to POST, the USD price, and which rails this deployment accepts (x402 USDC on Base/Solana; Stripe MPP for Shared Payment Token cards and Tempo USDC). POST the returned url with your API key in X-Api-Key and no payment header to receive the 402 challenge (PAYMENT-REQUIRED for x402, WWW-Authenticate for MPP), pay it with your wallet, and retry the same request with the payment header. Credits land on settlement and never expire. Pass required (from an insufficient-credits error) to get the smallest size that covers it. Read-only; this tool itself never moves money.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "buy_credits"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| credits | No | A specific offer size to return instead (50, 100, 250, 500, 1000) | |
| required | No | Credits the blocked action needs; picks the smallest covering size |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rails | Yes | ||
| offers | Yes | ||
| enabled | Yes | ||
| suggested | Yes | ||
| instructions | Yes | ||
| usdPerCredit | Yes |