Discover and explore top open-source AI tools and projects—updated daily.
RichardAtCTOpenAI-compatible API wrapper for Claude Code
Top 81.4% on SourcePulse
This project provides an OpenAI API-compatible wrapper for Anthropic's Claude Code models, enabling developers to integrate Claude's capabilities into existing applications and workflows that rely on OpenAI's client libraries. It targets developers, researchers, and power users seeking to leverage advanced Claude models through a familiar API interface, offering benefits such as seamless integration, real-time cost tracking, and enhanced session management.
How It Works
The wrapper functions as a FastAPI server that translates incoming OpenAI API requests into calls directed at the Claude Code CLI, utilizing the official Claude Agent SDK (v0.1.6). It intelligently handles authentication across multiple providers (API key, Bedrock, Vertex AI, CLI), validates and selects Claude models, processes system prompts, and supports both streaming and non-streaming responses. By default, it disables tools for performance, mirroring OpenAI's default behavior, but allows optional tool enablement for specific tasks like file I/O or bash commands.
Quick Start & Requirements
npm install -g @anthropic-ai/claude-codegit clone https://github.com/RichardAtCT/claude-code-openai-wrappercd claude-code-openai-wrapper && poetry installpoetry run uvicorn src.main:app --reload --port 8000Highlighted Details
/v1/chat/completions endpoint compatibility.session_id for maintaining conversation history.Maintenance & Community
The project has recently undergone a major update (v2.0.0) migrating to the Claude Agent SDK, indicating active development. No specific community channels (like Discord or Slack) or notable contributors/sponsorships are detailed in the README.
Licensing & Compatibility
The project is released under the MIT License, permitting commercial use and modification with attribution. It is designed for compatibility with all standard OpenAI client libraries.
Limitations & Caveats
Function calling is not directly supported, with tools being enabled via prompt-based configurations. Several OpenAI parameters like temperature, top_p, and max_tokens are not yet mapped. The wrapper also does not support generating multiple responses (n > 1) per request, and images within messages are converted to text placeholders.
5 days ago
Inactive
anthropics