openai-cloudflare  by janlay

OpenAI API proxy running on Cloudflare Worker

created 2 years ago
308 stars

Top 88.2% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides an OpenAI API proxy service deployable on Cloudflare Workers, designed for users of mainstream OpenAI/ChatGPT GUI applications. It offers features like API compliance, streaming, and user management (creation, key generation, reset), enabling self-hosted access to OpenAI models.

How It Works

The proxy leverages Cloudflare Workers to route requests to the OpenAI API. It uses a KV namespace for storing user-specific API keys, which are generated and managed via specific API endpoints. This approach allows for granular user control and custom key management within the Cloudflare environment.

Quick Start & Requirements

  • Install/Run: Deploy to Cloudflare Workers by following the setup guide in the README.
  • Prerequisites: A domain name with Cloudflare nameservers, an OpenAI API key, and a Cloudflare account.
  • Setup: Requires configuring Cloudflare Workers, custom domains, environment variables (OPENAPI_API_KEY, ACCESS_TOKEN), and KV namespaces. Estimated setup time is approximately one minute after code deployment.
  • Links: Cloudflare Workers, OpenAI API

Highlighted Details

  • Supports all OpenAI APIs and payload formats.
  • Enables streaming content.
  • Provides unique API keys per user, with options for creation, deletion, and reset.
  • Keys generated start with sk-cfw and are only valid for this service.

Maintenance & Community

The project appears to be maintained by a single contributor (janlay). There are no explicit links to community channels or a roadmap provided in the README.

Licensing & Compatibility

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

Limitations & Caveats

The project is missing planned features such as independent user key resets, time-limited access, and usage statistics. User key reset functionality is not yet implemented.

Health Check
Last commit

2 years ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.