LiteLLM Gateway
Proxy multi-provider para o ecossistema Claude Desktop
Visão Geral
O LiteLLM Gateway é um proxy multi-provider que roteia requisições da API do Claude Desktop (Electron) para diferentes backends baseado em tier e effort. Esta documentação cobre aproximadamente 120+ endpoints mapeados a partir do bundle Electron, organizados em 12 categorias.
Stack
| Camada | Tecnologia |
|---|---|
| Proxy | LiteLLM Gateway (localhost:4000) |
| Frontend | Claude Desktop (Electron + React SPA) |
| Backend | Anthropic API / MiMo / DeepSeek / MimoAuto |
| Transporte | HTTP REST + SSE + WebSocket + IPC Electron |
Categorias de API
| # | Categoria | Endpoints | Implementação |
|---|---|---|---|
| 1 | Messages API | 6 | NATIVO (LiteLLM router) |
| 2 | Models API | 2 | NATIVO (LiteLLM router) |
| 3 | Sessions & Code | 25+ | CUSTOM (hooks) |
| 4 | Organizations | 6 | PROXY (pass-through) |
| 5 | Auth / OAuth | 9 | PROXY (pass-through) |
| 6 | Account & Settings | 3 | PROXY (pass-through) |
| 7 | Cowork / Dispatch | 8 | CUSTOM (hooks) |
| 8 | Environments | 6 | CUSTOM (hooks) |
| 9 | Agents | 28+ | CUSTOM (hooks) |
| 10 | MCP | Overview | CUSTOM (hooks) |
| 11 | Voice / Audio | Proxy | PROXY (pass-through) |
| 12 | Event Logging | 3 | PROXY (pass-through) |
Legenda de Implementação
| Status | Significado |
|---|---|
| NATIVO | LiteLLM já suporta nativamente |
| CUSTOM | Precisa de hook personalizado |
| PROXY | Pass-through para Anthropic API |
| STUB | Stub local (resposta mockada) |
Começando
Configuração Rápida
# Iniciar o gateway
cd ~/.claude/infra/litellm-gateway
docker compose up -d
# Verificar healthcheck
curl http://localhost:4000/healthcheck
# Listar modelos
curl http://localhost:4000/v1/models \
-H "x-api-key: $ANTHROPIC_API_KEY"
Links Rápidos
- Messages API - POST /v1/messages
- Models API - GET /v1/models
- OAuth Profile - GET /api/oauth/profile
- Arquitetura do Sistema
- Diferenças 1P vs 3P
Mapa de Implementação LiteLLM
| Categoria | Total | NATIVO | CUSTOM | PROXY | STUB |
|---|---|---|---|---|---|
| Messages API | 4 | 4 | 0 | 0 | 0 |
| Models API | 2 | 2 | 0 | 0 | 0 |
| Sessions (SDK) | 14 | 0 | 14 | 0 | 0 |
| Code Sessions | 9 | 0 | 9 | 0 | 0 |
| Files API | 6 | 0 | 6 | 0 | 0 |
| Environments/Bridge | 8 | 0 | 8 | 0 | 0 |
| Environments (SDK) | 6 | 0 | 6 | 0 | 0 |
| Agents (SDK) | 6 | 0 | 6 | 0 | 0 |
| Vaults (SDK) | 11 | 0 | 11 | 0 | 0 |
| Memory Stores (SDK) | 11 | 0 | 11 | 0 | 0 |
| Skills (SDK) | 7 | 0 | 7 | 0 | 0 |
| User Profiles (SDK) | 5 | 0 | 5 | 0 | 0 |
| OAuth | 7 | 0 | 0 | 6 | 1 |
| Bootstrap | 2 | 0 | 0 | 2 | 0 |
| Organizations | 6 | 0 | 0 | 6 | 0 |
| Settings | 1 | 0 | 0 | 1 | 0 |
| Outros | 15+ | 0 | 0 | 9 | 6+ |
| TOTAL | ~120+ | 6 | 83 | 24 | 7+ |
Nota: Esta documentação foi gerada a partir do arquivo
API_SPEC_CONSOLIDATED.md, consolidado da engenharia reversa do bundle Electron do Claude Desktop (index.js 14MB, mainView.js 194KB, mainWindow.js 165KB). Schemas marcados como (NDA) contêm campos não divulgados publicamente pela Anthropic.