The admin UI: seeing what the gateway did
The admin UI is a web dashboard that the gateway serves at /ui, where an administrator manages virtual keys, models, teams and users and reads usage and request logs.
Last updated: 12 Oct, 2026 · LiteLLM 1.105
Virtual keys: a key per application made keys with HTTP requests. The dashboard does the same from a page, and adds a view of what the gateway has done. This lesson describes the dashboard from the LiteLLM documentation. It cannot show screenshots, because the pages that matter need a Postgres database, and the course does not run one. One thing can be run: the gateway serves the dashboard's page itself, and the example below fetches it.
Signing in
The admin UI page says the quick start requires a master key and a connected database. The user name is the UI_USERNAME setting and defaults to admin. The password is UI_PASSWORD, and when that is not set the master key is accepted as the password. The page treats this environment login as a way to start. It recommends creating a user with the proxy_admin role first, and then setting disable_env_credential_login: true. It warns that turning this on before a password-based admin exists leaves you unable to log in.
general_settings:
master_key: sk-<master-key>
disable_env_credential_login: trueNot run here. This block needs the database and an admin user, and shows no output.
Fetching the page the gateway serves
The dashboard is part of the gateway process. A gateway with no database still answers at /ui. This example asks for the page and prints how it answered. It does not sign in, and it says nothing about what the page shows after sign-in.
import subprocess
import time
import urllib.request
from pathlib import Path
import httpx
def start(port=4400, env=None):
proc = subprocess.Popen(
["litellm", "--config", "config.yaml", "--port", str(port)],
stdout=open("gateway.log", "w"), stderr=subprocess.STDOUT, env=env,
)
while True:
try:
urllib.request.urlopen(f"http://127.0.0.1:{port}/health/liveliness")
return proc
except OSError:
time.sleep(1)
Path("config.yaml").write_text("""model_list:
- model_name: careful
litellm_params:
model: groq/openai/gpt-oss-120b
api_key: os.environ/GROQ_API_KEY
general_settings:
master_key: sk-gateway-1234
""")
proc = start()
try:
first = httpx.get("http://127.0.0.1:4400/ui")
page = httpx.get("http://127.0.0.1:4400/ui", follow_redirects=True)
print(first.status_code, first.headers["location"])
print(page.status_code, page.headers["content-type"])
print(page.text.split("<title>")[1].split("</title>")[0])
finally:
proc.terminate()
proc.wait()307 http://127.0.0.1:4400/ui/ 200 text/html; charset=utf-8 LiteLLM Dashboard
- The address is a redirect.
/uianswers 307 and points at/ui/, the form a browser follows. - The page is HTML from the gateway. There is no separate dashboard server to run.
- The title is the dashboard's own. What lies behind the sign-in form is not shown by this example.
What the dashboard shows, from the documentation
What follows is taken from the admin UI page and the logs page. Nothing here was observed on a running dashboard.
The sidebar pages the documentation names
- Virtual Keys has a Create New Key button. The page names the button only in the description of one of its screenshots. It is the page version of the request in the last lesson.
- Models covers adding models, the AI Hub and syncing price data.
- Internal Users is where users are invited and given roles.
- Teams & Organizations is the label the page uses for the pages that group users and keys.
- Observability: Usage is the label the page uses for the spend and token use view.
- Logs lists requests, described next.
- Chat UI is a chat page for trying models.
What the Logs page lists for each request
The logs page says the Logs view lets you see spend, token usage, key and team name for each request, and which tools were provided and called in a completion request. Error logs are on its list of what is tracked by default. Each row also has a metadata column, which mostly holds the model's cost map entry. The setting spend_logs_metadata_fields chooses which top-level keys of that column are written to the database.
What the logs do not store by default
The logs page states that by default LiteLLM does not track the request and response content. Storing it is an opt-in, store_prompts_in_spend_logs, which the page says can be turned on from the dashboard under Logs, Settings, or in the config under general_settings with a restart. Those rows then contain whatever users typed, so treat that as a decision about privacy, not only about debugging.
general_settings:
master_key: sk-<master-key>
store_prompts_in_spend_logs: trueNot run here. This block needs the database and shows no output.
Reading the same data without the page
The spend tracking page lists HTTP routes behind the same data. /spend/logs returns individual transactions with summarize=false and aggregated data by default. The page recommends /spend/logs/v2 for exports because it is paginated. It says the older route truncates results to the 10,000 most recent matching rows. /spend/keys returns the spend of keys: administrators see all of them, and an internal user sees the keys that belong to that user. The page names one cost header, x-litellm-response-cost, on every response.
Dashboard vs spend routes
| The dashboard | The spend routes | |
|---|---|---|
| Made for | A person looking and clicking | A program that exports or alerts |
| Needs | Master key and database | Database, and a key allowed to read spend |
| Shows | Keys, models, usage and request logs | The same spend data as JSON |
Where the dashboard fits
- Making a key without curl. An administrator creates a key for a new application from the Virtual Keys page.
- Finding what a request cost. The Logs page ties a request to a key, a team and a cost.
- Answering a bill. Usage shows where spend went, which is the question finance asks.
Related
- Previous: Virtual keys: a key per application
- Next: Guardrails on every request
- Reference: Admin UI, Logs and Spend tracking in the LiteLLM docs
- Change the example to fetch
/ui/directly and print the status. It answers without a redirect. - Print the first 200 characters of
page.textto see that the page is a built web application. - If you have a gateway with a database, open
/ui, create a key on the Virtual Keys page and find its first request under Logs.
Slow is fine. Stopping is the only problem.