litellm/docs/my-website/docs/proxy/cli_sso.md
Ishaan Jaff bdb1e16dcf
[Feat] AI Gateway Auth - Allow using JWTs for signing in with Proxy CLI (#16756)
* fix auth

* get_cli_jwt_auth_token

* fix linting

* test fixes

* docs

* test fixes

* fix refactor
2025-11-17 19:47:29 -08:00

1.8 KiB

CLI Authentication

Use the litellm cli to authenticate to the LiteLLM Gateway. This is great if you're trying to give a large number of developers self-serve access to the LiteLLM Gateway.

Demo

Usage

Prerequisites - Start LiteLLM Proxy with Beta Flag

:::warning[Beta Feature - Required]

CLI SSO Authentication is currently in beta. You must set this environment variable when starting up your LiteLLM Proxy:

export EXPERIMENTAL_UI_LOGIN="True"
litellm --config config.yaml

Or add it to your proxy startup command:

EXPERIMENTAL_UI_LOGIN="True" litellm --config config.yaml

:::

Steps

  1. Install the CLI

    If you have uv installed, you can try this:

    uv tool install 'litellm[proxy]'
    

    If that works, you'll see something like this:

    ...
    Installed 2 executables: litellm, litellm-proxy
    

    and now you can use the tool by just typing litellm-proxy in your terminal:

    litellm-proxy
    
  2. Set up environment variables

    On your local machine, set the proxy URL:

    export LITELLM_PROXY_URL=http://localhost:4000
    

    (Replace with your actual proxy URL)

  3. Login

    litellm-proxy login
    

    This will open a browser window to authenticate. If you have connected LiteLLM Proxy to your SSO provider, you should be able to login with your SSO credentials. Once logged in, you can use the CLI to make requests to the LiteLLM Gateway.

  4. Make a test request to view models

    litellm-proxy models list
    

    This will list all the models available to you.