Agents

Let an agent do the hosting for you.

When you tell a coding agent to put your Next.js app online, it can actually finish the job: it runs one command, pays the hosting invoice in USDC over the x402 protocol, and reports a production URL back in the chat. Thirty days of hosting costs $6.01, prepaid. No account is created, no dashboard is opened, and no API key is configured.

Next.js projectlocal OpenNext buildCloudflare Workerproduction URL
One command moves a Next.js project from a local directory to a production URL.

What you say, what the agent does

The interaction is one sentence: "put this online." The agent works out the rest. From the project root it runs:

$ npx x402-hosting@latest deploy --days 30

The CLI builds the app locally with OpenNext, and only after the build succeeds does the API answer with an HTTP 402 payment challenge. The challenge is the authoritative quote — $0.01 for the first upload plus $0.20 per project-day — and the wallet pays it in USDC. The platform then publishes the artifact as a Cloudflare Worker. A local build failure costs nothing, so a broken project never reaches payment.

Where the payment comes from

Payment settles from a wallet, not a card on file. The CLI's --payer flag controls how: auto is the default, awal uses the awal agentic wallet CLI, env reads credentials from the environment for CI, and external hands the challenge to a payer you run yourself via --payer-cmd. In every mode the wallet that pays the first upload becomes the project owner, and later paid mutations must settle from the same wallet.

What you get back

The agent reads the result and hands you a stable URL likehttps://app-682fe91de571a7338dd1.x402-hosting.com. An active project includes its static assets, 100,000 dynamic requests, and 15 million CPU milliseconds — enough for server components, route handlers, and server actions in production.

Why the next operation is reproducible

A successful first deploy writes x402-hosting.json to the project root: the URL, project id, owner wallet, and expiry. It contains no secret, so it stays in the repository. Every later operation — redeploy, renew, rollback, transfer, delete — reads that record, which means any future agent session can pick up exactly where this one left off. The full command surface is documented in the docs.

The flow in short

  • You say: put this online
  • The agent runs npx x402-hosting@latest deploy --days 30
  • Local build runs first — a failure costs nothing
  • The wallet signs the 402 challenge: $6.01 for 30 days
  • The agent reports the production URL
  • x402-hosting.json records the project for every future operation

Related guides