Skip to main content

Documentation Index

Fetch the complete documentation index at: https://crushrewards.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

AgentCash is a third-party x402 client that handles signing, retries, and wallet management for any x402-compatible API. If your agent already uses AgentCash for other paid services, three commands get you set up with Crush Rewards.

1. Onboard AgentCash

If you’ve never used AgentCash, get a wallet and free credits in your terminal:
npx agentcash onboard
This creates a local wallet and walks you through agentcash.dev/onboard where social-account verification grants up to $25 in free USDC. Per-query pricing on Crush Rewards is $0.01–$0.02, so the bonus alone covers thousands of calls. If you already have AgentCash set up, skip to step 2.

2. Try the API

Make one live paid call against Crush Rewards to confirm everything’s wired up:
npx agentcash try https://api.crushrewards.dev
This discovers our endpoints, signs a payment, and prints the response. Use it to sanity-check the integration before writing any code.

3. Add for reuse

Register Crush Rewards in your AgentCash context so your agent always has it available without re-running discovery:
npx agentcash add https://api.crushrewards.dev
After this, your agent (Claude Code, Cursor, etc.) can reach Crush Rewards automatically when relevant.
Or click through the same three steps in our x402scan onboarding card — it generates the exact CLI commands above.

Calling the API

After step 3, you can reach the API three ways:

From your agent in plain English

“Use AgentCash to fetch the cheapest AirPods Pro from api.crushrewards.dev”

From code with wallet.fetch

wallet.fetch is fetch-compatible — it auto-handles the 402 → sign → retry loop:
import { wallet } from "@agentcash/sdk";

const res = await wallet.fetch(
  "https://api.crushrewards.dev/v1/shopper/best-price?q=airpods+pro&country=US"
);
const data = await res.json();

From the CLI

npx agentcash fetch https://api.crushrewards.dev/v1/shopper/best-price?q=airpods+pro

What happens behind the scenes

  1. The first request returns 402 Payment Required with the price (e.g. $0.01) and recipient addresses for x402.
  2. AgentCash signs a USDC transfer authorization on the chain with the lowest fees + sufficient balance (Solana → Base fallback).
  3. AgentCash retries the request with an X-Payment header carrying the signed authorization.
  4. Our server verifies the signature, settles on-chain (~1–2s), and returns the response body.
You don’t manage signing keys; AgentCash does. See x402 details if you want to understand the protocol without the wrapper.

Next steps

AgentCash docs

Wallet management, supported clients, and advanced flows.

x402 protocol

What AgentCash is doing under the hood.