BlogOperations
Keys, teams and budgets in LiteLLM
Give every person a personal key inside their team, give every application its own service account key, put the budget on the team, and take the master key out of daily use. That layout is quick to set up for twenty people and does not need to be redone at five hundred. Most trouble with LiteLLM starts when one of these four points is skipped. As of 27 November 2026.
How LiteLLM organises access
LiteLLM has four levels. An organisation contains teams, a team has users, and a virtual key belongs to a user, a team or both. The key is what an application or a coding agent actually sends. Everything else decides what that key may do and whose budget it spends.
Organisations need the Enterprise licence. Without it you work with teams, users and keys, which is enough for one company with a handful of departments.
Personal keys or service account keys
The two kinds of key answer two different questions. A personal key says which person made a request. A service account key says which application did.
| Question | Personal key | Service account key |
|---|---|---|
| Who owns it | One user, usually inside a team | The team, with no user attached |
| Use it for | Coding agents and chat tools a person works with | Applications, pipelines and agents that run without a person |
| Which limits apply | The team's limits and the limits set for that member | The team's limits only |
| When the person leaves | The key goes with the user | The key stays, because it was never theirs |
A common mistake is a production application running on the personal key of the developer who built it. It works until that developer changes teams, and then it stops on a Friday afternoon.
Where budgets belong
Put the budget where the money is decided. In most companies that is the team or the cost centre behind it, so the team gets a monthly budget and a list of models it may use. A default budget per member keeps one person from using up the month for everyone. Budgets on single keys are for applications that must never spend more than a fixed amount.
Two things are easy to miss. Budgets and virtual keys need the database, so a gateway started without Postgres has neither. And with more than one instance, the limits are only counted correctly once Redis is in place.
The master key
The master key can do everything, including reading and creating every other key. LiteLLM's own security guidance says applications and users should work with scoped virtual keys and not with the master key. A Cloud Security Alliance note from September 2026 is about gateways that were reachable from the internet and still on a default admin key.
- Generate a long random master key and store it in your secret manager, not in a configuration file
- Let admins sign in through your identity provider with a role, so nobody needs the master key for daily work
- Use the master key only in automation that creates teams and keys, and for emergencies
- Keep the admin interface and the key management routes off the public internet
A layout to start with
- 1
One team per real team
Follow the cost centres you already have. If sign-in comes from Entra ID, LiteLLM can create teams from groups, so the directory stays the source of truth.
- 2
A monthly budget and a model list on each team
Start low and raise it on request. A raise is a two-minute job. A surprise invoice is a longer conversation.
- 3
Personal keys that expire
People create their own key in the interface. Give keys a lifetime, so forgotten ones die on their own.
- 4
One service account key per application and environment
Name them so the spend report explains itself, for example svc-helpdesk-prod. Production and staging never share a key.
# create the team
curl -X POST "$GATEWAY/team/new" \
-H "Authorization: Bearer $ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"team_alias": "helpdesk",
"models": ["gpt-standard", "claude-standard"],
"max_budget": 400,
"budget_duration": "30d"
}'
# a key owned by the team, with no user attached
curl -X POST "$GATEWAY/key/generate" \
-H "Authorization: Bearer $ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"team_id": "<team id from the first call>",
"key_alias": "svc-helpdesk-prod",
"rpm_limit": 120
}'Setting this up with a client's own teams and cost centres is usually part of the first gateway work we do.
Questions
Should every developer get a personal LiteLLM key?
For interactive tools, yes. A personal key lets you set a limit per person and removes access when the person leaves. In Germany, agree with the works council beforehand which per-person data is reported.
What happens when a team budget is used up?
Requests with that team's keys are refused until the budget resets or someone raises it. Tell teams this before it happens, and decide who may raise a budget.
Do we need the Enterprise licence for this layout?
No. Teams, users, virtual keys, budgets and rate limits are in the open-source version. Organisations, audit logs and automatic key rotation need the licence.
Related services
LiteLLM gateway
Budgets and access rules for every team's AI use, through a LiteLLM gateway that is hardened, connected to your identity provider and kept up to date.
LLM cost optimisation
Agent spend broken down by team and task, then lowered through defaults, budgets and routing your platform team can run.
More from the blog
LiteLLM with Microsoft Entra ID
How to connect LiteLLM to Microsoft Entra ID: what single sign-on covers and what it does not, how groups become teams, which roles exist, and why offboarding needs a test of its own.
Guardrails at the LLM gateway
LiteLLM ships with almost every protective control switched off. Which ones to turn on first, how a guardrail is defined, what it costs in latency, and what a guardrail cannot protect you from.
MCP servers behind the gateway
How to control MCP servers centrally through a LiteLLM gateway: what is open by default, how key, team and organisation permissions combine, how to grant single tools, and who should approve a new server.
LLM cost allocation
How to explain an LLM bill by team, task and accepted outcome: tag requests at the gateway, price them as you are invoiced, allocate shared costs by a stated rule and reconcile with finance every month.
Talk to an engineer
Bring one piece of work you would like to improve. The call takes 30 minutes and needs no access to your systems or your data.
Booking runs on Google Calendar.

Mickey Graf
Founder and CEO of Cloudsail
Prefer to write first? Leave your email and a few lines. Mickey reads every message himself and replies by email with times for a call.
Look for the draft in your email program
Send it from there, and Mickey replies in person with times for a 30-minute call. If no draft has opened, write to us at miki@cloudsail.com.