OpenAI-compatible API interface for Anthropic's Claude models
A proxy-adapter system that provides an OpenAI-compatible API for Anthropic's Claude models. Use Claude intelligence within existing OpenAI-based tooling and infrastructure — without rewriting your code.
graph LR
subgraph Client["Client Applications"]
A[OpenAI SDK]
B[ChatGPT Plugins]
C[Custom Apps]
end
subgraph Bridge["Claude-OpenAI Bridge"]
D[Request Interceptor]
E[Payload Transformer]
F[Response Mapper]
end
subgraph Anthropic["Anthropic API"]
G[Claude Models]
end
A --> D
B --> D
C --> D
D --> E
E -->|Claude API Format| G
G -->|Claude Response| F
F -->|OpenAI Format| A
F --> B
F --> C
The bridge operates as a transparent translation layer between OpenAI-compatible clients and Anthropic's Claude API.
sequenceDiagram
participant Client as Client (OpenAI SDK)
participant Proxy as Claude-OpenAI Bridge
participant Claude as Anthropic Claude API
Client->>Proxy: POST /v1/chat/completions
Note over Proxy: Intercept OpenAI request
Proxy->>Proxy: Transform payload to Claude format
Proxy->>Claude: POST /v1/messages
Claude-->>Proxy: Claude response
Proxy->>Proxy: Map response to OpenAI format
Proxy-->>Client: OpenAI-compatible response
| Step | Description |
|---|---|
| 1. Intercept | Receives standard OpenAI API requests (/v1/chat/completions, /v1/models, etc.) |
| 2. Transform | Converts OpenAI request schema to Anthropic Claude message format |
| 3. Forward | Sends transformed request to Claude API |
| 4. Map | Converts Claude response back to OpenAI-compatible response format |
- Python 3.10+ or Node.js 18+
- An Anthropic API key
# Clone the repository
git clone https://github.com/ATC-O48/Claude-OpenAI-Code..git
cd Claude-OpenAI-Code.
# For Node.js/TypeScript
npm install
# For Python
pip install -r requirements.txt# Set your Anthropic API key
export ANTHROPIC_API_KEY="your-api-key-here"
# Start the proxy server
./upload-all.sh| Endpoint | Method | Description |
|---|---|---|
/v1/chat/completions |
POST | Chat completions (maps to Claude Messages API) |
/v1/models |
GET | List available models |
/v1/health |
GET | Service health check |
POST /v1/chat/completions
Accepts standard OpenAI chat completion requests and translates them to Claude API calls.
curl http://localhost:3000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ANTHROPIC_API_KEY" \
-d '{
"model": "claude-sonnet-4-20250514",
"messages": [
{"role": "user", "content": "Hello, how are you?"}
],
"max_tokens": 1024
}'import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.ANTHROPIC_API_KEY,
baseURL: "http://localhost:3000/v1",
});
const response = await client.chat.completions.create({
model: "claude-sonnet-4-20250514",
messages: [{ role: "user", content: "Explain quantum computing" }],
max_tokens: 1024,
});
console.log(response.choices[0].message.content);from openai import OpenAI
client = OpenAI(
api_key="your-anthropic-api-key",
base_url="http://localhost:3000/v1",
)
response = client.chat.completions.create(
model="claude-sonnet-4-20250514",
messages=[{"role": "user", "content": "Write a haiku about coding"}],
max_tokens=1024,
)
print(response.choices[0].message.content)| Variable | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY |
Yes | Your Anthropic API key |
PORT |
No | Server port (default: 3000) |
LOG_LEVEL |
No | Logging level: debug, info, warn, error |
| Claude Model | OpenAI Mapping | Description |
|---|---|---|
claude-opus-4-20250514 |
claude-opus-4-20250514 |
Most capable model for complex tasks |
claude-sonnet-4-20250514 |
claude-sonnet-4-20250514 |
Balanced performance and speed |
claude-haiku-3-5-20241022 |
claude-haiku-3-5-20241022 |
Fastest model for simple tasks |
| Claude-OpenAI Bridge | Transparent translation layer between OpenAI and Anthropic API protocols |
| Agent AI | Autonomous agent logic for planning and tool usage via LLMs |
| Proxy-Adapter Pattern | Clean architecture for intercepting and transforming API payloads |
| Multi-runtime Support | Native implementations for both Python and Node.js environments |
| Apple Integration | Support for Xcode, Swift Package Manager, CocoaPods, and Fastlane |
- Streaming response support
- Function calling / tool use translation
- Rate limiting and request queuing
- Response caching layer
- Docker deployment support
- OpenAPI specification
- SDK wrappers for common languages
- Metrics and monitoring dashboard
Contributions are welcome! Please read our Contributing Guide for details on development setup, code style, and the PR process.
# Fork and clone
git clone https://github.com/<your-username>/Claude-OpenAI-Code..git
cd Claude-OpenAI-Code.
# Create a feature branch
git checkout -b feature/your-feature-name
# Make changes, test, commit and push
git commit -m "feat: your feature description"
git push origin feature/your-feature-nameThen open a pull request against main.
This project is licensed under the Boost Software License 1.0.
- Organization: ATC-O48
- Project Link: github.com/ATC-O48/Claude-OpenAI-Code.