gitwtfhub

wtf is cliproxyapi-cloudflare-stack?

xsser/cliproxyapi-cloudflare-stack — explained in plain English

Analysis updated 2026-05-18

118ShellAudience · ops devopsComplexity · 4/5LicenseSetup · hard

TL;DR

Shell scripts and templates for self-hosting an OpenAI-compatible API gateway on Cloudflare using your own credentials.

Mindmap

mindmap
  root((cliproxyapi-cloudflare-stack))
    What it does
      Self-hosted API gateway
      Pools own credentials
      Exposes via Cloudflare Tunnel
    Tech stack
      Cloudflare Workers
      Cloudflare D1
      CLIProxyAPI
    Use cases
      Avoid third-party relays
      Credential pooling failover
      HTTPS without open ports
    Audience
      Self-hosters
      DevOps users
    Setup
      Deploy on a VM
      Configure Cloudflare Worker

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Self-host an OpenAI-compatible API gateway instead of using a third-party relay

REASON 2

Pool multiple credentials behind one endpoint with automatic failover

REASON 3

Expose a private API gateway over HTTPS without opening firewall ports

REASON 4

Manage and hot-reload API credentials on infrastructure you control

What's in the stack?

ShellCloudflare WorkersCloudflare D1Cloudflare TunnelCLIProxyAPI

How it stacks up

xsser/cliproxyapi-cloudflare-stacknanako0129/corallineruanyf/weather-action
Stars118114113
LanguageShellShellShell
Last pushed2023-06-22
MaintenanceDormant
Setup difficultyhardeasyeasy
Complexity4/51/5
Audienceops devopsdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · hard Time to first run · 1h+

Requires a VM, a Cloudflare account with a domain, and your own authorized API credentials.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

Wtf does this do

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.

Yoink these prompts

Prompt 1
Walk me through deploying the CPA gateway on my VM using deploy_vm.sh.
Prompt 2
Help me configure the Cloudflare Worker template for the mail-receiving endpoint.
Prompt 3
Explain how to set up Cloudflare Tunnel to expose my gateway over HTTPS.
Prompt 4
Show me how credential hot-reloading and failover work in this stack.

Frequently asked questions

wtf is cliproxyapi-cloudflare-stack?

Shell scripts and templates for self-hosting an OpenAI-compatible API gateway on Cloudflare using your own credentials.

What language is cliproxyapi-cloudflare-stack written in?

Mainly Shell. The stack also includes Shell, Cloudflare Workers, Cloudflare D1.

What license does cliproxyapi-cloudflare-stack use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is cliproxyapi-cloudflare-stack to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is cliproxyapi-cloudflare-stack for?

Mainly ops devops.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.