---
title: "Internal Stream Metrics"
method: POST
path: "/internal/stream-metrics"
---

# Internal Stream Metrics

`POST /internal/stream-metrics`

## Request

- Base URL: `https://sleipnir.tv` (the document declares no server; this is the origin it was published from)
- URL: `https://sleipnir.tv/internal/stream-metrics`
- Auth: none declared

Internal-only live-bitrate snapshot for the CALLING token's own user,
for the keyless MCP server (a separate process that cannot read this
process's in-memory enforcement state). Returns ONLY {streaming,
current_mbps, cap_mbps} -- a strict subset of enforcement.get_user_metrics
with NO stream key, NO destination URL, NO MediaMTX path. Locked behind
the internal-read secret (require_internal_secret, distinct from the
relay hook secret) and the same Caddy @internal_only matcher, so it is
never reachable from the public internet.

2026-07-30: user_id is resolved SERVER-SIDE from the caller's own bearer
token (payload.token, POST body -- never a query string, mirroring
/internal/resolve-token's own discipline), via the exact same
tokens.resolve_token every other PAT-authenticated path goes through.
Previously took a bare user_id query param, trusting the caller's claim
with only require_internal_secret as the gate; safety depended entirely
on every MCP tool sourcing that claim from its own resolved identity and
never accepting one as an argument -- a property enforced by discipline,
not by this endpoint. There is no user_id parameter left to mismatch now,
because there is no user_id parameter. See the multi-tenant authorization
audit in docs/AUDIT-LOG.md.

uptime / is-live are derived MCP-side from StreamSession (the MCP container
reads the DB directly); only bitrate has to come over this hop because it
lives in the control-plane's memory.

## Headers

- `X-Sleipnir-Hook-Auth` string, nullable

## Request body

- ResolveTokenPayload
  - `token` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/sleipnir/apis/relay-control-plane.md) · [All operations](https://skmtc.dev/sleipnir/apis/relay-control-plane/llms.txt) · [OpenAPI document](https://skmtc.dev/sleipnir/apis/relay-control-plane/revisions/79829f6945a4?raw)
