🔓 unclaimed — this page was auto-generated from GitHub. Are you the creator?
Claim this page →
claude-code-api
claude-code-api — a Claude ecosystem project on GitHub.
git clone https://github.com/codingworkflow/claude-code-api
Claude 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.
// compatibility
| Platforms | cli, api |
|---|---|
| Operating systems | — |
| AI compatibility | claude |
| License | GPL-3.0 |
| Pricing | open-source |
| Language | Python |
// faq
What is claude-code-api?
claude-code-api is a Claude ecosystem project. It is open-source on GitHub.
Is claude-code-api free to use?
claude-code-api is open-source under the GPL-3.0 license, so it is free to use.
What category does claude-code-api belong to?
claude-code-api is listed under data in the Claudeers registry of Claude-compatible tools.
// embed badge
[](https://claudeers.com/claude-code-api)
// retro hit counter
[](https://claudeers.com/claude-code-api)
// reviews
// guestbook
// related in Other
Open source Ghostty-based macOS terminal with vertical tabs and notifications for AI coding agents. Built for multitasking, organization, and programmability.
Huashu Design · HTML-native design skill for Claude Code · Claude Code 里 HTML 原生的设计 skill · 高保真原型 / 幻灯片 / 动画 + 20 设计哲学 + 5 维评审 + MP4 导出 · Agent-agnostic
一份通俗易懂、风趣幽默的Java学习指南,内容涵盖Java基础、Java并发编程、Java虚拟机、Java企业级开发、Java面试等核心知识点。学Java,就认准二哥的Java进阶之路😄
🎬 卡卡字幕助手 | VideoCaptioner - 基于 LLM 的智能字幕助手 - 视频字幕生成、断句、校正、字幕翻译全流程处理!- A powered tool for easy and efficient video subtitling.