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

# Overview

> Authenticate cloud REST API requests with API keys or personal tokens, and handle errors and pagination.

<Note>
  microsandbox cloud is in [private beta](/cloud/overview); the API is available to organizations with access.
</Note>

The microsandbox cloud REST API manages sandboxes and the accounts around them. Use it directly when an SDK does not cover your workflow, or when you need account, billing, or audit endpoints.

For running code in sandboxes (exec, streaming, PTY, file transfer, SSH), use the [SDKs](/sdk/overview) or [CLI](/cli/overview). They speak the sandbox command channel, which is not part of this REST surface.

## Credentials

The sidebar separates endpoints by who the request represents:

| Credential | Format | Represents | Use for |
| - | - | - | - |
| API key | `msb_...` | An organization | Services, SDKs, CLI automation, and organization resources |
| Personal token | `msb_pat_...` | A user | Account and organization administration |

API keys and personal tokens are both sent as bearer tokens:

```bash theme={null}
curl https://api.microsandbox.dev/v1/sandboxes \
  -H "Authorization: Bearer $MSB_API_KEY"
```

API keys are created in the [dashboard](https://dashboard.microsandbox.dev/access/api-keys). API-key paths infer the organization from the key. Personal-token paths include the organization slug when the request needs an organization.

## Base URL

```text theme={null}
https://api.microsandbox.dev
```

## Errors

Errors return an `error` object with a stable machine-readable `code`, a human-readable `message`, and optional structured `details`:

```json theme={null}
{
  "error": {
    "code": "invalid_api_key",
    "message": "unauthorized",
    "details": null
  }
}
```

## Pagination

List endpoints use cursor pagination. Pass `limit` to size the page and `cursor` to continue from a previous response:

```json theme={null}
{
  "data": [ ... ],
  "has_more": true,
  "next_cursor": "eyJv..."
}
```

Request the next page with `?cursor=<next_cursor>`; `has_more: false` means you have everything.

## Usage and billing

The usage endpoints report metered consumption for the current period. Reported cost figures are estimates; the [dashboard](https://dashboard.microsandbox.dev/billing) is the source of truth for billing.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.