Sign in

Media Gateway

Real-time media ingestion gateway for audio, screenshots, redaction, storage, and analyzer handoff.

mediagateway
servicemediawebsocketredaction

Updated 2026-11-03

Verified 2026-11-03

Media Gateway is a stateless Go service for real-time media ingestion. Browser clients connect over WebSocket, stream binary audio and screenshot frames, and receive session-level processing through downstream Cosmos services.

Responsibilities

  • Accept real-time audio and screenshot frames over WebSocket.
  • Stream audio to Deepgram for speech-to-text.
  • Upload screenshots to DMS through Cosmos Storage when DMS upload is enabled.
  • Optionally redact screenshot and transcript PII through PII Redactor before storage or analysis.
  • Optionally post the session to the ADK analyzer when a session ends.

Runtime

AreaDetails
Repositorycosmos-mediagateway
LanguageGo
Default bind:8080 (GATEWAY_BIND)
Primary protocolWebSocket
StateStateless

API

MethodPathPurpose
GET/ingestWebSocket endpoint for audio and screenshot ingestion (path set by GATEWAY_PATH).
GET/healthzLiveness probe.
GET/readyzReadiness probe.
GET/metricsPrometheus metrics.

Configuration

Media Gateway mints audience-bound service tokens from the User Service (USER_SERVICE_URL, COSMOS_SERVICE_CLIENT_ID default cosmos-mediagateway, COSMOS_SERVICE_CLIENT_SECRET) for the analyzer, DMS, and PII Redactor calls.

VariablePurpose
DEEPGRAMAPIKEYDeepgram streaming transcription credential. DEEPGRAM_MODEL defaults to nova-3 and DEEPGRAM_LANGUAGE to multi.
ANALYZER_ENABLEDEnables the end-of-session analyzer POST (default false).
ANALYZER_BASE_URLADK base URL (http:// or https://); the gateway posts to /api/v1/adk/analyzer/runs/. Required with ANALYZER_ORG_ID when the analyzer is enabled.
DMS_ENABLEDEnables screenshot upload to Storage (default false). When disabled, screenshot frames are acknowledged and dropped.
DMS_URL, DMS_OWNER_IDStorage URL and owning user; required when DMS upload is enabled. DMS_PARENT_PATH_TEMPLATE defaults to /Analyzer/Sessions/{session_id}/.
PII_REDACTION_ENABLEDSends screenshots to /v1/redact-images and transcript lines to /v1/redact-text (default false). On a redactor failure the gateway falls open and uses the original content.
PII_REDACTOR_URLPII Redactor service URL; required when redaction is enabled.
MAX_FRAME_BYTESPer-frame cap for audio frames (default 8 MiB).
SCREENSHOT_MAX_BYTESPer-screenshot cap (default 8 MiB).
  • cosmos-pii-redactor redacts screenshots and transcripts when enabled.
  • cosmos-storage-v3 stores uploaded media artifacts.
  • cosmos-adk-v3 receives the end-of-session analyzer run.
  • cosmos-user-v3 issues service tokens used for downstream calls.

Changelog

See Media Gateway Changelog for verified documentation and service-surface changes.