Open WebUI Exporter.
Prometheus metrics for Open WebUI — polls the REST API, no database access required.
Overview
No first-party metrics, and the community one needs your database
Open WebUI ships no /metrics endpoint. The existing community exporter works, but requires direct PostgreSQL access — a non-starter for SQLite-backed or access-restricted deployments.
This exporter reads everything through Open WebUI's own REST API, including its built-in /api/v1/analytics/* endpoints, so it works against any backend with just an admin API key.
Spend is reconstructed, not reported
Open WebUI reports token counts but never price. A per-model rate table (input/output, plus cache_read/cache_write where providers support prompt caching) ships with July 2026 list prices for OpenAI, Anthropic, Google, xAI, DeepSeek, Qwen, GLM, and Mistral. Local Ollama entries are intentionally mock prices, so a local-only instance still shows a non-zero cost signal instead of a flat zero.
Rates drift and negotiated pricing varies, so the table is overridable without touching code — a CSV price sheet (Excel-friendly) or a JSON file, both merged on top of the built-in defaults.
Nine rows, from KPIs to exporter self-health
The dashboard is provisioned automatically by the monitoring compose stack.
How it works
The exporter polls Open WebUI's own REST API on an interval, reconstructs per-model cost from a rate table, and exposes everything as Prometheus series — no database credentials, works on SQLite or Postgres backends alike.
In the terminal
$ curl -s http://localhost:9090/metrics | head
# HELP openwebui_exporter_tokens_total Total tokens processed
# TYPE openwebui_exporter_tokens_total counter
openwebui_exporter_tokens_total{model="gpt-4o",direction="output"} 812400
# HELP openwebui_exporter_estimated_cost_usd Estimated spend from the model rate table
# TYPE openwebui_exporter_estimated_cost_usd counter
openwebui_exporter_estimated_cost_usd{model="gpt-4o"} 24.37
# HELP openwebui_exporter_scrape_success Whether the last scrape succeeded
# TYPE openwebui_exporter_scrape_success gauge
openwebui_exporter_scrape_success 1Install & use
$ docker run -d --name openwebui-exporter -p 9090:9090 \$ --add-host host.docker.internal:host-gateway \$ -e OPENWEBUI_BASE_URL=http://host.docker.internal:3000 \$ -e OPENWEBUI_API_KEY=<your key> \$ ghcr.io/baselhusam/open-webui-exporter:latest
$ docker compose -f docker-compose.monitoring.yml up -d$ open http://localhost:3001 # Grafana
# 1. Open WebUI: Settings → Account → API Keys → Create new key (admin key)$ cp .env.example .env # fill OPENWEBUI_BASE_URL + OPENWEBUI_API_KEY$ docker compose -f docker-compose.monitoring.yml up -d$ curl http://localhost:9090/metrics