CORTEX
Back to Feed
r/ClaudeAI by Richardatuct New

Use your Claude subscription for your API keys - Claude Code OpenAI API Wrapper

5 points 6 comments 100% upvoted
View on Reddit

Content

**TL;DR:** Use your Claude subscription to make API calls anywhere the OpenAI API standard is supported. Open source wrapper that translates OpenAI API calls → Claude Agent SDK → back to OpenAI format. **GitHub:** [https://github.com/RichardAtCT/claude-code-openai-wrapper](https://github.com/RichardAtCT/claude-code-openai-wrapper) Hello fellow Clauders! I've posted about this project before, but it's grown significantly since then, so I figured it was worth another share. **What is it?** A FastAPI server that exposes OpenAI-compatible endpoints and translates them to Claude Agent SDK commands under the hood. This means you can plug Claude into any tool, library, or service that supports the OpenAI API standard. **Key features (v2.2.0):** * Full OpenAI SDK compatibility (`/v1/chat/completions`) * Native Anthropic Messages API (`/v1/messages`) * Streaming and non-streaming responses * Session continuity across requests (conversation memory!) * Multi-provider auth (API key, AWS Bedrock, Vertex AI, CLI auth) * Real-time cost and token tracking * Optional tool execution (file access, bash, etc.) * Interactive API explorer at the root URL * Docker support **Quick start:** git clone https://github.com/RichardAtCT/claude-code-openai-wrapper cd claude-code-openai-wrapper poetry install export ANTHROPIC_API_KEY=your-key poetry run uvicorn src.main:app --reload --port 8000 This has been a learning project for me, so feedback, issues, and PRs are all welcome. Let me know what you think! Cheers, Richard

Comments

No comments fetched yet

Comments are fetched when you run cortex fetch with comment fetching enabled