Connect the Claude CLI to MSK's Open WebUI instance at https://chat.aicopilot.aws.mskcc.org using a LiteLLM proxy.
This project provides a LiteLLM proxy that translates between the Claude CLI and MSK's Open WebUI, allowing you to use Claude Code CLI with MSK's internal AI infrastructure.
pip install -r requirements.txt- Log in to https://chat.aicopilot.aws.mskcc.org in your browser
- Open Developer Tools (F12)
- Go to Application/Storage → Cookies
- Copy the value of the
tokencookie
Create a .auth.env file in this directory:
export WEBUI_SESSION_TOKEN='your-token-here'Note: Add .auth.env to .gitignore to avoid committing your token.
The proxy automatically finds an available port starting from 22660 and saves it to .litellm_port:
./start_litellm_proxy.shThe proxy will:
- Find the next available port (starting from 22660)
- Save the port to
.litellm_portfor the Claude CLI to use - Listen on
http://localhost:<port> - Connect to MSK WebUI at
https://chat.aicopilot.aws.mskcc.org - Handle SSL verification for the internal MSK server
- Support all available models (Claude, GPT, Amazon Nova, Llama)
In a separate terminal, use the provided wrapper script:
# Use default model (claude-sonnet-4.5) in current directory
./connect_claude.sh
# Use a specific model
./connect_claude.sh -m claude-sonnet-4
# Use GPT models
./connect_claude.sh -m gpt-4o
./connect_claude.sh -m o1
# Work in a specific directory
./connect_claude.sh /path/to/project
# Use specific model in specific directory
./connect_claude.sh -m gpt-5 /path/to/projectAvailable models:
Claude Models:
claude-sonnet-4.5(default) - Latest Claude model - 65,536 max tokensclaude-sonnet-4- Claude Sonnet 4 - 65,536 max tokensclaude-3.7-sonnet- Claude 3.7 Sonnet - 65,536 max tokensclaude-3.5-sonnet- Claude 3.5 Sonnet - 8,192 max tokens
OpenAI GPT Models (via Azure):
gpt-5.2- GPT-5.2 - 16,384 max tokensgpt-5- GPT-5 - 16,384 max tokenso3- OpenAI o3 - 100,000 max tokensgpt-4o- GPT-4o - 16,384 max tokensgpt-4.1- GPT-4.1 - 128,000 max tokenso1- OpenAI o1 - 100,000 max tokens
Other Models:
amazon-nova-pro- Amazon Nova Pro - 32,768 max tokensllama-3.3-70b- Meta Llama 3.3 70B - 8,192 max tokensllama-3.2-90b- Meta Llama 3.2 90B - 8,192 max tokens
Note: Haiku models are not available on the MSK WebUI endpoint.
The proxy is configured with:
- Model mappings to MSK WebUI models (Claude, GPT, Amazon Nova, Llama)
- Per-model token limits
- SSL verification disabled for internal MSK server
- Environment variable substitution for session token
Configures Claude CLI to use the LiteLLM proxy:
- Sets
ANTHROPIC_AUTH_TOKENfor authentication - Configures base URL to
http://localhost:22660 - Disables telemetry and error reporting
Claude CLI → LiteLLM Proxy (localhost:<dynamic-port>) → MSK Open WebUI (HTTPS) → AI Models (Claude, GPT, Nova, Llama)
The LiteLLM proxy:
- Finds an available port and writes it to
.litellm_port - Receives requests from Claude CLI in Anthropic API format
- Translates them to OpenAI-compatible format
- Forwards to MSK WebUI with your session token
- Handles SSL verification bypass for internal MSK certificates
- Returns responses in the format Claude CLI expects
The connection script:
- Reads the port from
.litellm_port - Configures Claude CLI to use that port
- Launches Claude CLI with the selected model
If you get 401 errors, your session token may have expired. Get a new token from the browser and update .auth.env.
The proxy automatically handles SSL verification for the internal MSK server. If you still see SSL errors, make sure you're running the latest version of the proxy.
Some Claude models (like Haiku) are not available on MSK WebUI. If you try to use an unavailable model, you'll get an error. Use one of the supported models listed above instead.
The proxy automatically finds the next available port starting from 22660. The port is saved to .litellm_port and automatically read by the connection scripts. No manual configuration is needed.
start_litellm_proxy.sh- Starts the LiteLLM proxy serverstart_litellm.py- Python wrapper that patches SSL verification and finds available portlitellm_config.yaml- LiteLLM proxy configurationconnect_claude.sh- Wrapper to launch Claude CLI with proxysetup_claude_env.sh- Environment configuration for Claude CLI (reads.litellm_port).auth.env- Your session token (create this, not in git).litellm_port- Auto-generated port file (not in git)requirements.txt- Python dependencies
When running Claude CLI for the first time in a directory, it may hang when asking you to trust the working directory. This is a known issue with the CLI.
Workaround: Run Claude CLI without the custom endpoint first (using standard Claude), allow it to complete the trust prompt, then use the connector scripts afterward.
# First time in a new directory:
claude # Run vanilla Claude, complete trust prompt
# Then use the connector:
./connect_claude.shIf Claude runs out of context during a long session, use the /clear command to start fresh:
/clear
This clears the conversation history while keeping your working directory and configuration.
- Never commit
.auth.envto git - Session tokens expire periodically and need to be refreshed
- The proxy runs locally and only you can access it
- SSL verification is disabled only for the MSK internal server connection