codingworkflow/claude-code-api
À propos
Model config is in claude_code_api/config/models.json. Override with CLAUDE_CODE_API_MODELS_PATH.
Outils de développementProgression mesurée des étoiles
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- -1
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalClaude Code API Gateway
OpenAI-compatible API gateway for Claude Code CLI.
What You Get
- OpenAI-style endpoints (
/v1/chat/completions,/v1/models, sessions/projects APIs) - Streaming and non-streaming chat completions
- Claude model aliases and fallback behavior
- Optional
modelfield: if omitted, CLI default model is used
Quick Start (Linux/macOS)
git clone https://github.com/codingworkflow/claude-code-api
cd claude-code-api
make install
make start
Server URLs:
- API:
http://localhost:8000 - OpenAPI docs:
http://localhost:8000/docs - Health:
http://localhost:8000/health
Quick Start (Windows)
Use the provided wrappers:
make.bat install
start.bat
Notes:
start.batstarts the API in dev mode.make.batprovides common project commands.- Claude Code CLI support on Windows may require WSL depending on your local setup.
Supported Models
Model config is in claude_code_api/config/models.json.
Override with CLAUDE_CODE_API_MODELS_PATH.
claude-opus-4-6-20260205claude-opus-4-5-20251101claude-sonnet-4-5-20250929claude-haiku-4-5-20251001
Alias/fallback behavior:
modelis optional in/v1/chat/completions.opus,claude-opus-latest,claude-opus-4-6resolve to Opus 4.6.- If Opus 4.6 is rejected at runtime, gateway retries once with latest configured Opus 4.5.
- If all attempted models are rejected, API returns
400witherror.code = model_not_supported.
API Usage
Chat completion:
curl -X POST http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "user", "content": "Hello"}
]
}'
List models:
curl http://localhost:8000/v1/models
Streaming:
curl -X POST http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-5-20250929",
"messages": [{"role": "user", "content": "Tell me a joke"}],
"stream": true
}'
Configuration
Common settings are in claude_code_api/core/config.py:
claude_binary_pathproject_rootdatabase_urlrequire_auth
Bug Reports & Support
For claude-code-api and ai-code-fusion, use this discussion thread for bug reports and troubleshooting:
Developer Docs
For engineering workflows and internal commands:
docs/dev.md
License
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Explorer des projets similaires
Chargement…