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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.shredpay.xyz/agent-wallet/quickstart/direct-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
