anthropic-proxy  by maxnowack

Proxy Anthropic API to OpenAI format for OpenRouter

Created 6 months ago
335 stars

Top 82.0% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a proxy server that translates Anthropic API requests into the OpenAI format, routing them through OpenRouter. It allows users to leverage Anthropic's models, specifically Claude Code, with an OpenAI-compatible interface via OpenRouter, simplifying integration and potentially offering cost or access benefits.

How It Works

The proxy intercepts incoming requests formatted for Anthropic's API. It then transforms these requests into the equivalent OpenAI API format and forwards them to a specified base URL, defaulting to openrouter.ai. This approach abstracts the underlying API differences, enabling seamless use of Anthropic models through an OpenAI-compatible gateway.

Quick Start & Requirements

  • Primary install / run command: OPENROUTER_API_KEY=your-api-key npx anthropic-proxy
  • Prerequisites: Node.js, OPENROUTER_API_KEY environment variable (unless ANTHROPIC_PROXY_BASE_URL is custom).
  • Links: Claude Code Setup

Highlighted Details

  • Converts Anthropic API requests to OpenAI format.
  • Routes requests through OpenRouter by default.
  • Supports custom base URLs and ports.
  • Configurable reasoning and completion models.

Maintenance & Community

Contributions are welcome via issues and pull requests.

Licensing & Compatibility

Licensed under the MIT license. This license is permissive and generally compatible with commercial and closed-source applications.

Limitations & Caveats

The proxy is designed for specific use cases involving Anthropic models and OpenRouter. Customization of models is supported, but compatibility with all Anthropic API features or future changes is not guaranteed.

Health Check
Last Commit

4 months ago

Responsiveness

Inactive

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

Explore Similar Projects

Feedback? Help us improve.