@agentcash/router · Vercel template

Fortune Demo

A pay-per-call API on x402, deployed live at https://fortune.fulinlabs.com.

Try it

Every endpoint settles with x402 exact — USDC on Base. The fastest path is the AgentCash CLI, which reads the 402 challenge and settles it from a local wallet. With curl you get the raw challenge back and settle it yourself.

npx agentcash fetch https://fortune.fulinlabs.com/api/fortune --method POST -p x402

Endpoints

Each route demonstrates a different @agentcash/router pricing mode. Source: app/api/fortune/.

POST/api/fortune.paid("0.001")$0.001

Random fortune at a fixed price.

npx agentcash fetch https://fortune.fulinlabs.com/api/fortune --method POST -p x402
POST/api/fortune/premium.paid("0.005")$0.005

Category fortune with pre-payment rate limiting.

npx agentcash fetch https://fortune.fulinlabs.com/api/fortune/premium --method POST -p x402 -b '{"category":"love"}'
POST/api/fortune/dynamic.paid(pricingFn)$0.01 – $0.05

Body-derived pricing with pre-payment validation.

npx agentcash fetch https://fortune.fulinlabs.com/api/fortune/dynamic --method POST -p x402 -b '{"category":"love","depth":"detailed"}'

Discovery

Agents discover this API by reading /openapi.json. The router emits an OpenAPI 3.x spec annotated with AgentCash pricing extensions — drop it in agentcash discover or any compatible crawler.

/openapi.jsonAgentCash Discovery — OpenAPI 3.x with pricing extensions.
/llms.txtAgent-readable usage guidance.

Customize

  1. Edit app/api/fortune/* to replace the demo handlers with your real endpoints.
  2. Update lib/router.ts with your API title, description, and agent-guidance string.
  3. Push to GitHub. Vercel redeploys automatically.
  4. Once you're on a real domain, register with the explorers so agents can find you: x402scan.

Full docs: agentcash.dev/docs · github.com/Merit-Systems/agentcash-router