Price one machine (the x402 offer)
compute_quoteGets the exact price of one machine without paying: sends the create request with no payment and returns the API's HTTP 402 offer, one leg per network, each with the amount in USDC, the address it is paid to, the token, how long a signature stays good, and what to sign. The API checks the plan, the hours and the setup first, so a refusal costs nothing. Pass machine_id and hours instead to price a renewal of a running machine (any wallet may pay one). Where the API sells quarter-hours (compute_plans shows minutePrices), send minutes (15, 30 or 45) in place of hours. For a plan that lists regions (compute_plans shows them), send region. Send ai_usd (1, 5, 25 or 100) to buy that AI balance in the same payment: the paying wallet gets it, and a key on it arrives in the machine's sealed env as AGENTGATES_API_KEY. To buy, sign one leg with your own wallet and send the same request with an X-PAYMENT header (compute_docs has the whole contract).
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": "compute_quote"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan | No | A plan id from compute_plans. Not with machine_id. | |
| port | No | With image: the container port behind 8080 (default 80). | |
| count | No | A new purchase only: 2 to 10 in one payment. | |
| hours | No | Prepaid hours (within the plan's range), or hours to add on a renewal. Or send minutes. | |
| image | No | What it runs. A plan whose card in compute_plans lists images takes one of those (none: its default). Any other plan: one container image, served on host port 8080, e.g. nginx:alpine, or send compose. | |
| ai_usd | No | A new machine only: dollars of AI bought in the same payment, for the paying wallet; a key on that balance arrives in the machine's sealed env as AGENTGATES_API_KEY. Paid over x402 only. | |
| region | No | For a plan that lists regions (compute_plans shows them): the region to run in, by its id. Absent, the plan's first. | |
| api_key | No | With open_with naming apiKey: the public half (base58) of one of the paying wallet's signing API keys. Never its ags_ secret. | |
| compose | No | A docker-compose.yml as a string. It must publish a port. Or send image. | |
| minutes | No | In place of hours, where the API sells quarter-hours (compute_plans shows minutePrices): 15, 30 or 45 minutes, on every plan but GPU. A quarter-hour costs more per hour than an hour. A plan whose card in compute_plans carries minMinutes takes any whole minutes from it. | |
| open_rule | No | With open_with: any (default), one of them opens it; all, every one on each call. | |
| open_with | No | On a plan whose card in compute_plans lists opensWith: what opens it at its own address, one, two or all three. Default: the paying wallet, the signing API key that signed the purchase, and the password when access_key_hash is sent. A compute key (agc_) never opens it. | |
| machine_id | No | Price a renewal of this machine instead of a new one (with hours or minutes only). | |
| access_key_hash | No | With open_with naming password: the sha256 of the password you keep, 64 lowercase hex. The password itself is never sent here. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| code | No | ||
| kind | No | ||
| legs | No | ||
| next | No | ||
| error | No | ||
| status | No | ||
| notices | No | The API's notices on its answer, when it sent any. | |
| request | No | ||
| resource | No | ||
| description | No | ||
| x402Version | No |