{"slug": "agentgateway-standalone-a-cost-tokenomics-dashboard-in-one-command", "title": "agentgateway Standalone: A Cost & Tokenomics Dashboard in One Command", "summary": "AgentGateway released a standalone binary that provides a built-in cost and tokenomics dashboard for LLM traffic, allowing users to track per-model spending and user-level analytics without external observability tools. The tool includes a Docker-based demo that seeds 5,000 simulated requests across 7 days for immediate dashboard population.", "body_md": "You’re routing LLM traffic through a gateway. But do you actually know what it *costs*? Not the rough monthly invoice from your provider — the real breakdown. Which model burned the most tokens last night? Which user is driving 80% of your spend? Which provider is quietly eating your budget?\n\nagentgateway answers those questions out of the box. Every request that flows through the proxy is priced against a per-model rate catalog and surfaced in a built-in **Costs** and **Analytics** dashboard. No external observability stack, no Prometheus, no Grafana — just the standalone binary.\n\nThis guide gets you from zero to a fully populated tokenomics dashboard in a single command. We’ll use a Docker-based demo that seeds 5,000 simulated requests across 7 days, so the dashboard has something interesting to show you the moment it boots — then we’ll send real traffic through it and watch it get priced live.\n\nCost visibility is the FinOps story for AI. As soon as more than one team, agent, or app starts calling LLMs through shared infrastructure, “what did this cost and who spent it?” becomes a board-level question. agentgateway answers it at the **gateway layer**, which means:\n\n```\n ┌──────────────────────────────┐\n┌──────────────┐ │ agentgateway │\n│ Your apps / │ /v1/chat/ │ ┌────────────────────────┐ │ ┌────────────┐\n│ agents /curl │───completions──────▶│ │ LLM proxy (port 4000) │──┼─────▶│ OpenAI │\n└──────────────┘ │ └───────────┬────────────┘ │ └────────────┘\n│ │ priced per │\n│ │ model catalog │\n│ ┌───────────▼────────────┐ │\n┌──────────────┐ localhost:15000 │ │ Admin UI + Dashboard │ │\n│ Your browser│────────────────────▶│ │ Costs / Analytics │ │\n└──────────────┘ │ └───────────┬────────────┘ │\n│ │ │\n│ ┌───────▼───────┐ │\n│ │ SQLite data.db │ │\n│ │ request_logs │ │\n│ └───────────────┘ │\n└──────────────────────────────┘\n```\n\nagentgateway proxies LLM traffic on port `4000`\n\nand serves its admin UI and dashboards on port `15000`\n\n. Every request is written to a SQLite database (`data.db`\n\n) and priced using a model catalog (`base-costs.json`\n\n). The mock generator writes to the same `request_logs`\n\nschema, which is why the dashboard is populated before you send a single real request.\n\n`curl`\n\n`uv`\n\nClone the demo and run the setup script:\n\n```\ngit clone https://github.com/sebbycorp/agentgateway-demos.git\ncd agentgateway-demos/00-standalone-latest\n\nexport OPENAI_API_KEY='sk-...'\n./setup.sh\n```\n\nThat’s it. Open ** http://localhost:15000/ui/** and head to the\n\n`setup.sh`\n\nis a single-command bootstrap. Under the hood it:\n\n`curl`\n\nis available, `OPENAI_API_KEY`\n\nis set, and that `uv`\n\nor Python 3.11+ is present.`gen-mock-logs.py`\n\n).\n\n```\ngen-mock-logs.py --replace --requests 5000 --days 7 -o data/data.db\n```\n\n`config.yaml`\n\n`cr.agentgateway.dev/agentgateway:v1.3.1`\n\n) and removes any previous demo container.`agw-cost-demo-data`\n\n) with the generated database.\n\n```\n127.0.0.1:4000:4000 # LLM proxy\n127.0.0.1:15000:15000 # admin UI + dashboards\n```\n\nWhy loopback only?The proxy port carries your API credentials. Binding to`127.0.0.1`\n\nkeeps the demo off your network. Don’t expose these ports without locking down auth and CORS first.\n\nWant a bigger or smaller demo dataset? Override the `REQUESTS`\n\nand `DAYS`\n\nenvironment variables before running setup:\n\n```\nREQUESTS=20000 DAYS=30 ./setup.sh\n```\n\nOpen `http://localhost:15000/ui/`\n\nand click **Analytics**. By default it shows total traffic over the last 24 hours — token volume per hour with a running tally of cost, tokens, and calls.\n\nThe real power is in **Group by**. Switch it to **Provider** and the same traffic splits out by backend — here OpenAI dominates with ~13.3M tokens, followed by Anthropic, Google, and Bedrock. The breakdown table underneath ranks every provider by token consumption.\n\nSwitch **Group by** to **User** and you get per-person accounting — exactly the view you need when you’re trying to figure out who’s driving spend. Each bar in the time series is stacked by user, and the breakdown ranks them by tokens consumed.\n\nYou can group by **Model**, **Provider**, **User**, **Group**, or **User agent** (Cursor, Claude Code, openai-python, codex, bifrost, and more), and switch the **Measure** between tokens and cost. The **Costs** page focuses the same data on dollars, and **Export** lets you pull the underlying numbers out for reporting.\n\nThe setup script writes a `config.yaml`\n\nthat wires everything together. Here are the pieces that matter:\n\n```\nconfig:\n adminAddr: \"0.0.0.0:15000\" # admin UI + dashboards (reachable from host)\n database:\n url: \"sqlite:///data/data.db\" # /data is the mounted ./data dir in the container\n modelCatalog:\n - file: /base-costs.json  # per-model rates so every request is priced\n\nllm:\n port: 4000\n policies:\n cors: # demo-only: wildcard CORS. Safe because the port\n allowOrigins: [\"*\"] # is loopback-bound. Restrict this for real use.\n allowHeaders: [\"*\"]\n allowMethods: [\"GET\", \"POST\", \"OPTIONS\"]\n models:\n - name: \"openai/gpt-4.1\"\n provider: openAI\n params:\n model: gpt-4.1\n apiKey: \"$OPENAI_API_KEY\"\n - name: \"openai/*\" # fallback: cheaper nano model\n provider: openAI\n params:\n model: gpt-4.1-nano\n apiKey: \"$OPENAI_API_KEY\"\n```\n\nThree things make the dashboard work:\n\n`database.url`\n\n`request_logs`\n\nschema, so generated traffic and real traffic land in one place.`modelCatalog`\n\n`base-costs.json`\n\nholds per-model input/output (and cache) token rates. This is what turns raw token counts into dollars.`models`\n\n`openai/gpt-4.1`\n\nand a wildcard `openai/*`\n\nthat falls back to the cheaper `gpt-4.1-nano`\n\n.The mock data gets you a populated dashboard, but the gateway is live — send it a real request and watch it get priced alongside the simulated traffic:\n\n```\ncurl -X POST http://localhost:4000/v1/chat/completions \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"openai/gpt-4.1\",\n \"messages\": [{\"role\": \"user\", \"content\": \"Hello from agentgateway!\"}]\n }'\n```\n\nRefresh the **Analytics** page and your request shows up — tokens counted, cost calculated against the model catalog, attributed to the model and provider. Every real call from here on is accounted for the same way.\n\nPrefer to run the binary directly instead of the Docker demo? You have three options:\n\n```\n# 1. Automated installer\ncurl -sL https://agentgateway.dev/install | bash\n\n# 2. Download a platform-specific binary from the GitHub releases page\n# https://github.com/agentgateway/agentgateway/releases\n\n# 3. Run via Docker with your own config mounted\ndocker run --rm \\\n -p 127.0.0.1:4000:4000 \\\n -p 127.0.0.1:15000:15000 \\\n -v \"$(pwd)/config.yaml:/config.yaml\" \\\n cr.agentgateway.dev/agentgateway:v1.3.1 --file /config.yaml\n```\n\nPoint it at a `config.yaml`\n\nlike the one above, and the proxy listens on port `4000`\n\nwith the admin UI on `15000`\n\n. From there it’s the same dashboard — minus the pre-seeded mock data.\n\nWhen you’re done, tear the demo down with the included script:\n\n```\n./destroy.sh\n```\n\nThis stops and removes the container and the named volume.\n\nCost and token visibility is one of those things you don’t realize you’re missing until a bill lands. agentgateway puts it right in the box: per-model pricing, a built-in dashboard, and grouping by model, provider, and user — no external observability stack required. The Docker demo gets you a populated dashboard in one command so you can see exactly what it looks like before pointing real traffic at it.", "url": "https://wpnews.pro/news/agentgateway-standalone-a-cost-tokenomics-dashboard-in-one-command", "canonical_source": "https://agentgateway.dev/blog/2026-06-24-agentgateway-cost-tokenomics-dashboard/", "published_at": "2026-06-24 00:00:00+00:00", "updated_at": "2026-07-13 13:25:41.860863+00:00", "lang": "en", "topics": ["ai-infrastructure", "ai-tools", "developer-tools"], "entities": ["AgentGateway", "OpenAI", "Anthropic", "Google", "Bedrock", "SQLite", "Docker"], "alternates": {"html": "https://wpnews.pro/news/agentgateway-standalone-a-cost-tokenomics-dashboard-in-one-command", "markdown": "https://wpnews.pro/news/agentgateway-standalone-a-cost-tokenomics-dashboard-in-one-command.md", "text": "https://wpnews.pro/news/agentgateway-standalone-a-cost-tokenomics-dashboard-in-one-command.txt", "jsonld": "https://wpnews.pro/news/agentgateway-standalone-a-cost-tokenomics-dashboard-in-one-command.jsonld"}}