Self-serve key creation for developers in LiteLLM

Developers create their own LiteLLM keys inside team budgets and model limits, while admins keep control of roles, defaults and key lifetimes. This page covers how to set it up and what to confirm first.

On this page

Self-serve key creation for developers in LiteLLM: when teams stop filing tickets

Self-serve key creation lets developers sign in and mint their own LiteLLM keys within limits that an admin sets for their team, so routine key requests stop landing in the ticket queue. Admins keep control of the budgets, model access and rate limits that sit behind each team, and the developer works inside that envelope. The setup is worth designing before rollout because the same gateway often serves both interactive developers and production applications, and those two groups need different key rules.

LiteLLM virtual keys are API keys that the proxy issues and checks on every request. Each key can carry a per-key, per-user or per-team budget, TPM and RPM limits, a temporary budget increase and a list of models it may call. Virtual keys require a PostgreSQL database, so the database is part of the first decision, not an afterthought. Self-serve fits developers working on their own tools, notebooks and coding assistants, where a person owns the key and it is reasonable for the key to end when that person leaves. Keys for production applications belong to a different pattern, covered in the service account section, because they must survive staff changes and should not be tied to one developer's login.

Before you choose an identity method for self-serve sign-in, confirm the edition you need. LiteLLM's admin UI supports SSO with Google, Microsoft Entra ID, Okta and generic OIDC providers, and from v1.76.0 SSO is free for up to 5 users. Beyond that limit, an Enterprise license is required, according to LiteLLM's enterprise documentation. If your developer population is larger than five, price the license into the plan and confirm the current terms with LiteLLM before you promise developers self-service access.

How a developer key request moves through LiteLLM

The flow starts when a developer signs in to the LiteLLM admin UI through SSO or a local login, and LiteLLM checks the internal user role before any key is issued. Team defaults then apply to the new key, and the budget, TPM and RPM limits and model restrictions are enforced on each request. Settings are stored in PostgreSQL, so the database is a dependency for every key decision. Admins should confirm which steps they control at each point.

Developer key request path, with admin control points and the PostgreSQL dependency.

Which self-serve settings fit which team

This table compares the self-serve settings available for developer key creation, from internal user roles to model restrictions. Read each row for when the setting fits and what admins keep control of, then confirm exact setting names in the LiteLLM version you run.

SettingWhen it fitsWhat admins keep control ofSource to check
Internal user rolesDevelopers who need to sign in and manage only their own keys, while platform staff manage teams and modelsWhich role each person holds and who can promote users to admin or viewer rolesVirtual keys docs and admin UI SSO docs; confirm role names in your version
Default team settingsTeams with a stable scope, such as one product group with a known set of models and a shared budgetThe team budget, rate limits and model list that new keys inherit, and who can change themVirtual keys docs; confirm which defaults apply at team creation
Team member key durationTeams that want developers to rotate keys on a schedule rather than keep long-lived credentialsThe maximum lifetime allowed for keys created by team members and the rotation processVirtual keys docs; confirm the expiry setting name and its default
Per-key budgetsIndividual developers or small teams testing models where spend must stop at a fixed ceilingThe ceiling itself, and whether developers can request temporary increasesVirtual keys docs; temporary budget increases are supported
TPM and RPM limitsShared models with limited provider capacity where one developer should not starve othersThe per-key request and token ceilings and the team limits above themVirtual keys docs; confirm how team and key limits interact in your version
Model restrictionsDevelopers who should use approved or lower-cost models only, while production models stay with service accountsWhich models a key can call, and any changes to the model listVirtual keys docs and routing docs; confirm model group syntax before relying on it
SSO sign-in for developersOrganizations that want developers to sign in with corporate identity before creating keysWhich identity provider is trusted and who can access the admin UIAdmin UI SSO docs; SSO is free for up to 5 users from v1.76.0, and beyond that needs Enterprise

Setting up self-serve keys in a LiteLLM deployment

This sequence takes a LiteLLM gateway from database and release checks to a working self-serve model where developers create their own keys inside team limits, and admins keep control of budgets, models and spend records.

  1. Confirm PostgreSQL and a supported release line

    Before any key settings matter, confirm the gateway runs on PostgreSQL, since virtual keys need a PostgreSQL database, and that the LiteLLM version sits on one of the four most recent stable minor release lines your team has agreed to support. Check the current release on the LiteLLM releases page and record the version in your change ticket. If more than one proxy instance runs, confirm Redis 7.0 or newer is in place for shared rate limits. Done means the platform team can show the database connection, the running version and, for multi-instance setups, the Redis version, all in a deployment record.

  2. Configure SSO for the admin UI

    Connect the admin UI to your identity provider, using Google, Microsoft Entra ID, Okta or a generic OIDC provider, following the admin UI SSO documentation. Developers will sign in through this flow to create their own keys, so decide which group or domain grants access before go-live. Note that SSO is free for up to 5 users from v1.76.0, and an Enterprise license is needed beyond that, so count the people who will sign in to the UI and confirm the licensing position with LiteLLM before you roll out to the wider developer population. Done means a test user from your identity provider reaches the admin UI and the gateway shows the expected identity.

  3. Create teams with budgets and allowed models

    Create one team per group that will self-serve, and set each team's budget, rate limits and allowed model list in the admin UI or through the management API. Keep production model access separate from development access so developers in a team cannot reach expensive or production-only routes by default. Record who owns each team and who approves budget changes. Done means each team shows its budget, TPM and RPM limits and model allowlist in the admin view, and an admin can explain each setting from the record.

  4. Set internal user roles and team member key settings

    Assign internal user roles so developers can create keys only within their team, and keep proxy admin rights with the platform team. Configure the team's default key settings, including the key duration that team members receive and whether members can set their own budgets or model restrictions. Confirm which settings developers can change and which only admins can change. Done means a developer account can open the key creation screen for its team, and an attempt to change a team-level limit is refused.

  5. Test a developer key against permitted and blocked models

    Create a key as a developer account and send requests to a model the team is allowed to use, then to a model outside the allowlist. The first request should succeed and the second should be rejected with an authorization or model-access error. Also send a request that exceeds a small test budget or rate limit, if your environment allows it, to confirm the limit holds. Record the request IDs and responses. Done means the permitted call succeeds, the blocked call fails, and the test results are saved for your review record.

  6. Verify spend is recorded against the key and team

    After the test calls, check the spend view for the key, the user and the team. Each successful request should appear with the correct key, user and team, and the team's spend total should move by the expected amount. Compare a sample of recorded spend with the provider's own usage data for the same calls, using the provider's billing or usage console. Note any gaps, since spend updates may be batched to the database, so allow the batch interval to pass before judging a mismatch. Done means each test request is attributed to the right key, user and team, and any differences from provider usage are explained.

  7. Confirm admin control and document the operating model

    Write down what developers can do without a ticket, such as creating and rotating their own keys within team limits, and what stays with admins, such as budget increases, model allowlist changes, role assignments and deleting keys. Confirm the gateway master key is held in a secret manager and that admins know how to disable a developer key quickly. Hand this record to the team that will run the gateway. Done means an admin can list each control, its owner and the approval path, and a disabled test key stops working on its next request.

Security controls admins must keep

Self-serve keys shift day-to-day creation to developers, but the controls that protect the gateway stay with administrators. The cards below cover the master key, key lifetimes, role scope, audit evidence and offboarding, which together determine whether delegated key creation remains governed.

Master key in a secret manager

The LITELLM_MASTER_KEY must start with sk- and grants full administrative control of the proxy, so it should never sit in a config file or developer shell history. Store it in a secret manager your platform team already runs, limit read access to the deployment pipeline and the few admins who need it, and record who can retrieve it. Ask your team to confirm how the key is rotated and how the rotation is coordinated with the running proxy.

Production guide

Expiry and rotation for developer keys

Self-created keys should carry an expiry so that a key copied to a laptop or CI log does not stay valid indefinitely. Decide the maximum key duration that team members may set, and whether admins can extend it. Review keys that are approaching expiry and confirm with your engineering team how developers replace a key without interrupting work, since rotation policy only holds if the replacement path is easy.

Least-privilege internal roles

Give most developers the role that lets them create keys inside their own team and nothing broader. Reserve proxy admin rights for a small platform group, and keep viewer roles for auditors and finance reviewers who need reporting without the ability to mint keys. Check that each role can only set budgets, rate limits and model access within the limits its team already holds, so a developer cannot raise their own ceiling.

Audit logging as an Enterprise feature

Audit logs that show who created, changed or deleted a key are part of LiteLLM Enterprise, not the open-source edition. If your policy requires that evidence, confirm the license scope before rollout and test that the log records key creation events with the actor, time and target team. Without it, your team must reconstruct key history from database records or request logs, which is slower and harder to defend in a review.

Enterprise docs

Org and team RBAC scope

Organization and team role-based access control is an Enterprise feature, so open-source deployments rely on the internal roles and team settings alone. Map each team to a single owner, confirm which accounts can change team membership, and test that a team admin cannot add users to another team. Document the gap so that compliance reviewers see the controls you rely on, not the ones you assume.

Offboarding when staff leave

Keys created by a person remain valid after that person leaves unless someone deletes or blocks them. Build an offboarding step that lists every key tied to the user, removes the user from teams, and moves any production-facing keys to a service account owned by the team. Ask your identity team to confirm that the directory deprovisioning event triggers this step, because a manual checklist is easy to skip.

Trade-offs of letting developers mint their own keys

Self-serve keys buy speed, and the cost arrives later as key sprawl. When a developer can create a key in minutes, the gateway fills with keys that nobody remembers issuing, and their creators may have moved on. Each one is a credential that can be pasted into a notebook, a script or a repository. A key that reaches a public commit stays valid until someone finds it and revokes it. The control that matters is how quickly the gateway can show every key, its owner and its team, and cut one off. Before rollout, check the virtual keys documentation against your version, and confirm that every self-issued key records an owner, a team and an expiry, and that revocation works for each one.

The second cost is accounting. A key issued to a person usually carries that person's identity into spend reports, so the gateway can tell you who spent the budget but may not tell you which application did. An experiment and a production service can end up under the same name. When that person leaves or changes teams, the spend history follows the individual, not the workload. Per-key and per-team budgets still cap spend, but a budget on a person's key is a weak stand-in for an application's needs. Confirm how spend rolls up from keys to users and teams in the version you run, because chargeback and FinOps reporting depend on that roll-up being correct.

The practical answer is to split the two paths. Let developers self-serve keys for experimentation, inside a team that already has a budget, a model allowlist, TPM and RPM limits and an expiry set by admins. Issue production traffic service account keys owned by the application, with a team ID required and a name that survives staff changes. Admins keep the team defaults, the model access and the decision about which keys may reach production. Ask whether the self-serve path can be disabled for production teams, and make your release review confirm that production configuration reads keys from the secret manager and never from a developer-issued key.

Limits to confirm in your environment

Self-serve key creation depends on what your LiteLLM version actually permits for roles, team permissions and key duration. The cards below list the settings to verify against the vendor documentation for the exact release you plan to run, before you promise developers anything.

Internal user roles and team permissions

Confirm which internal user roles your version supports and which actions a team member can take on their own. Check whether developers can create keys without an admin, whether they can change key settings after creation, and whether a team admin can add members. Test each permission in a staging proxy with a non-admin account, because role names and defaults have changed between releases.

Virtual keys docs

Per-team key duration defaults

Confirm whether default key duration can be set per team, or only globally for the proxy. If it is global, every team gets the same expiry, and a team that needs shorter-lived keys will need a different approach. Also confirm what happens to keys that expire mid-project and whether developers can request an extension without an admin ticket.

Enterprise RBAC and SCIM

Team-level RBAC, audit logs and SCIM provisioning sit in the Enterprise license, not the open-source edition. Confirm which of these your organization needs before designing self-serve access, because removing a leaver from the identity provider may not revoke their keys without SCIM. Ask your LiteLLM contact to confirm the feature list for your license.

Free SSO limit
5 users
Enterprise docs

Redis once multiple instances run

Confirm that Redis is in the design before you run more than one proxy instance. Shared rate limits, router state and cache depend on it, so a team budget or TPM limit enforced per instance can be exceeded in practice. Check the minimum Redis version your release requires and how failover is handled, since a Redis outage affects limit enforcement across all developers.

Minimum Redis version
7.0
Production guide

Supported release line

Confirm which minor versions receive support at the time you roll out, and plan upgrades on that line. Self-serve features that depend on recent admin UI or permission changes may only exist in newer releases, so pin the version you test against. Record the exact version in your change ticket and retest key creation after each upgrade.

LiteLLM releases

Questions teams ask before enabling self-serve keys

What does it cost to enable self-serve keys in LiteLLM?

Cost depends on the identity setup, the team design, the policy decisions and the testing that come before developers get keys. Most of the spend is labor: a partner or internal engineers configure the proxy, connect single sign-on, define internal user roles and default team settings, and then test that limits hold. The software itself is open source under the MIT license for code outside the enterprise/ directory, according to the BerriAI/litellm LICENSE file, so there is no license fee for the core proxy. Ask any quote to split one-time work (configuration, testing, runbooks) from recurring work (upgrades, reviews of team limits, support). DeployOpen does not publish a price list, so a quote follows from a written scope.

How long does a self-serve key rollout take?

The duration depends on scope: how many teams need their own limits, whether single sign-on is already available, how many models are exposed, and whether the gateway runs on one instance or several. A rollout limited to one pilot team on an existing proxy is much shorter than a rollout across the whole organization with several identity groups and a multi-instance deployment. No general timeline is set here. Ask for a phased plan in the written scope that separates the pilot, the policy review and the expansion, and confirm which dependencies (identity provider changes, database access, Redis for multiple instances) sit with your team.

What does the work need from our team?

Expect to provide four things before work starts. First, access to your identity provider so single sign-on can be configured and tested, with an owner who can approve application registration. Second, named team owners who decide who may join each team, what budgets and rate limits apply, and how long a team member key may last. Third, the list of models the gateway will expose, with the provider and any private model endpoints. Fourth, a decision on who keeps admin control, including which users hold the proxy admin role. Also confirm that a PostgreSQL database is available, since LiteLLM virtual keys require one.

Can our internal team set up self-serve keys without a partner?

Yes, an internal platform team with experience running Kubernetes or similar services, identity configuration and PostgreSQL can often do it alone, provided it has time and clear decisions from the business. The hard parts are rarely the setting changes. They are deciding which users may create keys, which limits apply by default, and how an admin reviews key usage over time. Teams that lack an engineer who has configured OIDC against the identity provider, or that have no one to own the policy decisions, usually benefit from a partner for the design and testing phases. Compare both options against the same written scope.

When does self-serve key creation require an Enterprise license?

Open-source LiteLLM covers virtual keys with per-key, per-user and per-team budgets, TPM and RPM limits and model restrictions, according to the LiteLLM virtual keys documentation. The admin UI supports SSO with Google, Microsoft Entra ID (Azure AD), Okta and generic OIDC providers, and from v1.76.0 that SSO is free for up to 5 users. An Enterprise license becomes necessary when you need SSO beyond that limit, SCIM, JWT authentication with identity provider tokens, audit logs, organization and team RBAC, or team-level guardrails and logging. Confirm the exact edition for each requirement against the LiteLLM Enterprise documentation before you commit to a design.

What should we check in a pilot before opening keys to all developers?

A pilot should prove that the limits hold under real use. Check that a developer who signs in can create a key only inside their team's limits, that a team member key expires on the duration you set, and that a key cannot reach models outside its allowed list. Test that a removed user loses access, that budgets stop spend at the configured threshold, and that admins can see usage per key and per team. Keep the proxy master key in a secret manager, as LiteLLM recommends, and confirm the runbook covers what happens when a key is compromised.

What can go wrong when developers create their own keys?

The common failures are overly broad default team settings, budgets that are too high for the first month, keys that outlive the people who created them, and admins losing track of which models a team can reach. Another failure is treating a user key as if it were a durable application credential. Applications that outlive staff changes need service account keys, not personal keys. Review default settings with the team owners before rollout, set key duration and budgets deliberately, and schedule a periodic review of who holds admin control.

How DeployOpen scopes self-serve key rollouts

DeployOpen works from a written, fixed scope agreed before any build starts, and a quote follows from that scope. For a self-serve key rollout, the scope usually covers four things: the team design (which teams exist, who may create keys for them and what limits each team carries), the internal user roles and how people sign in, the SSO configuration in the client's identity provider, and the testing and handover that proves the setup works inside the client's own cloud accounts, data centers or restricted networks. Each of these is a separate decision, so the scope document should name who makes each one, who signs off, and what the client receives at the end, such as configuration in version control, runbooks and a record of the settings that were tested.

Scoping is also where the client decides how much of the rollout is theirs to run afterward. Ask the partner to list the admin-only settings explicitly, including team budgets, key duration limits and model access, and to state which of them will be left unchanged after handover. Confirm the identity provider and SSO option, since SSO on the LiteLLM admin UI is free for up to 5 users and an Enterprise license is needed beyond that, according to the LiteLLM admin UI SSO documentation. Your own team should confirm the license position with the vendor before the scope is signed, because it changes the cost of the whole rollout. Quotes should show these items as separate lines so they can be compared with an internal estimate.

Ongoing support is available as a retainer for the period after handover, covering upgrades, configuration changes as teams grow, and periodic testing of the self-serve settings. A retainer is recurring, so ask for its scope, response expectations and how changes to team limits are requested and logged. Projects of this kind are priced from the written scope, and the client should expect the quote to show which work is one-time setup and which work recurs.

How DeployOpen delivers LiteLLM access control

DeployOpen plans and builds self-serve key creation on a self-hosted LiteLLM gateway that you run in your own infrastructure. We agree the roles, team limits and admin controls in writing first, then configure, test and document them so your security and platform teams can review the result.

How we scope

  • Written scope lists which internal roles can sign in and which can create keys.
  • Default team settings, budgets, rate limits and allowed models are agreed before build starts.
  • Engagements are fixed-scope, with deliverables and timelines confirmed in writing. Ongoing support is available as a retainer.

How we build

  • Configure SSO for the admin UI and map identity provider groups to LiteLLM roles and teams.
  • Set key duration, budget and model restrictions for team members, and confirm which settings stay with admins.
  • Test that developers cannot exceed team limits, change other teams' keys or create unrestricted keys.

How we hand over

  • Documentation covers the role model, team defaults, key lifecycle and the admin actions that remain manual.
  • Walkthrough sessions show developers how to create and rotate their own keys within limits.
  • Runbook for revoking keys, reviewing spend and changing team limits as projects change.

How we support

  • Retest role and limit configuration after LiteLLM upgrades that touch authentication or key handling.
  • Review access changes with your security team when teams, models or identity groups change.
  • Ongoing support and periodic access reviews can be contracted as a retainer, scoped in writing.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.