> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentwallex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference Overview

> Base URLs, authentication, pagination, and error contract for the AgentWallex REST API.

## Base URLs

```
Sandbox:    https://api-sandbox.agentwallex.com/api/v1
Production: https://api.agentwallex.com/api/v1
```

<Note>
  Use the sandbox URL for development and testing. Switch to production only when you are ready to transact with real funds.
</Note>

## Authentication

All API requests must include one of the following authentication headers:

| Method     | Header          | Example                               |
| ---------- | --------------- | ------------------------------------- |
| API Key    | `X-API-Key`     | `X-API-Key: awx_your_api_key`         |
| JWT Bearer | `Authorization` | `Authorization: Bearer eyJhbGciOi...` |

```bash theme={null}
# API key authentication
curl -X GET https://api.agentwallex.com/api/v1/agents \
  -H "X-API-Key: awx_your_api_key"

# JWT authentication
curl -X GET https://api.agentwallex.com/api/v1/agents \
  -H "Authorization: Bearer eyJhbGciOi..."
```

See [Authentication](/introduction/authentication) for full details on obtaining and managing credentials.

## Pagination

All list endpoints support pagination with the following query parameters:

| Parameter   | Default | Max | Description              |
| ----------- | ------- | --- | ------------------------ |
| `page_num`  | 1       | --  | Page number (1-indexed)  |
| `page_size` | 20      | 100 | Number of items per page |

Response format:

```json theme={null}
{
  "data": [],
  "total": 42,
  "has_more": true
}
```

## Error Contract

All errors follow a consistent format:

```json theme={null}
{
  "code": "invalid_request",
  "type": "invalid_request_error",
  "message": "human readable error description"
}
```

### Error Types

| Type                    | HTTP Status | Description                        |
| ----------------------- | ----------- | ---------------------------------- |
| `invalid_request_error` | 400         | Invalid request body or parameters |
| `authentication_error`  | 401         | Missing or invalid credentials     |
| `authorization_error`   | 403         | Insufficient permissions           |
| `not_found_error`       | 404         | Resource does not exist            |
| `rate_limit_error`      | 429         | Rate limit exceeded                |
| `internal_error`        | 500         | Server-side error                  |

See [Error Handling](/guides/error-handling) for detailed guidance on handling errors.

## API Sections

<CardGroup cols={2}>
  <Card title="Agents" icon="robot" href="/api-reference/agents-create">
    Create and manage AI agent wallets.
  </Card>

  <Card title="Transactions" icon="arrow-right-arrow-left" href="/api-reference/transactions-create">
    Send payments and query transaction history.
  </Card>

  <Card title="Policies" icon="shield-check" href="/api-reference/policies">
    Configure spending limits and access controls.
  </Card>

  <Card title="Webhooks" icon="bell" href="/api-reference/webhooks">
    Register and manage webhook endpoints.
  </Card>

  <Card title="x402 Pay" icon="credit-card" href="/api-reference/x402-pay">
    Trigger x402 micropayment negotiation.
  </Card>

  <Card title="x402 Sessions" icon="clock" href="/api-reference/x402-sessions">
    Manage x402 session budgets.
  </Card>
</CardGroup>
