LiteLLM Claude Code Provider offers an OpenAI-compatible API interface for Claude Code. It enables developers to integrate Claude's capabilities into existing workflows using familiar OpenAI SDK patterns. Ideal for operations teams looking to automate code-related tasks, this provider supports Docker containers and connects to Claude agents.
git clone https://github.com/cabinlab/litellm-claude-code.gitLiteLLM Claude Code Provider bridges Claude Agent SDK with the OpenAI API standard, allowing developers to integrate Claude into applications built for OpenAI without code changes. The service runs as a Docker container and supports OAuth authentication for Claude Pro/Max users or Anthropic API keys, with automatic token persistence across restarts. It exposes Claude Opus, Sonnet, and Haiku models through a standard `/v1` endpoint, making Claude available to tools like LangChain, Open WebUI, and Graphiti. Setup requires downloading docker-compose configuration, setting a master key, and providing a Claude OAuth token—no complex credential management needed. Operations teams and developers can now leverage Claude's capabilities in existing workflows using familiar OpenAI SDK patterns.
Clone the repository or download docker-compose.yml and .env.example, set your LITELLM_MASTER_KEY in .env, generate a Claude OAuth token using `claude setup-token`, add the token to .env as CLAUDE_CODE_OAUTH_TOKEN, then run `docker-compose up -d`. The API will be available at http://localhost:4000/v1 with models named sonnet, opus, and haiku.
Integrate Claude into LangChain applications expecting OpenAI API keys
Use Claude with Open WebUI or other tools requiring OpenAI-compatible interfaces
Provide Claude access to teams via a centralized OpenAI-format API endpoint
Migrate from OpenAI to Claude without rewriting application code
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/cabinlab/litellm-claude-codeCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
I'm integrating LiteLLM Claude Code Provider into my [COMPANY]'s [INDUSTRY] workflow. I need to automate [SPECIFIC CODE TASK] using Docker containers. Provide me with a step-by-step guide and sample code snippets for this integration.
## Integration Guide for LiteLLM Claude Code Provider
### Step 1: Set Up Docker Container
```bash
# Pull the LiteLLM Docker image
docker pull litellm/litellm
# Run the container with Claude Code Provider
docker run -p 8000:8000 litellm/litellm --model claude-code
```
### Step 2: Install OpenAI SDK
```bash
pip install openai
```
### Step 3: Configure API Key
```python
import os
os.environ['OPENAI_API_KEY'] = 'your-api-key'
```
### Step 4: Make API Requests
```python
from openai import OpenAI
client = OpenAI(api_key=os.environ['OPENAI_API_KEY'])
response = client.chat.completions.create(
model='claude-code',
messages=[{'role': 'user', 'content': 'Write a Python function to analyze sales data.'}]
)
print(response.choices[0].message.content)
```
### Step 5: Handle Responses
```python
# Example response handling
if response.choices[0].finish_reason == 'stop':
print('Task completed successfully.')
else:
print('Task encountered an error.')
```Single API for 100+ LLM providers
Pioneering accessible, high-performance AI models
AI assistant built for thoughtful, nuanced conversation
Get more done every day with Microsoft Teams – powered by AI
Agentic AI Workflow platform
Connected workspace for docs, wikis, and projects
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan