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

# Onstacks API

> Build workspace-controlled wallets, transfers, and provider routing with the Onstacks control plane.

Onstacks is the control plane for workspace identity, wallet operations, transfers, webhooks, and provider routing.

Frontend apps call the Onstacks backend. The backend owns application identity, workspace authorization, wallet state, and money-moving orchestration. Privileged wallet operations do not run directly from the frontend.

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Sign in, exchange a session token, and make your first authenticated request.
  </Card>

  <Card title="Authentication" icon="key-round" href="/guides/authentication">
    Use workspace API keys as bearer tokens for API requests.
  </Card>

  <Card title="Wallets and balances" icon="wallet" href="/guides/wallets-and-balances">
    Create wallets, derive accounts, read balances, and manage address book entries.
  </Card>

  <Card title="Transfers" icon="arrow-right-left" href="/guides/transfers">
    Preview withdrawals, create transfers, approve or cancel transfers, and reconcile status.
  </Card>
</CardGroup>

## Core concepts

* A **workspace** scopes API keys, webhooks, wallets, balances, transfer policy, and environment settings.
* An **API key** authenticates requests with `Authorization: Bearer <api_key>`.
* An **environment** partitions mutable platform resources. Use `environment=sandbox` for tests and `environment=live` for production operations.
* A **wallet** is an Onstacks record linked to BlockOps custody infrastructure.
* A **wallet account** is an asset and network-specific deposit lane.
* A **transfer** records the local lifecycle before and after provider submission.

## Base URL

Local development runs on:

```text theme={null}
https://api.onstacks.io
```

Use the environment-specific production base URL supplied by your Onstacks deployment.

## Response format

Successful responses use a consistent envelope:

```json theme={null}
{
  "data": {},
  "error": null,
  "request_id": "req_..."
}
```

Errors return `data: null` and an `error` object:

```json theme={null}
{
  "data": null,
  "error": {
    "code": "unauthorized",
    "message": "Caller is not authenticated"
  },
  "request_id": "req_..."
}
```
