/api/fortune.paid("0.001")Fixed-price fortune. x402 exact (Base) or MPP one-shot (Tempo).
npx agentcash fetch https://agentcash-fortune-demo3.vercel.app/api/fortune --method POST -p x402
A pay-per-call API on x402 and MPP, deployed live at https://agentcash-fortune-demo3.vercel.app.
The fastest path is the AgentCash CLI — a single wallet, no API keys, all endpoints work out of the box.
npx agentcash fetch https://agentcash-fortune-demo3.vercel.app/api/fortune --method POST -p x402
Or with curl — the router returns an HTTP 402 challenge you can settle manually:
curl -X POST https://agentcash-fortune-demo3.vercel.app/api/fortune
Every route demonstrates a different @agentcash/router pricing or auth mode. Source: app/api/fortune/.
/api/fortune.paid("0.001")Fixed-price fortune. x402 exact (Base) or MPP one-shot (Tempo).
npx agentcash fetch https://agentcash-fortune-demo3.vercel.app/api/fortune --method POST -p x402
/api/fortune/premium.upTo("0.005")Handler-driven metered pricing settled with EIP-2612 gas-sponsoring on Base.
npx agentcash fetch https://agentcash-fortune-demo3.vercel.app/api/fortune/premium --method POST -p x402 -b '{"category":"love"}'/api/fortune/llm.metered({ unitType: "request" })MPP session, request-mode metered billing. Returns 503 until MPP_OPERATOR_KEY is set.
npx agentcash fetch https://agentcash-fortune-demo3.vercel.app/api/fortune/llm --method POST -p mpp -b '{"prompt":"Will I find love?"}'/api/fortune/stream.metered({ unitType: "token" }).stream()MPP session, SSE streaming with per-token billing. Returns 503 until MPP_OPERATOR_KEY is set.
npx agentcash fetch https://agentcash-fortune-demo3.vercel.app/api/fortune/stream --method POST --stream -b '{"prompt":"What awaits me?"}'/api/fortune/dynamic.paid(pricingFn)Body-derived pricing with pre-payment validation.
npx agentcash fetch https://agentcash-fortune-demo3.vercel.app/api/fortune/dynamic --method POST -b '{"category":"love","depth":"detailed"}'/api/fortune/membership.upTo("0.005").siwx()Pay once via x402; subsequent calls replay free with a SIWX signature.
npx agentcash fetch https://agentcash-fortune-demo3.vercel.app/api/fortune/membership --method POST -p x402
/api/fortune/profile.siwx()Verified wallet identity, no payment.
npx agentcash fetch https://agentcash-fortune-demo3.vercel.app/api/fortune/profile --method GET
/api/fortune/favorites.siwx()Save a favorite fortune (SIWX, no payment).
npx agentcash fetch https://agentcash-fortune-demo3.vercel.app/api/fortune/favorites --method POST -b '{"fortune":"A good day awaits"}'Agents discover this API by reading /openapi.json. The router emits an OpenAPI 3.x spec annotated with AgentCash pricing and auth extensions — drop it in agentcash discover or any compatible crawler.
/openapi.jsonAgentCash Discovery — OpenAPI 3.x with pricing extensions./llms.txtAgent-readable usage guidance.app/api/fortune/* to replace the demo handlers with your real endpoints.lib/router.ts with your API title, description, and agent-guidance string.Full docs: agentcash.dev/docs · github.com/Merit-Systems/agentcash-router