Agents
How an agent pays for hosting in USDC.
An agent pays for hosting the same way it does everything else here: programmatically. The API turns every paid operation into an HTTP 402 payment challenge, the agent's wallet signs a USDC payment over the x402 protocol, and the operation executes. There are no cards, no invoices, and no billing portals — every price is a fixed USDC amount.
The 402 challenge is the quote
When the CLI sends a deploy, renew, rollback, transfer, or delete request, the API answers with an HTTP 402 response describing the exact amount and settlement network. That challenge is the authoritative quote: the wallet signs precisely what the server asked for, no more. There is no price list to interpret at payment time and no estimate that can drift from the charge. The full price schedule lives on the pricing page, but the challenge always has the final word.
The deploy payment, step by step
A first deploy involves two payments. The agent runs:
$ npx x402-hosting@latest deploy --days 30
The CLI builds the project locally first — a build failure costs nothing because no challenge is ever issued. After a successful build, the wallet pays a $0.01 upload challenge, then a hosting challenge of $0.20 per project-day: $6.00 for thirty days, $6.01 in total. The upload payment binds the paying wallet as the project owner. One caveat: once the $0.01 upload settles, it is not refundable if server-side publishing later fails, and the first deployment must activate within 30 minutes of that payment.
Every operation has a fixed price
- First deployment: $0.01 upload plus $0.20 × project-days
- New deployment at the same URL: $0.01
- Renewal: $0.20 × additional project-days
- Rollback, transfer, delete: $0.01 each
- Status and deployment-history reads: free, no payment at all
Who signs, and how
The CLI's --payer flag controls the signing wallet: auto by default, env for CI credentials, external for a handoff via --payer-cmd, and awal for the awal agentic wallet CLI. Whatever the mode, every paid mutation after the first must settle from the wallet that paid the first upload, or the API rejects it with wallet_not_owner. Ownership and payment are the same cryptographic identity.
If a payment is interrupted
If the payment client errors mid-operation, the operation is not lost. The agent runs finalize to reconcile the pending operation before attempting another payment, which prevents duplicate charges and duplicate deployments.