claude2api  by yushangxiao

API for Claude web service conversion

Created 5 months ago
439 stars

Top 68.1% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides an API service that wraps Claude's web interface, enabling programmatic access to its advanced features like image recognition, file uploads, and streaming responses. It targets developers and users who need to integrate Claude's capabilities into their applications, offering an OpenAI-compatible API for seamless integration.

How It Works

The service acts as a proxy, translating requests into the format understood by Claude's web service. It leverages session keys (e.g., sk-ant-sid01-*) to authenticate with Claude. Key features like image analysis are handled by constructing multi-modal message payloads, while long context is managed by uploading exceeding content as files. The API supports streaming for real-time outputs and offers automatic conversation management.

Quick Start & Requirements

  • Install/Run: Deploy via Docker (docker run ... or docker-compose up -d).
  • Prerequisites: Go 1.23+ (for building from source), Docker.
  • Configuration: Requires SESSIONS and APIKEY environment variables or a config.yaml file.
  • Docs: API Usage examples provided in README.

Highlighted Details

  • OpenAI-compatible API endpoint (/v1/chat/completions).
  • Supports image analysis via base64 encoded image URLs.
  • Automatic chat history management with file upload for long contexts.
  • Direct proxy option using sk-ant-sid01-* as keys.

Maintenance & Community

The project is maintained by yushangxiao. Contributions are welcome via pull requests.

Licensing & Compatibility

Licensed under the MIT License. This permissive license allows for commercial use and integration into closed-source applications.

Limitations & Caveats

Free users are limited to the claude-sonnet-4-20250514 model. The project relies on reverse-engineering Claude's web service, which could be subject to change by Anthropic, potentially breaking the API.

Health Check
Last Commit

2 months ago

Responsiveness

1 day

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

Explore Similar Projects

Starred by Patrick von Platen Patrick von Platen(Author of Hugging Face Diffusers; Research Engineer at Mistral) and Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera).

client-python by mistralai

0.6%
648
Python SDK for Mistral AI platform
Created 1 year ago
Updated 2 weeks ago
Starred by Adam Wolff Adam Wolff(Claude Code Core; MTS at Anthropic), Samuel Colvin Samuel Colvin(Founder and Author of Pydantic), and
5 more.

anthropic-sdk-python by anthropics

0.5%
2k
Python SDK for Anthropic's REST API
Created 2 years ago
Updated 1 day ago
Feedback? Help us improve.