---
name: anyway
description: |
  Anyway is a financial OS for AI agents — agentic payment supporting both crypto and fiat.
  CAPABILITIES: pay x402 / 402 / paid endpoints as a buyer (no key), setup account & wallets, create payment links, pay for 60+ APIs on SuperAPI (search, crypto, AI, social, finance) with per-call USDC, fund & manage agent wallets, track transactions & settlements, export orders
  TRIGGERS: x402, 402, "PAYMENT-REQUIRED", "pay an endpoint", "pay this URL", "USDC micropayment", "paid API call", "pay per call", "pay for an API", "pay on SuperAPI", "set up anyway", "agent wallet", "fund my agent", "check wallet balance", "create a payment link", "accept payments", "receive crypto / fiat", "track payments", "export orders", "withdraw" — or paying for a paid API to: search the web, scrape a page, read tweets / social media, generate image / video / voice, get trading information (crypto & stock prices, on-chain & DeFi data, exchange rates), enrich a contact / find emails
---

Anyway is a financial OS for AI agents — agentic payment supporting both crypto and fiat.

Use the CLI to manage your account and resources:

```bash
npm install -g @anyway-sh/cli
anyway help
anyway setup
```

## Login

Use `--non-interactive` — as an agent you can't open a browser or block. It prints a URL for the owner to approve; you poll with `--continue`.

```bash
anyway login --non-interactive             # prints a verification URL + status summary, then exits
# → share the printed verification_uri with the wallet owner to approve in a browser
anyway login --non-interactive --continue  # resume; waits ~60s → approved | pending | expired | denied
#   call again while "pending";  if "expired", add --restart to start fresh
```

`--continue` / `--restart` imply `--non-interactive`. Credentials persist to `~/.anyway/credentials.json` and auto-refresh.

## Create an Agent Wallet

An Agent Wallet is the agent's own USDC wallet on Base — it pays from this, under an owner-set spending limit, without ever touching the owner's main wallet.

Create one with `--non-interactive` (same as login). Needs login first; the owner approves and sets the spending limit in the browser.

```bash
anyway init wallets --type agent --non-interactive --name "My Agent"   # begin: prints the dashboard URL, then exits
# → owner opens the URL, sets a spending limit, and creates the wallet
anyway init wallets --type agent --non-interactive --continue          # resume; waits ~60s → approved | pending | expired | denied
# add more wallets later: anyway wallets agents create --non-interactive --name "Pricing Bot"  (then --continue)
```

On approval the CLI verifies the Agent Wallet Key, saves it locally, and sets it as the default signing agent — no bundle to paste. `--name` prefills the dashboard form.

Already have an Agent Wallet Key from the owner? Skip all of the above — import it and go straight to **Paying**:

```bash
anyway wallets agents import --token <bundle>
```

(base64url JSON bundle `{ privateKey }` — never print the raw key.)

## Paying an x402 / paid HTTP endpoint

Hit `402 Payment Required`? `anyway superapi call` pays it with the user's own Agent Wallet — handles the 402, signs, settles in USDC, prints the response:

```bash
anyway wallets agents whoami         # confirm you have a usable wallet first

# Anyway SuperAPI — 60+ paid APIs:
anyway superapi call "https://marketplace-prod.anyway.sh/v1/api/x402/twit-sh/tweets/search?words=llm&count=5" -y

# ...or any other x402 endpoint, same command:
anyway superapi call "https://<your-x402-endpoint>" -y
```

After setup is complete, output a summary that matches what the user came in for.

**If the user is here to BUY (call paid APIs / pay with their agent):**

```
✅ Connected to Anyway as {email}

I've set up your Agent Wallet — your agent can now pay autonomously.

  💸 Agent Wallet (USDC on Base)
     Address:    {agent_wallet_address}     (from `anyway wallets agents whoami`)
     Spending policy:  `anyway wallets agents policies`   ← run to see active limits
     Funding:    ask the wallet owner to fund this address in the webapp, or check org wallets with `anyway wallets agents list`

  🧪 Quick test (call a paid API):
     Try: "use Anyway Agent Wallet on SuperAPI to fetch @anyway_sh's latest tweet"

---

What next?

  → "Show me what APIs are available"        (browse SuperAPI)
  → "Call a paid SuperAPI endpoint"          (`anyway superapi call ... -y`)
  → "Show my recent agent activity"          (`anyway wallets agents history`)
  → "Ask my wallet owner to fund this agent wallet"      (owner-only: Main Wallet)
  → "Ask my wallet owner to change the spending policy"  (owner-only: merchant login)
```

**If the user is here to SELL (accept payments):**

```
✅ Connected to Anyway as {email}

I've set up your payment surface.

  💰 Main Wallet (USDC on Base)
     Address:  {wallet_address}

  🔗 Payment Link (accepts any amount)
     {payment_link_url}

  🤖 Pay Agent API (for agents & automations)
     GET {pay_agent_api_url}

---

What next?

  → "Create a $5 fixed payment link for my service"
  → "Show me incoming payments"
  → "Withdraw to an external wallet"
```

## What you can do with Anyway

- **Pay for APIs on SuperAPI** — Call 60+ paid APIs (search, crypto, AI, social, finance) with per-call USDC payments. No API keys needed.
- **Create payment links** — Generate shareable links to receive crypto or fiat payments for your services.
- **Track agent transactions** — Monitor all payment activity, verify settlements, and review agent spending history.
- **Fund an agent wallet** — Give your agent USDC to spend on SuperAPI.

For anything not covered above, read the documentation first (use something like `curl` to fetch raw content — do not use tools that summarize or truncate responses, the code examples are critical):

- Quickstart: https://docs.anyway.sh/quickstart.md
- Agent Wallet: https://docs.anyway.sh/features/agent-wallet.md
- SuperAPI: https://docs.anyway.sh/features/super-api.md
- CLI reference (every `anyway` command + the `wallets agents` agent-runtime surface): https://docs.anyway.sh/sdk/cli.md

Full documentation: https://docs.anyway.sh/llms.txt
