setup-x402

setup-x402 is a command for Claude Code from GeckoVision/gecko-surf. It costs 69 tokens per session (589 once invoked), scanned A, original, Apache-2.0.

A command for adding x402 pay-per-call payments to an API that is already agent-ready. It uses PayAI and tests the payment flow locally before any real payment is made.

In plain words
What is it for?
Use it after making an API agent-ready to mark paid operations, connect the provider's x402 endpoint, verify the 402-to-200 flow in stub mode, and prepare live setup.
Why use it?
It removes the manual work of connecting priced API operations and checking that payment challenges and provider details are correct. Offline testing helps catch mistakes without spending money.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the gecko-surf plugin — 6 skills, 2 commands, 2 agents shipped together

Good fit Use it after making an API agent-ready to mark paid operations, connect the provider's x402 endpoint, verify the 402-to-200 flow in stub mode, and prepare live setup.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/geckovision/gecko-surf/setup-x402
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/GeckoVision/gecko-surf

Made for: Claude Code.

Or install gecko-surf, the plugin that ships this one along with the rest of its 6 skills, 2 commands, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for setup-x402

README.md
[![agentmods](https://agentmods.dev/badge/commands/geckovision/gecko-surf/setup-x402.svg)](https://agentmods.dev/commands/geckovision/gecko-surf/setup-x402)
Your own site
<a href="https://agentmods.dev/commands/geckovision/gecko-surf/setup-x402"><img src="https://agentmods.dev/badge/commands/geckovision/gecko-surf/setup-x402.svg" alt="Measured on agentmods" height="20"></a>
Per session 69 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 589 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00069 $0.00589
Opus 5 $0.00034 $0.00295
Sonnet 5 $0.00014 $0.00118
Haiku 4.5 $0.00007 $0.00059

Measured 8d ago against content hash 42ab96db1ea7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

setup-x402 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/commands/setup-x402.md · 42 lines

What it actually says

/setup-x402

Wire x402 micropayments onto a provider's API via PayAI, offline-first. Run /make-agent-ready first — this assumes the API is already comprehended and served.

Argument: the API (already agent-ready) whose priced operations you're wiring.

Steps

  1. Map priced ops. With the provider, decide which comprehended operations are priced vs free. Capture, per priced op, the amount (atomic units), the asset, and the provider's payTo address. These are the provider's values, not Gecko's.
  2. Wire x402 via PayAI. Point the agent-facing tool at the provider's own x402-priced endpoint and surface the 402 challenge so the agent knows to pay. Confirm the PayAI facilitator URL/SDK against live docs; flag anything unverified <!-- VERIFY -->. Gecko hosts no payment endpoint. (See skills/x402-payai-setup/wire-x402-payai.md.)
  3. Verify offline. Keep the default X402_MODE=stub. Run the full 402 → pay → 200 shape with no spend and assert: 402 well-formed, amount in atomic units, payTo is the provider's, paid→200, no secret leaks. (See skills/x402-payai-setup/verify-paid-call.md.)
  4. Hand off for live (founder-gated). Prepare the go-live command; the founder sets X402_MODE live and broadcasts. One live smoke, then stop. Claude never signs or broadcasts.

Notes

  • Compose the rail, take no cut. Money flows agent → provider, settled by PayAI. Gecko is never in the money path; the provider keeps 100%.
  • payTo is the provider's, never Gecko's. If it ever isn't, that's a bug.
  • Default X402_MODE=stub; never flip to live without founder go-ahead. Never sign or broadcast — founder-run only.
  • Offline-first (Pattern B). The stub handshake is the deliverable and the debugger; live smoke is the final confirmation.
  • Status: the handshake shape + offline verification are buildable today; live PayAI settlement is Building / founder-gated. Don't overclaim.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 42 lines · 69 tokens per session scan A 42ab96db1ea7

Subscribe to this mod's changes

setup-x402 is a command published in the GitHub repository GeckoVision/gecko-surf (6 stars, last pushed today), licensed Apache-2.0. It adds 69 tokens to every session and 589 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.