How Claude Code signs in through a LiteLLM gateway with SSO
LiteLLM serves the gateway login protocol that Claude Code's /login uses, so each developer signs in through your identity provider and every request carries a LiteLLM token tied to their user and team. A platform or security team rolling Claude Code out to many developers can end the practice of distributing shared API keys, because access, spend and logs are attributed to a named person from the first request. The supported path requires Claude Code v2.1.195 or later, and the client version is the first thing to pin across your developer fleet. This section explains how that sign-in works, while the rest of the page covers managed settings, OAuth device sign-in, per-developer budgets and the licensing decision.
The sign-in flow has three parts you need to plan for: the identity provider that authenticates the developer, the LiteLLM proxy that issues and validates the token, and the Claude Code client that stores it and sends it with each request. Confirm with your identity provider team which application registration LiteLLM will use, which redirect or device-flow settings it needs, and which group claims will map to LiteLLM teams. Confirm also how the token lifetime and refresh behavior are set in your environment, since those settings determine how often developers are prompted to sign in again. These details are not fixed by the gateway alone, so verify them against the current LiteLLM documentation for the version you deploy, linked from the LiteLLM Claude Code gateway tutorial.
Single sign-on for this flow is tied to licensing. Per the LiteLLM documentation, SSO is free for up to 5 users from v1.76.0, and a LiteLLM Enterprise license is needed beyond that. Count developers who will sign in through the gateway, not the number of licenses you hope to buy, and ask LiteLLM to confirm the terms that apply to your deployment before you commit to a rollout beyond the free tier. A pilot group of five developers can validate the sign-in path, managed settings and budget behavior before you size the full rollout.
What you need in place before Claude Code signs in through LiteLLM
Sign-in through LiteLLM depends on a handful of components being ready before any developer machine is touched. Each card below is one thing to have in place, and together they cover the gateway, its data stores, the identity provider, the developer tooling and the network path.
Self-hosted LiteLLM proxy with PostgreSQL
The LiteLLM proxy is the gateway that developers' Claude Code sessions reach, and it must run in infrastructure you control. Virtual keys need a PostgreSQL database, so the proxy cannot issue per-developer keys, budgets or limits without one. Confirm which LiteLLM release line you will deploy, since the Claude Code gateway flow depends on the proxy version, and check the master key handling in the production guide before go-live.
Production guideRedis 7.0 or newer
Redis becomes required once more than one proxy instance runs, because it holds shared rate limits, router state and cache. If you start with a single instance, plan for Redis anyway so that scaling out later does not change how limits behave. Confirm the Redis version your platform offers is 7.0 or newer, and decide whether it is managed or self-run, since that choice affects who patches it.
Identity provider for admin UI SSO
Developers sign in through an identity provider that LiteLLM's admin UI SSO supports: Google, Microsoft Entra ID, Okta or a generic OIDC provider. Confirm that your provider issues the OIDC settings LiteLLM needs, that a redirect URI for the gateway can be registered, and that group or user attributes are available if you plan to map teams from directory membership. Remember that SSO beyond five users requires an Enterprise license.
- Free SSO users
- 5
Claude Code on developer machines
The sign-in flow requires a minimum Claude Code release, so every developer machine in the pilot must run v2.1.195 or later before the first login. Set a managed approach for installing or updating the client, since mixed versions will produce sign-in failures that look like gateway faults. Ask your rollout owner how updates reach laptops that developers do not administer.
Network path from laptops to the gateway
Each laptop must reach the LiteLLM gateway over HTTPS, and the browser used for sign-in must reach the identity provider and the gateway's callback URL. Check corporate proxies, VPN split-tunnel rules and egress filters for both paths, because a blocked callback looks like a failed login. Confirm the required certificates and DNS names with the Claude Code gateway tutorial and your own network team before you publish a hostname.
Claude Code gateway tutorialHow a Claude Code login reaches your identity provider and LiteLLM
The flow starts on the developer's laptop, where Claude Code's login sends the developer to your identity provider inside the trust boundary of the company network. After sign-in, LiteLLM issues a token tied to the developer's user and team, and each later request from Claude Code carries that token to the LiteLLM gateway. The gateway checks the token against PostgreSQL for keys, budgets and spend, uses Redis once more than one proxy instance runs, and forwards allowed requests to approved model providers. Check where the token is issued and validated, and confirm which hop crosses your network edge.
Claude Code login, token issuance and per-request checks through the gateway.
Configuring the LiteLLM gateway login for Claude Code, step by step
This sequence takes a LiteLLM gateway from a fresh SSO setup to a developer signing into Claude Code through their identity provider, with spend and budgets recorded against that person. Each step ends with a check you can run before moving on.
Confirm the Claude Code and LiteLLM versions
Before any configuration, the platform team confirms that the developer workstations run Claude Code v2.1.195 or later and that the LiteLLM proxy runs a release that supports the gateway login flow. The LiteLLM releases page lists v1.105.1 as published October 14, 2026, but the release you deploy should be chosen from the supported minor versions in the LiteLLM enterprise documentation and checked against the Claude Code gateway tutorial. The step closes when a test workstation reports the Claude Code version and the proxy health endpoint returns a healthy status.
Enable SSO in the LiteLLM admin UI
An administrator enables SSO in the LiteLLM admin UI and registers the chosen identity provider, which can be Google, Microsoft Entra ID, Okta or a generic OIDC provider. Redirect URIs, client credentials and the SSO settings keys should be taken exactly from the admin UI SSO documentation rather than from memory. Up to 5 SSO users are free from v1.76.0, so a pilot group can start without a license, but a larger rollout needs an Enterprise license. The step closes when a pilot user can sign in to the admin UI through the identity provider.
Create teams and users that budgets attach to
The administrator creates the team and user structure that spend and budgets will be tied to, usually one team per group that shares a budget, with each developer mapped to a LiteLLM user inside it. Team and user creation is done in the admin UI or through the management API, and the exact fields should be confirmed in the virtual keys and access control documentation. Decide before this step whether team membership will be managed by hand or by identity provider groups, because that choice determines what needs Enterprise features. The step closes when a test user appears under the intended team in the admin UI.
Set per-user and per-team budgets and model restrictions
For each team and each user, the administrator sets budgets, TPM and RPM limits, and the models that virtual keys may call, using the settings described in the virtual keys documentation. Temporary budget increases can be used for planned spikes, and these should be recorded so they can be reversed. Agree the budget values with the engineering manager and finance owner in writing, since the gateway enforces whatever is set. The step closes when a test key shows the expected budget and model list and a request to a model outside the list is rejected.
Point Claude Code at the gateway with managed settings
The platform team distributes managed settings to developer machines so Claude Code sends its traffic to the LiteLLM gateway address and uses the gateway login, following the Claude Code gateway tutorial. Confirm the exact settings file location, environment variables and login keys in that tutorial before writing them to a device, because the names change between releases. Deploy the settings through your existing device management tooling so developers do not edit them by hand. The step closes when Claude Code on a pilot machine reports the gateway address as its endpoint.
Run OAuth device sign-in as a pilot user
A pilot developer runs the Claude Code login flow, which opens the device sign-in through the identity provider, and completes authentication. LiteLLM then issues a token tied to that user and team, which each subsequent request carries. Note any sign-in errors, such as an expired session, a user missing from the team, or a user blocked by a model restriction, and fix them before wider rollout. The step closes when the pilot developer can send a prompt through Claude Code and receive a response from an allowed model.
Confirm spend appears against the pilot user
The administrator checks the admin UI and the spend records to confirm that the pilot prompt is counted against the pilot user and the correct team. Spend updates may be batched before they appear, so allow the normal reporting delay described in the production guide before concluding that tracking has failed. Repeat the test with a second user in a different team to confirm that budgets and attribution stay separate. The step closes when both users show their own spend and the team totals match the sum of their requests.
How identity, teams and budgets map between your IdP and LiteLLM
This table compares each identity concept in your IdP with its LiteLLM counterpart and shows whether SSO sign-in creates it or an administrator must set it up. Read it before designing team structure, because group claims determine how developers are placed into teams. Confirm how group claims are carried in the Claude Code gateway tutorial before you commit to a team model.
| Identity concept | LiteLLM object | How it is set up |
|---|---|---|
| Developer identity (email, subject) | LiteLLM user | Created on first SSO sign-in in the admin UI flow; confirm whether user creation is automatic for your version. |
| IdP group membership | LiteLLM team | Not guaranteed by SSO alone; confirm in the tutorial how group claims are passed and whether teams are auto-created or must be pre-created. |
| Per-developer access token | Virtual key tied to user and team | Issued through the gateway login flow; each request carries a LiteLLM token linked to the developer and team. |
| Per-developer spend cap | User or key budget | Set by an administrator or template; SSO sign-in does not assign amounts from IdP attributes. |
| Team spend cap | Team budget | Configured manually in LiteLLM per team; keep team names aligned with IdP groups to avoid drift. |
| Requests per minute and tokens per minute | RPM and TPM limits on user, key or team | Set manually; apply limits to the smallest scope that matches your governance model. |
| Permitted Claude models | Model access list on key or team | Restricted manually in LiteLLM; SSO does not map IdP groups to model permissions. |
| Automated deprovisioning and group sync | SCIM provisioning | Requires LiteLLM Enterprise beyond 5 SSO users; without it, plan manual offboarding and budget clean-up. |
When SSO for Claude Code needs a LiteLLM Enterprise license
SSO sign-in for Claude Code needs a LiteLLM Enterprise license once more than 5 users sign in. From v1.76.0, LiteLLM's admin UI SSO is free for up to 5 users, and the gateway login that Claude Code uses through /login follows that same limit. A pilot of a few developers can therefore run on the open-source release with the identity provider, but a wider rollout needs an Enterprise license covering every SSO user, not only the overflow. Count the users who will actually sign in through the identity provider, not the total developer headcount, and confirm with LiteLLM how service accounts and admin users are counted before you commit to a number.
Enterprise adds several features beyond the SSO limit: SCIM, JWT authentication with identity provider tokens, audit logs, organization and team RBAC, IP allowlisting, secret manager integrations (AWS, Azure, Google, HashiCorp Vault and CyberArk), team-level guardrails and logging, and support terms that include a dedicated engineering channel and optional 24/7 SLAs. A Claude Code rollout depends most on SSO itself and team RBAC, since per-developer spend, budgets and team membership hang off those. Audit logs and secret manager integrations matter if your security team must evidence who used which model or where the gateway's keys are stored. SCIM and JWT authentication matter only if you want group membership to drive access automatically or if you plan a token-based alternative to the device sign-in. Support terms matter when the gateway is a shared dependency for many developers.
Get the license terms, the user counting rules, the support tiers and the price in writing from LiteLLM before the pilot widens. DeployOpen does not set LiteLLM license prices, so the quote must come from the vendor, and it should state which features are included, how renewals work and what is one-time versus recurring. Confirm the minimum Claude Code version your developers run (v2.1.195 or later) against the rollout plan at the same time.
Securing the Claude Code gateway login
Single sign-on decides who can start a Claude Code session, but the gateway decides what that session can reach and what it can cost. The five controls below work together: the master key and virtual keys limit what a credential is, model and budget settings limit what it can do, and network and admin controls limit who can touch the gateway at all.
Protect the master key
LITELLM_MASTER_KEY must start with sk- and holds full administrative power over the proxy, so it should never sit in a config file, shell profile or developer laptop. Store it in a secret manager and inject it at runtime, using one of the secret manager integrations that LiteLLM Enterprise supports if your organization needs them. Check that the key rotates on a schedule you can name and that only the deployment pipeline can read it.
Scope models to keys and teams
Restrict each virtual key or team to the models its developers actually need, so a credential issued for routine coding cannot call the most expensive model in your catalog. Review the allowed list whenever a provider adds or retires a model. Ask your LiteLLM contact or test in your own environment which model restrictions apply to the Claude Code login flow before you rely on them.
Bound spend and request rates
Set per-developer budgets and TPM or RPM limits so that a stolen or misused token has a ceiling on damage. Temporary budget increases should be approved by a named owner and expire automatically. Confirm with a test that the budget and rate limit trip for a session that is signed in through SSO, because a missing limit on the login path would leave the token unbounded.
Virtual keys docsRestrict network reach to the gateway
Decide which networks can reach the proxy and its login endpoints before any developer signs in. Place the gateway behind a private load balancer or VPN for internal developers, and use IP allowlisting, which is part of LiteLLM Enterprise, where your policy requires it. Confirm that the database and Redis are not reachable from developer networks at all.
Review admin access and audit logs
Limit the admin UI to a small named group and review who holds admin roles each quarter. Audit logging and organization and team RBAC are part of LiteLLM Enterprise, so ask whether your edition covers the admin actions you need to trace. Make sure key creation, budget changes and role changes reach your SIEM, and that someone reviews them.
How to test the rollout before every developer gets access
Start with a staged pilot of one or two developers on a single team, and do not open the gateway to everyone until each control below has been observed working and written down. The first check is sign-in: the pilot developers should run Claude Code's login, complete the identity provider flow, and confirm that requests arrive at LiteLLM tied to their own user and team. Then inspect the token scope. Confirm that the token LiteLLM issues grants only the model routes the team is meant to use, and that a developer cannot reach a model group assigned to another team by changing settings locally.
Next, test enforcement with a deliberately low budget. Assign the pilot key a small test limit, run enough Claude Code sessions to cross it, and confirm that LiteLLM blocks further requests and reports the breach in the admin UI. Check that the per-developer spend view matches the requests you sent, and reconcile a sample of those totals against the provider's usage data. Test a temporary budget increase as well, because support staff will need that path during real work. Record the budget values, the time LiteLLM took to enforce them and any gaps between the gateway's figures and the provider's.
Then test offboarding, which is where SSO rollouts most often fail. Remove a pilot developer from the group or application in the identity provider, then check how long their existing Claude Code session and their LiteLLM access keep working. Confirm with your identity team and the LiteLLM documentation how group removal propagates to the gateway in your configuration. If you plan to keep older clients, also run a Claude Code version outside the supported range, such as one below v2.1.195, and record exactly how it fails. Write every result, version and setting into a rollout record before wider access begins.
Common Claude Code gateway sign-in failures and their fixes
This table lists the sign-in and access failures teams most often hit when Claude Code connects through a LiteLLM gateway with SSO. Each row gives the likely cause, the check to run and the fix, so you can work from the symptom back to the setting. Error text varies by LiteLLM version, so confirm messages against the release you run before acting on them.
| Symptom | Likely cause | Check to run | Fix |
|---|---|---|---|
| Sign-in redirect fails at the identity provider | Callback URL or client settings in the identity provider do not match the gateway URL, or the gateway is reached through a different hostname than the one registered | Compare the redirect URI registered with your identity provider against the public gateway URL, including scheme, host and path | Register the exact gateway callback URL with the identity provider and set the gateway's public base URL to the same host developers use |
| Claude Code cannot complete the login flow | Claude Code is older than v2.1.195, the first version that supports this gateway login | Run the Claude Code version command on the affected machine and compare it with the required minimum | Upgrade Claude Code through your managed software channel and confirm the version across the fleet before retrying |
| Requests rejected after budget exhaustion | The user, key or team has reached its budget, or a temporary increase has expired | Review the spend and budget values for that user, key and team in the admin UI or the spend reports | Raise the budget for a defined period, or issue a temporary budget increase and record who approved it |
| User missing from team spend reports | The user signed in but was not assigned to a team, or the team mapping was never synced from the identity provider | Check the user's team membership in the admin UI and confirm the identity provider group or claim that should map to it | Assign the user to the correct team and fix the group mapping so future sign-ins land in the right team |
| Gateway fails with several proxy instances | Redis is missing or runs below version 7.0, so shared rate limits, router state and cache cannot be coordinated across instances | Confirm the Redis version and that every proxy instance points to the same Redis endpoint in its configuration | Deploy Redis 7.0 or newer, point all instances at it and restart the proxy pods so they share state |
| SSO disabled for users beyond the free five | More than five SSO users are active without an Enterprise license, and SSO is free for up to five users from v1.76.0 | Count active SSO users against the five-user limit and confirm whether your deployment holds an Enterprise license | Obtain an Enterprise license covering your user count, or limit SSO to five users until licensing is in place |
Questions teams ask before connecting Claude Code to LiteLLM
What does it cost to connect Claude Code to LiteLLM, and what recurs?
The software side is priced by LiteLLM's license terms, and the rest is labor and infrastructure you pay for separately. LiteLLM is dual licensed: content under the enterprise/ directory uses the enterprise license, and everything else is under the MIT license, so the open-source gateway itself carries no license fee. SSO for this flow needs a LiteLLM Enterprise license once you have more than 5 SSO users, since from v1.76.0 SSO is free for up to 5 users. One-time costs are the design, configuration and identity provider work. Recurring costs are the database and Redis services, compute for the proxy, model provider usage, Enterprise licensing if it applies, and the people who upgrade and operate the gateway. Ask any quote to separate these lines and state which ones it includes.
How long does a Claude Code pilot and rollout take?
The duration depends mainly on how quickly your identity provider admin, platform team and pilot developers can be scheduled, and on how many developers and teams you bring on. A pilot usually covers a small developer group, managed settings, spend limits and a check of the Claude Code version each developer runs. A wider rollout adds device-level managed settings, team and budget structure, and support for the people who hit sign-in problems. Your Enterprise licensing decision also affects the schedule if you exceed 5 SSO users. Ask for a written phase plan with entry and exit criteria for each phase before work begins.
What must our internal team provide before the work starts?
Three groups of people and access are needed. First, an identity provider administrator who can register LiteLLM as an application, configure the sign-in flow and manage group membership. Second, a pilot group of developers who use Claude Code daily and can report sign-in and model access problems. Third, platform staff who own the Kubernetes or infrastructure where LiteLLM runs, the PostgreSQL database and the Redis instance once more than one proxy instance runs. Your team also needs to decide who holds the LITELLM_MASTER_KEY and where it is stored, which should be a secret manager. Confirm these owners and their availability in the written scope.
Can our own engineers build this without outside help?
Yes, if your team already runs Kubernetes, PostgreSQL, Redis and an identity provider, and has someone who can read the LiteLLM documentation closely. The work is not unusual, but it touches four areas at once: sign-in, virtual keys and budgets, the proxy's deployment and the developer machines. Teams without recent experience in one of these areas usually spend more time on the first pilot. An outside partner is useful when you want a fixed scope, a documented handover and a tested rollout on a schedule your team cannot staff. DeployOpen implements, configures, documents and supports self-hosted platforms in your own infrastructure, and most engagements are fixed-scope with scope, deliverables and timelines agreed in writing before work starts.
When does the LiteLLM Enterprise license apply to Claude Code sign-in?
The Enterprise license applies once SSO sign-in for the gateway serves more than 5 users. From v1.76.0, the LiteLLM admin UI SSO supports Google, Microsoft Entra ID, Okta and generic OIDC providers for free up to 5 users, and an Enterprise license is needed beyond that. For this Claude Code flow, the same rule applies, so a pilot of five or fewer developers can run without Enterprise. Count the people who will sign in, not the number of gateway admins, and confirm with LiteLLM how it measures users before you plan the rollout. Enterprise also adds SCIM, audit logs, team-level RBAC and secret manager integrations, which you should evaluate on their own merits.
What changes when we move to a newer LiteLLM release?
Each upgrade needs a check of the Claude Code version, the database migration and the SSO configuration. LiteLLM maintains support for the four most recent stable minor versions for both open source and Enterprise deployments, so you have a defined window to plan. The latest release listed on the LiteLLM releases page at the time of research was v1.105.1, published October 14, 2026, so confirm the current release before you plan. Claude Code v2.1.195 or later is required for this flow, so a LiteLLM upgrade may also require a developer client update. Plan the upgrade in a staging environment, back up PostgreSQL first, and test sign-in with a pilot group before rolling the change to all developers.
How DeployOpen scopes and delivers a Claude Code gateway rollout
DeployOpen plans, implements, hardens and documents Claude Code through a self-hosted LiteLLM gateway with SSO sign-in, inside infrastructure you control. Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
How we scope
- Confirm the Claude Code version your developers will run, starting from v2.1.195 or later
- Map your identity provider, user count and whether you need Enterprise SSO beyond five users
- Agree written deliverables for managed settings, budgets, team structure and log retention
How we build
- Deploy the LiteLLM proxy with PostgreSQL and Redis in your cloud accounts or data centers
- Configure OAuth device sign-in through your identity provider and test it with pilot developers
- Set per-developer and per-team budgets, rate limits and model restrictions, then test each control
How we hand over
- Deliver managed settings files, deployment steps and a runbook for onboarding and offboarding developers
- Document the secret handling for the master key, database credentials and provider keys
- Provide evidence of configuration and test results your security and compliance teams can review
How we support
- Offer ongoing support, LiteLLM upgrades and continuous testing as a retainer after handover
- Plan upgrades to stay on a supported LiteLLM release line and retest the Claude Code path
- Confirm with your team which support channel and response terms apply to your edition

