Analysis updated 2026-05-18
Self-host an OpenAI-compatible API gateway instead of using a third-party relay
Pool multiple credentials behind one endpoint with automatic failover
Expose a private API gateway over HTTPS without opening firewall ports
Manage and hot-reload API credentials on infrastructure you control
| xsser/cliproxyapi-cloudflare-stack | nanako0129/coralline | ruanyf/weather-action | |
|---|---|---|---|
| Stars | 118 | 114 | 113 |
| Language | Shell | Shell | Shell |
| Last pushed | — | — | 2023-06-22 |
| Maintenance | — | — | Dormant |
| Setup difficulty | hard | easy | easy |
| Complexity | 4/5 | — | 1/5 |
| Audience | ops devops | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires a VM, a Cloudflare account with a domain, and your own authorized API credentials.
cliproxyapi-cloudflare-stack is a set of shell scripts and configuration templates for building your own OpenAI-compatible API gateway, using credentials you already own, on infrastructure you control. The goal is to avoid handing your account credentials to a third-party relay service. Instead, you run everything yourself: a single entry point, a pool of your own credentials, and a public HTTPS address, without opening any inbound ports on your network. The stack has three pieces. A Cloudflare Worker paired with D1, Cloudflare's database service, acts as a mail-receiving endpoint on your own domain. CLIProxyAPI serves as the actual gateway, managing a pool of multiple credentials with hot reloading and automatic failover, and exposing an OpenAI-style API path. Cloudflare Tunnel then exposes that gateway to the public internet over HTTPS without requiring a public IP address or opening firewall ports. To set it up, you deploy the CPA gateway on a virtual machine using a provided script, which outputs an API key and a credentials directory. You then deploy the Cloudflare Worker using a template configuration file and connect it to email routing. Credentials you are authorized to use go into the gateway's credentials directory, either manually or with a sync script, and the gateway picks them up automatically. Finally, a Cloudflare Tunnel service template makes the gateway reachable at your own domain, and any OpenAI-compatible client can call it by pointing its base URL at that domain and using the generated API key. The README states plainly that this project is meant for learning about self-hosted deployment architecture and managing credentials you are already authorized to use. It explicitly says it must not be used for automated account registration, bypassing human verification, or violating the terms of service of any third party, and that use is at your own risk. It is released under the MIT license.
Shell scripts and templates for self-hosting an OpenAI-compatible API gateway on Cloudflare using your own credentials.
Mainly Shell. The stack also includes Shell, Cloudflare Workers, Cloudflare D1.
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated hard, with roughly 1h+ to a first successful run.
Mainly ops devops.
This repo across BitVibe Labs
Verify against the repo before relying on details.