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

# Prometheus exposition

> When METRICS_TOKEN is set the caller must present it in x-metrics-token; otherwise only loopback / RFC 1918 callers are served and everyone else gets 403.

When `METRICS_TOKEN` is set the caller must present it in `x-metrics-token`; otherwise
only loopback / RFC 1918 callers are served and everyone else gets `403`.

### Response

Returns `text/plain; version=0.0.4; charset=utf-8` — Prometheus text exposition.

### Status codes

| Code | Meaning |
| - | - |
| `200` | Prometheus text exposition |
| `401` | Missing or wrong `x-metrics-token` |
| `403` | Public caller without a metrics token configured |

### Using this contract

Read the [source OpenAPI document](https://docs.stateset.com/spec/chat-widget.json) for declared schemas and alternatives.
This page also includes documented corrections from the [spec overlays](https://github.com/stateset/docs/tree/main/spec/overlays).
Example IDs and values are illustrative; replace them with records from your workspace.

```bash cURL theme={null}
curl --silent --show-error --fail-with-body --request GET \
  --url 'https://api.example.com/api/metrics' \
  --header 'x-metrics-token: YOUR_API_KEY'
```

```json 200 theme={null}
"string"
```


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