> For the complete documentation index, see [llms.txt](https://developers.shredpay.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.shredpay.xyz/agent-wallet/quickstart/direct-api.md).

# Direct API

Make your first authenticated request in under a minute.

## 1. Create an API key

1. Sign in to the [Agent Console](https://console.shredpay.xyz).
2. Create a sub-wallet if you don't have one yet.
3. Open **API Keys → New key**. Pick:
   * **Name** — something memorable, e.g. `quickstart-laptop`.
   * **Permissions** — `read` is enough for this quickstart.
   * **Allowed chains** — leave the default (all supported) or restrict.
   * **Daily / monthly limits** — any value; reads don't consume them.
4. Copy the `sk_live_…` value. **It is shown only once.**

```bash
export SHREDPAY_API_KEY="sk_live_..."
export SHREDPAY_BASE_URL="https://agent-api.shredpay.xyz"
```

## 2. Fetch your wallet addresses

```bash
curl "$SHREDPAY_BASE_URL/api/wallet/address" \
  -H "X-Api-Key: $SHREDPAY_API_KEY"
```

```json
{
  "addresses": {
    "evm": "0xA1b2C3d4e5F60718293A4B5c6d7E8f9012345678"
  },
  "sub_wallet_id": "sw_01HRZK..."
}
```

The same EVM address is used across every chain.

## 3. Check a balance

```bash
# USDC on Base
curl "$SHREDPAY_BASE_URL/api/wallet/balance?chain_id=8453&token=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" \
  -H "X-Api-Key: $SHREDPAY_API_KEY"
```

```json
{
  "chain_id": 8453,
  "token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "balance": "1500000",
  "decimals": 6,
  "symbol": "USDC"
}
```

`balance` is always in the smallest unit (here, 1.5 USDC = 1,500,000).

## 4. Send a transaction

> Requires a key with `trade` permission and a funded sub-wallet (USDC + a small amount of native gas, or use [`gas_swap`](/agent-wallet/guides/gas-management.md) on Base).

The example below transfers 0.10 USDC to another address on Base.

```bash
# ERC20 transfer(address,uint256) calldata for 100000 (= 0.10 USDC)
TO_TOKEN=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
RECIPIENT=0x000000000000000000000000abc123...           # 32-byte right-padded
AMOUNT=00000000000000000000000000000000000000000000000000000000000186a0
DATA="0xa9059cbb${RECIPIENT}${AMOUNT}"

curl "$SHREDPAY_BASE_URL/api/tx/send" \
  -H "X-Api-Key: $SHREDPAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"chain_id\": 8453,
    \"to\": \"$TO_TOKEN\",
    \"data\": \"$DATA\",
    \"value\": \"0\"
  }"
```

```json
{
  "tx_id": "tx_01HRZL...",
  "tx_hash": "0xa3b4...",
  "status": "broadcast"
}
```

Poll status with `GET /api/tx/{tx_id}` or — better — register a [webhook](/agent-wallet/guides/webhooks.md) and let ShredPay push the confirmation.

## What just happened

1. Your `X-Api-Key` resolved to a sub-wallet.
2. Spend limits were checked (here, the value is denominated and counted).
3. The recipient address was screened.
4. ShredPay co-signed alongside Privy (2/2 quorum).
5. The signed tx was broadcast on Base and an ID was returned.

## Next steps

* [Send a Transaction guide](/agent-wallet/guides/send-transaction.md) — full request/response with error handling.
* [Swap Tokens guide](/agent-wallet/guides/swap.md) — sponsored swaps via Router.
* [API Reference](/agent-wallet/api-reference.md) — every endpoint and field.
