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

# Authentication

> How to authenticate with the Muster API.

## Base URL

```
https://app.getmuster.io
```

## Getting a token

```bash theme={null}
curl -X POST https://app.getmuster.io/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username": "you@company.com", "password": "your-password"}'
```

Response:

```json theme={null}
{
  "access_token": "eyJhbGci...",
  "refresh_token": "Lg1wfd1N...",
  "token_type": "bearer",
  "expires_in": 3600
}
```

## Using the token

Include the access token in the `Authorization` header:

```bash theme={null}
curl https://app.getmuster.io/api/v1/agents \
  -H "Authorization: Bearer eyJhbGci..."
```

## Token lifetime

| Token         | Lifetime   |
| ------------- | ---------- |
| Access token  | 60 minutes |
| Refresh token | 30 days    |

## Refreshing tokens

```bash theme={null}
curl -X POST https://app.getmuster.io/auth/refresh \
  -H "Content-Type: application/json" \
  -d '{"refresh_token": "Lg1wfd1N..."}'
```

## Public endpoints

These endpoints do **not** require authentication:

| Endpoint                             | Purpose                   |
| ------------------------------------ | ------------------------- |
| `POST /auth/login`                   | Get tokens                |
| `POST /auth/refresh`                 | Refresh access token      |
| `POST /auth/signup`                  | Create trial account      |
| `POST /api/v1/jobs/{job_id}/quality` | Quality signal ingestion  |
| `POST /api/v1/costs/events`          | Cost event ingestion      |
| `POST /api/v1/agents/beacon`         | Agent beacon registration |
| `GET /health`                        | Health check              |
