Skip to main content

Claude Code SSO

Choose Claude apps gateway setup, Lite CLI SSO, or Claude subscription through gateway.

Claude apps gateway setup​

Use the Claude apps gateway sign-in flow with LiteLLM implementing its gateway protocol. Requests go directly from Claude Code to LiteLLM, which handles provider credentials and usage tracking by user and team.

Prerequisites: Claude Code v2.1.195 or later and a LiteLLM gateway with Claude apps gateway SSO configured. Ask your administrator for the gateway URL.

1. Configure Claude Code​

Add the following to Claude Code's managed settings file:

managed-settings.json
{
"forceLoginMethod": "gateway",
"forceLoginGatewayUrl": "https://litellm.internal.example.com/claude_code_gateway"
}

Replace the hostname with your gateway's internal hostname. Keep /claude_code_gateway in the URL.

PlatformManaged settings file
macOS/Library/Application Support/ClaudeCode/managed-settings.json
Linux / WSL/etc/claude-code/managed-settings.json
WindowsC:\Program Files\ClaudeCode\managed-settings.json

These settings must be in the managed file. Claude Code ignores them in ~/.claude/settings.json.

2. Sign in​

Run claude, or enter /login in an existing session. Trust your gateway, complete SSO in the browser, and confirm the code shown in the terminal. Claude Code then shows Cloud gateway. Send a prompt and check LiteLLM Logs.

For network requirements and deployment options, see Claude's official gateway guide. The LiteLLM gateway reference covers managed policies, session lifetime, and known limits.

Lite CLI SSO​

Sign in to LiteLLM with your organization's SSO. Inference uses the gateway's provider credentials and is billed to your organization. A Claude subscription is not required.

Prerequisites: A Lite CLI build with saved sign-in settings and a gateway with CLI SSO enabled.

Configure once​

Replace the base URL with your gateway's URL. Set claude_subscription to false to select gateway-funded inference, including if you previously used subscription mode.

lite config set base_url https://dev.gateway.litellm-sandbox.ai
lite config set pkce true
lite config set claude_subscription false

Sign in and launch​

lite login      # only when you're not signed in; uses PKCE automatically
lite claude

Complete your organization's SSO in the browser. lite claude launches Claude Code with your LiteLLM credential. Send a prompt and check LiteLLM Logs.

Claude subscription through gateway​

Use your own Claude subscription for inference while routing requests through LiteLLM. Your claude.ai login stays active.

Prerequisites: A Lite CLI build with saved sign-in settings and a gateway configured for CLI SSO and Claude subscription routing.

Configure once​

Replace the base URL with your gateway's URL.

lite config set base_url https://dev.gateway.litellm-sandbox.ai
lite config set pkce true
lite config set claude_subscription true

Sign in and launch​

lite login      # only when you're not signed in; uses PKCE automatically
lite claude # keeps your claude.ai login; no flags needed

Remove any apiKeyHelper or static API credential from your Claude Code settings before using subscription mode.

lite login signs you in to LiteLLM. Claude Code keeps its own subscription login; if needed, sign in to your Claude account when prompted. Send a prompt and check LiteLLM Logs.

LiteLLM Enterprise
SSO/SAML, audit logs, spend tracking, multi-team management, and guardrails, built for production.
Learn more →