openai-proxy  by UNICKCHENG

Proxy for OpenAI, Claude, and Bard APIs, targeting users facing access issues

created 2 years ago
408 stars

Top 72.5% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a proxy solution for Chinese users to access OpenAI, Claude, and Google Bard APIs, addressing issues like request timeouts and lack of usage querying. It's targeted at developers and users who face regional restrictions or require a unified API interface for multiple LLM providers.

How It Works

The proxy acts as an intermediary, forwarding requests to the respective AI services. For OpenAI, it routes requests to api.openai.com and also enables querying billing information using API keys, bypassing the need for session IDs. For Claude, it supports both native Claude API formats and OpenAI-compatible endpoints, requiring session keys and organization IDs obtained from the Claude website. Google Bard access is facilitated via a wrapper around an unofficial API, using browser cookies for authentication.

Quick Start & Requirements

  • Usage: Replace https://api.openai.com with https://openai.aihey.cc/openai (or your deployed domain).
  • Dependencies: Requires API keys for OpenAI, session keys and organization IDs for Claude, and browser cookies (__Secure-1PSID, __Secure-1PSIDTS) for Google Bard.
  • Deployment: Options include Vercel, Sealos, or Docker.
    • Docker: docker run -itd --name openai-proxy -p 13000:3000 unickcheng/openai-proxy
  • Documentation: https://openai-proxy.apifox.cn

Highlighted Details

  • Enables querying OpenAI API usage/billing data via API keys.
  • Provides OpenAI-compatible endpoints for Claude API.
  • Supports unofficial Google Bard API access using browser cookies.
  • Offers self-deployment options for custom domains.

Maintenance & Community

The project is initiated by UNICKCHENG, with contributions from the open-source community. Further community interaction and issue reporting can be done via the project's GitHub repository.

Licensing & Compatibility

The project appears to be open-source, but the specific license is not explicitly stated in the README. Compatibility for commercial use or closed-source linking would depend on the final license.

Limitations & Caveats

The project relies on unofficial methods for Claude and Google Bard, which may be subject to change or breakage by the providers. Vercel's free tier has function execution time limits. The project's primary motivation was learning Next.js, and it doesn't claim significant performance improvements. Users are advised to use frequently rotated API keys for security.

Health Check
Last commit

1 year ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.