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

# API Reference

> Complete REST API reference for Hexel Studio.

The Hexel Studio API provides programmatic access to all platform capabilities. Every feature in the docs and Console is backed by this API.

## Base URLs

All API calls (except agent traffic) go through a single gateway host. Deployed-agent and sandbox traffic use separate subdomain endpoints.

| Surface                                       | Base URL                                              |
| --------------------------------------------- | ----------------------------------------------------- |
| Compute, Registry, Orchestration, Tools, Data | `https://api.hexelstudio.com`                         |
| Token service (STS)                           | `https://sts.hexelstudio.com`                         |
| Running agent traffic                         | `https://agent-<name>-<hash>.compute.hexelstudio.com` |
| Running sandbox traffic                       | `https://sandbox-<id>.compute.hexelstudio.com`        |

## Path prefixes

| Product                       | Prefix              |
| ----------------------------- | ------------------- |
| Compute                       | `/compute/v1/`      |
| Agent Registry                | `/registry/v1/`     |
| Orchestration (tasks, fleets) | `/orchestrator/v1/` |
| Approvals                     | `/v1/approvals/`    |
| Policies                      | `/v1/policies/`     |
| Tool Gateway                  | `/tools/v1/`        |
| Data Platform                 | `/data/v1/`         |

## Authentication

Every request requires a Bearer token obtained from the STS. Exchange your API key or OAuth client credentials for a short-lived token (valid 15 minutes):

```bash theme={"dark"}
# API key exchange
TOKEN=$(curl -s -X POST https://sts.hexelstudio.com/token \
  -H "X-API-Key: YOUR_API_KEY" | jq -r .access_token)

# Use the token
curl https://api.hexelstudio.com/compute/v1/instances \
  -H "Authorization: Bearer $TOKEN"
```

The SDKs handle token exchange and refresh automatically. See [Authentication](/docs/getting-started/authentication) for OAuth client credentials and environment variable configuration.

## Error responses

Each service returns a consistent error body, but the exact shape varies by product:

| Product                    | Error shape                                                                                    |
| -------------------------- | ---------------------------------------------------------------------------------------------- |
| Compute                    | `{ "error": "code", "message": "..." }`                                                        |
| Data Platform              | `{ "error": { "code": "DOMAIN.CODE", "message": "...", "request_id": "...", "details": {} } }` |
| Tool Gateway               | `{ "error": { "code": "CODE", "message": "..." } }`                                            |
| Orchestration (rate limit) | `{ "error": "rate limit exceeded", "limit": N, "window_seconds": N }`                          |

<Tip>
  The Data Platform error shape includes `request_id`. Include it when contacting support — it ties directly to the failing request in platform logs.
</Tip>

## Rate limits

| Product       | Limit                                                                    |
| ------------- | ------------------------------------------------------------------------ |
| Data Platform | 10,000 requests / organization / hour                                    |
| Orchestration | 100 requests / organization / minute                                     |
| Compute       | Per-organization quota (see [Tiers & Limits](/docs/billing/tiers-and-limits)) |

Exceeding a limit returns `429`. The response includes `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `Retry-After` headers where applicable.

## Browse the reference

Use the sidebar to browse each endpoint group. Every endpoint has an interactive playground where you can send real requests and inspect responses.

| Group          | Description                                             |
| -------------- | ------------------------------------------------------- |
| Sandboxes      | Allocate, execute, renew, release isolated environments |
| Agents         | Register and manage agent images in the registry        |
| Instances      | Deploy agents to permanent endpoints                    |
| Skills         | Publish and manage reusable capabilities                |
| Usage          | Query compute consumption by tier and time range        |
| Access Clients | Manage OAuth clients for M2M access                     |
