# Billing

Your usage, and the service levels.

Paths start at `$ACTIVQC_BASE_URL`, and every call sends `Authorization: Bearer $ACTIVQC_KEY`. Errors use the [error envelope](https://activqc.wavbee.com/docs/errors.md). [All endpoints](https://activqc.wavbee.com/docs/api-reference.md).

## GET /v1/usage

Metered usage for the current period.

**Auth:** a secret key, `Authorization: Bearer $ACTIVQC_KEY`.

#### Parameters

| Name | In | Type | Description |
|---|---|---|---|
| `period` | query | string |  |

#### Example request

```bash
curl -s "$ACTIVQC_BASE_URL/v1/usage" \
  -H "Authorization: Bearer $ACTIVQC_KEY"
```

#### Responses

| Status | Meaning |
|---|---|
| `200` | Usage, derived from the same meter events the invoice sees. |

#### Response `200`

| Field | Type | Description |
|---|---|---|
| `period` | object | **Required.** |
| `period.start` | string |  |
| `period.end` | string |  |
| `included_units` | integer | **Required.** Example `10000`. |
| `used_units` | integer | **Required.** Example `6431`. |
| `by_tier` | object | Units per tier SKU. |
| `overage_units` | integer |  |
| `billable_replays` | integer | Always 0 — an idempotent replay never meters. |

```json
{
  "period": {
    "start": "string",
    "end": "string"
  },
  "included_units": 10000,
  "used_units": 6431,
  "by_tier": {},
  "overage_units": 1,
  "billable_replays": 1
}
```

## GET /v1/sla

Measured fast-lane latency percentiles.

**Auth:** a secret key, `Authorization: Bearer $ACTIVQC_KEY`.

#### Example request

```bash
curl -s "$ACTIVQC_BASE_URL/v1/sla" \
  -H "Authorization: Bearer $ACTIVQC_KEY"
```

#### Responses

| Status | Meaning |
|---|---|
| `200` | Percentiles; null until the sample is large enough to be evidence. |

#### Response `200`

| Field | Type | Description |
|---|---|---|
| `p50_ms` | integer or null |  |
| `p95_ms` | integer or null |  |
| `sample_size` | integer | **Required.** |
| `sufficient` | boolean | False when the sample is too small to publish. |
| `window` | object |  |
| `window.start` | string (date-time) |  |
| `window.end` | string (date-time) |  |

```json
{
  "p50_ms": 1,
  "p95_ms": 1,
  "sample_size": 1,
  "sufficient": false,
  "window": {
    "start": "2026-11-24T10:00:00Z",
    "end": "2026-11-24T10:00:00Z"
  }
}
```

