claude-code-nexus  by KroMiose

Claude API proxy for OpenAI-compatible services

Created 10 months ago
253 stars

Top 99.4% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a Cloudflare Worker-based proxy platform designed to make the Claude Code CLI seamlessly compatible with any OpenAI-compatible API service. It targets developers seeking to avoid vendor lock-in and leverage diverse AI backend providers, offering benefits like cost optimization, flexible service selection, and enhanced global accessibility for AI applications.

How It Works

Claude Code Nexus acts as an intermediary, deploying on Cloudflare Workers for edge performance. It intercepts requests intended for Claude's API and forwards them to a user-configured OpenAI-compatible backend, such as OneAPI, Azure OpenAI, or local Ollama instances. A key feature is its smart model mapping capability, configurable via a web UI, which allows users to alias models (e.g., mapping claude-3-haiku to gpt-4o-mini) without altering their Claude Code CLI setup. The platform supports the Claude Messages API, including streaming responses (SSE), tool usage, and multi-modal inputs, ensuring broad compatibility.

Quick Start & Requirements

  1. Login & Get API Key: Visit https://claude.nekro.ai/ and log in with your GitHub account to obtain a unique API key.
  2. Configure Backend Service: In the console, provide your OpenAI-compatible API service's Base URL and API Key.
  3. Use Claude Code: Set the following environment variables in your terminal:
    • export ANTHROPIC_API_KEY="ak-your-nexus-key"
    • export ANTHROPIC_BASE_URL="https://claude.nekro.ai"

Highlighted Details

  • Vendor Unlocking: Enables free choice of AI service providers based on cost and performance.
  • Seamless Compatibility: Fully supports Claude Messages API features, including streaming, tool use, and multi-modal inputs.
  • Smart Model Mapping: A web interface allows flexible configuration of model name translations between Claude and OpenAI-compatible services.
  • Global Acceleration: Utilizes Cloudflare's global network for low-latency, high-availability access.
  • Tech Stack: Built with Hono on Cloudflare Workers (backend), React/Vite on Cloudflare Pages (frontend), Cloudflare D1/Drizzle ORM (database), and Material-UI.

Maintenance & Community

The project encourages community involvement through GitHub Issues for bug reporting and GitHub Discussions for suggestions. It also highlights a related project, Nekro Agent, an AI Agent framework.

Licensing & Compatibility

This project is licensed under the MIT License, which is permissive and generally suitable for commercial use and integration into closed-source projects.

Limitations & Caveats

The platform's performance and reliability are dependent on the user's configured backend AI service and Cloudflare's infrastructure. Specific limitations regarding unsupported API features or potential backend incompatibilities are not detailed in the provided documentation.

Health Check
Last Commit

9 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
3 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.