> ## 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

> Pay for Syntalic through the AgentCash CLI in three commands.

[AgentCash](https://agentcash.dev) 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 Syntalic.

## 1. Onboard AgentCash

If you've never used AgentCash, get a wallet and free credits in your terminal:

```bash theme={null}
npx agentcash onboard
```

This creates a local wallet and walks you through [agentcash.dev/onboard](https://agentcash.dev/onboard) where social-account verification grants up to **\$25 in free USDC**. Per-query pricing on Syntalic 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 Syntalic to confirm everything's wired up:

```bash theme={null}
npx agentcash try https://api.syntalic.com
```

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 Syntalic in your AgentCash context so your agent always has it available without re-running discovery:

```bash theme={null}
npx agentcash add https://api.syntalic.com
```

After this, your agent (Claude Code, Cursor, etc.) can reach Syntalic automatically when relevant.

<Tip>
  Or click through the same three steps in our [x402scan onboarding card](https://www.x402scan.com/server/fdf15e0c-8d66-49ae-acbb-d872c75e5147) — it generates the exact CLI commands above.
</Tip>

## 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.syntalic.com"

### From code with `wallet.fetch`

`wallet.fetch` is `fetch`-compatible — it auto-handles the 402 → sign → retry loop:

```ts theme={null}
import { wallet } from "@agentcash/sdk";

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

### From the CLI

```bash theme={null}
npx agentcash fetch https://api.syntalic.com/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](/payments/x402) if you want to understand the protocol without the wrapper.

## Next steps

<CardGroup cols={2}>
  <Card title="AgentCash docs" icon="book" href="https://agentcash.dev/docs">
    Wallet management, supported clients, and advanced flows.
  </Card>

  <Card title="x402 protocol" icon="code" href="/payments/x402">
    What AgentCash is doing under the hood.
  </Card>
</CardGroup>
