claude-to-chatgpt  by jtsang4

API conversion tool for Claude models to OpenAI Chat API format

created 2 years ago
1,299 stars

Top 31.4% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a compatibility layer that allows applications designed for the OpenAI ChatGPT API to interact with Anthropic's Claude models. It targets developers and users who want to leverage Claude's capabilities within existing OpenAI-compatible workflows, offering a seamless integration path and supporting streaming responses.

How It Works

The project acts as a proxy, intercepting requests formatted for the OpenAI Chat API and translating them into the format required by Claude's Completion API. It handles model name mapping (e.g., gpt-3.5-turbo to claude-instant-1 or claude-2) and converts the response structure to match OpenAI's output, including support for streaming. This approach enables easy adoption without modifying client applications.

Quick Start & Requirements

  • Cloudflare Workers: Paste code from cloudflare-worker.js into a Cloudflare Worker.
  • Docker: docker run -p 8000:8000 wtzeng/claude-to-chatgpt:latest or docker-compose up.
  • API Key: Requires CLAUDE_API_KEY.
  • Dependencies: Node.js (for Cloudflare Workers), Docker.
  • Docs: https://github.com/jtsang4/claude-to-chatgpt

Highlighted Details

  • Converts Claude API to OpenAI Chat API format.
  • Supports streaming responses.
  • Supports claude-instant-1 and claude-2 models.
  • Deployable via Cloudflare Workers (100k requests/day) or Docker.

Maintenance & Community

The project is maintained by jtsang4. Community support channels are not explicitly mentioned in the README.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: Permissive MIT license allows for commercial use and integration with closed-source applications.

Limitations & Caveats

The project relies on specific model name mappings for Claude, which might require updates if Anthropic changes its API or model naming conventions. Cloudflare Workers deployment has a daily request limit.

Health Check
Last commit

11 months ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.