openai-proxy  by geekai-dev

HTTP proxy for OpenAI API

created 2 years ago
538 stars

Top 59.8% on sourcepulse

GitHubView on GitHub
Project Summary

This Go-based HTTP proxy is designed for OpenAI API access, offering a flexible solution for users facing regional restrictions or seeking to manage their API calls. It supports self-hosting on cloud functions (Tencent, Alibaba, AWS Lambda) or traditional servers, with a focus on ease of deployment and configuration.

How It Works

The proxy acts as an intermediary, forwarding requests to specified endpoints. It defaults to api.openai.com but can be configured to use Azure OpenAI endpoints or any arbitrary global domain via the X-Target-Host header. This design allows users to route traffic through different providers or custom endpoints, offering adaptability.

Quick Start & Requirements

  • Install/Run: Download pre-compiled binaries from releases or build from source using ./build.sh (requires Go toolchain).
  • Prerequisites: Go development environment for building. For stream responses, a server environment (not typical cloud functions) is needed.
  • Configuration: Set X-Target-Host header or command-line arguments (-domain, -port) to specify target domains and ports.
  • Demo: Preview available at 演示应用.

Highlighted Details

  • Supports proxying arbitrary domains via X-Target-Host header.
  • Stream response support is available when deployed on a server environment (e.g., overseas cloud servers), not on most cloud functions.
  • Can be configured for Azure OpenAI endpoints.
  • Offers a free public proxy at proxy.geekai.co.

Maintenance & Community

The project is maintained by geekai-dev. Further community or roadmap information is not detailed in the README.

Licensing & Compatibility

The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

Stream response functionality is limited on standard cloud function deployments due to chunked transfer limitations; a dedicated server environment is required for full stream support. The project's license is not specified, which may impact commercial adoption.

Health Check
Last commit

2 months ago

Responsiveness

1 week

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

Explore Similar Projects

Feedback? Help us improve.