Agents

Deploy Next.js from Claude Code.

Claude Code can take your Next.js project from a local directory to a production URL inside the same session. It runs one command — npx x402-hosting@latest deploy --days 30 — and pays the hosting invoice in USDC over the x402 protocol. Thirty days costs $6.01. There is nothing to configure in advance: no API key, no account, no dashboard login.

How Claude Code learns the protocol

The service is documented for machines first. An agent skill is published at /skills/x402-hosting/SKILL.md and on skills.sh, so Claude Code can load the exact deploy, renew, and rollback workflows. Without the skill, it can still read /llms.txt and the docs, which describe the same commands in plain text. There is no setup step before the first deploy.

The deploy in one session

Ask Claude Code to put the app online and it runs the command from the project root:

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

The CLI builds the project locally with OpenNext, and only after the build succeeds does the API return an HTTP 402 payment challenge — $0.01 for the first upload plus $0.20 per project-day. The platform then publishes the artifact as a Cloudflare Worker. A local build failure costs nothing, and the challenge is the authoritative quote before any wallet signs.

Payer options for the wallet side

Payment settles from a wallet, and Claude Code has options for how. The default --payer auto mode handles it when a local wallet is available. The awal mode uses the awal agentic wallet CLI as payer. The external mode hands the challenge to a payer you run yourself through a --payer-cmd template — useful when the wallet lives outside the agent's environment. --payer and --payer-cmd are mutually exclusive.

What comes back

  • A stable URL like https://app-682fe91de571a7338dd1.x402-hosting.com
  • Static assets, 100,000 dynamic requests, 15M CPU milliseconds
  • x402-hosting.json in the project root: URL, id, owner, expiry
  • Free status and deployment-history reads for verification
  • Redeploys at the same URL for $0.01

Supported Next.js versions are 15.5.21 up to (but not including) 16, and 16.2.11 and later. The wallet that pays the first upload owns the project, so keep the paying wallet consistent across sessions — every later paid mutation must settle from it.

Related guides