curl --silent --show-error --fail-with-body --request GET \
--url 'https://api.example.com/api/metrics' \
--header 'x-metrics-token: YOUR_API_KEY'
"string"
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.
GET
/
api
/
metrics
curl --silent --show-error --fail-with-body --request GET \
--url 'https://api.example.com/api/metrics' \
--header 'x-metrics-token: YOUR_API_KEY'
"string"
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
Returnstext/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 for declared schemas and alternatives. This page also includes documented corrections from the spec overlays. Example IDs and values are illustrative; replace them with records from your workspace.curl --silent --show-error --fail-with-body --request GET \
--url 'https://api.example.com/api/metrics' \
--header 'x-metrics-token: YOUR_API_KEY'
"string"
Last modified on November 13, 2026