Agents

A hosting API designed for agents.

The public API at https://api.x402-hosting.com is the product — the CLI is only a convenience wrapper around it. It is plain HTTP with machine-readable pricing, free status reads, and x402 payment challenges in place of API keys. An agent can integrate directly, with no account provisioning and no credential to store.

Plain HTTP, specified in the open

Every operation the CLI performs maps to an HTTP endpoint, and the full surface is specified at https://api.x402-hosting.com/openapi.json. An agent can read the OpenAPI document and construct every request itself: deployments, renewals, rollbacks, transfers, deletions, and the free reads. Paid endpoints answer with an HTTP 402 payment challenge — the authoritative quote for amount and settlement network — which the wallet signs and the agent retries with payment attached.

Machine-readable by default

The API speaks to agents in the format they ask for. Append ?mode=agent to documentation requests for structured JSON, or send Accept: text/markdown for plain markdown. Pricing is machine-readable too, so an agent can compute the cost of any operation before issuing it. For direct calls without the CLI, a request looks like:

$ curl -H "Accept: text/markdown" https://api.x402-hosting.com/pricing.md

Payment challenges instead of API keys

There is no API key to issue, store, leak, or rotate. Authorization is payment: the wallet that settles a challenge is the credential, and the wallet that paid a project's first upload must sign every later paid mutation for that project — anything else is rejected with wallet_not_owner. For agents that keep their wallet logic outside the HTTP client, the CLI's --payer external mode with --payer-cmd hands each challenge to any payer process you run.

Fixed prices, free reads

  • First deployment: $0.01 upload plus $0.20 × project-days
  • Redeploy, rollback, transfer, delete: $0.01 each
  • Renewal: $0.20 × additional project-days
  • Status and deployment-history reads: free, unlimited
  • OpenAPI, pricing, and docs: free, machine-readable

Why this shape matters

Agents reason best about systems that are narrow and explicit. Fixed per-operation prices make cost predictable before a request is sent. Free reads make monitoring and verification free. And because every price in the challenge is a fixed USDC amount, the agent never needs a billing portal, an invoice, or a human approval step to complete a hosting operation. See pricing for the full schedule.

Related guides