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

# API Reference

> Chamber REST API for programmatic access to GPU capacity and workload management

The Chamber API provides programmatic access to manage GPU capacity, monitor workloads, and query metrics across your organization.

## Base URL

```
https://api.usechamber.io/v1
```

## Authentication

All API requests (except `/v1/health`) require authentication using a Bearer token.

```bash theme={null}
curl -X GET "https://api.usechamber.io/v1/workloads" \
  -H "Authorization: Bearer <your-token>" \
  -H "X-Organization-Id: <your-org-id>"
```

### Required Headers

| Header              | Required | Description                                            |
| ------------------- | -------- | ------------------------------------------------------ |
| `Authorization`     | Yes      | Bearer token (JWT from Cognito or API token)           |
| `X-Organization-Id` | Yes\*    | Your organization ID (\*not required for `/v1/health`) |
| `X-Request-Id`      | No       | Optional request ID for tracing                        |

<Tip>
  Contact [support@usechamber.io](mailto:support@usechamber.io) to obtain API credentials for your organization.
</Tip>

## Response Format

All successful responses follow a consistent structure:

```json theme={null}
{
  "data": {
    // Response content
  },
  "metadata": {
    "next_token": "...",
    "total_count": 100
  },
  "request_id": "req_abc123"
}
```

### Error Responses

Errors return an appropriate HTTP status code with details:

```json theme={null}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid parameter value",
    "details": [...]
  },
  "request_id": "req_abc123"
}
```

## Authorization Model

Access to resources is controlled by your role within the organization:

| Role        | Access Level                                      |
| ----------- | ------------------------------------------------- |
| `ORG_ADMIN` | Full organization access                          |
| `TEAM_LEAD` | Team-specific access with management capabilities |
| `MEMBER`    | Team-specific read access                         |

## Endpoints

<CardGroup cols={2}>
  <Card title="Workloads" icon="microchip" href="/api-reference/workloads">
    List, retrieve, and get statistics for GPU workloads
  </Card>

  <Card title="Metrics" icon="chart-line" href="/api-reference/metrics">
    Query GPU utilization, memory, temperature, and power metrics
  </Card>

  <Card title="Capacity" icon="server" href="/api-reference/capacity">
    Check budget allocations and remaining GPU hours
  </Card>

  <Card title="Health" icon="heart-pulse" href="/api-reference/health">
    Service health check endpoint
  </Card>
</CardGroup>
