Discover and explore top open-source AI tools and projects—updated daily.
codingworkflowAPI gateway for Claude models with OpenAI compatibility
Top 96.9% on SourcePulse
Provides an OpenAI-compatible API gateway for the Claude Code CLI, enabling developers to integrate Claude models into existing applications and workflows designed for OpenAI APIs. This project targets developers seeking to leverage Claude's capabilities through a familiar API interface, offering a seamless transition and enhanced flexibility.
How It Works
This project acts as a middleware layer, exposing standard OpenAI API endpoints such as /v1/chat/completions and /v1/models. It routes incoming requests to the underlying Claude Code CLI, translating them into a format the CLI understands. Key features include support for both streaming and non-streaming chat completions, alongside a flexible model aliasing and fallback mechanism to ensure robustness when specific model versions are unavailable.
Quick Start & Requirements
git clone https://github.com/codingworkflow/claude-code-api
cd claude-code-api
make install
make start
make.bat install and start.bat. Note that Claude Code CLI support on Windows may require WSL.http://localhost:8000, OpenAPI docs: http://localhost:8000/docs, Health: http://localhost:8000/health.claude_binary_path and database_url are in claude_code_api/core/config.py. Model configurations can be managed in claude_code_api/config/models.json or via the CLAUDE_CODE_API_MODELS_PATH environment variable.Highlighted Details
/v1/chat/completions, /v1/models, and session/project APIs.opus, claude-opus-latest) and fallback behavior, retrying with alternative configured models if the primary choice fails.model field in requests is optional; if omitted, the Claude Code CLI's default model is used.Maintenance & Community
Bug reports and support are managed through a discussion thread linked to the ai-code-fusion repository: https://github.com/codingworkflow/ai-code-fusion/discussions/151. Developer-specific documentation is available at docs/dev.md.
Licensing & Compatibility
This project is licensed under the GNU General Public License v3.0 (GPL-3.0). This is a strong copyleft license, which may impose restrictions on linking with proprietary or closed-source software, requiring careful consideration for commercial adoption.
Limitations & Caveats
The project's functionality is dependent on the correct installation and configuration of the Claude Code CLI. Windows users may require the Windows Subsystem for Linux (WSL) for full compatibility. The GPL-3.0 license necessitates careful review for any integration into commercial or closed-source products.
1 week ago
Inactive