whatisgithub

What is llm-api-gateway?

liyueyuan123/llm-api-gateway — explained in plain English

Analysis updated 2026-05-18

32PythonAudience · developerComplexity · 4/5LicenseSetup · hard

In one sentence

A self-hosted Docker stack that turns a ChatGPT Plus subscription and a cheap VPS into an OpenAI-compatible API endpoint for developer tools.

Mindmap

mindmap
  root((LLM API Gateway))
    Proxies
      codex-proxy
      chatgpt2api
    Gateway
      new-api
      Billing Tracking
      User Management
    Tools
      image-gen
      codex-log-viewer
    Deployment
      Docker
      Nginx SSL
      Makefile setup deploy

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

What do people build with it?

USE CASE 1

Point developer tools like Codex CLI or Cursor at a self-hosted API endpoint backed by a ChatGPT Plus subscription.

USE CASE 2

Pool several ChatGPT Plus accounts behind one gateway to spread out rate limits for a small team.

USE CASE 3

Track API usage and billing across multiple proxied accounts through a built-in gateway.

USE CASE 4

View call logs and generate images through the included dashboard and image tool.

What is it built with?

PythonDockerNginxMakefile

How does it compare?

liyueyuan123/llm-api-gatewayautolearnmem/automembilly-ellis/exr-imageio-poc
Stars323232
LanguagePythonPythonPython
Setup difficultyhardhardmoderate
Complexity4/55/53/5
Audiencedeveloperresearcherresearcher

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

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires a VPS, a domain, and one or more paid ChatGPT Plus accounts, plus periodic manual token renewal.

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

So what is it?

ChatGPT Plus is a monthly subscription that gives you access to OpenAI's models through a web interface. Many developer tools, like Codex CLI and Cursor, want to connect to OpenAI's API instead, which charges separately by the amount of text processed. This project bridges that gap: you run it on a cheap VPS (a rented server), and it turns your Plus subscription into a standard API endpoint that those tools can point at. The setup runs five services together. Two are reverse proxies that sit in front of different OpenAI entry points: one handles Codex CLI with automatic token renewal and supports the Responses API with prompt caching, while the other handles ChatGPT Plus text and image generation with a token that needs refreshing roughly every ten days. A third service is an API gateway called new-api that pools those two proxies, handles billing tracking, and provides user management. Two smaller utility services round out the stack: a web tool for generating images using multiple accounts in parallel, and a dashboard for viewing API call logs. The cost comparison in the README is the main selling point. A VPS costs about 99 yuan per year. Each Plus account costs about 100 yuan per month. With one account you cover light personal use, with two or three you can share across a small team and rotate when one hits rate limits. A commercial API reseller typically starts at $20 to $100 per month and charges per token on top. Deployment uses a Makefile. You clone the repo, copy the example environment file, fill in your VPS address, domain, and passwords, then run make setup once on the server. After that, make deploy syncs any changes and restarts the relevant containers. The project uses Docker for all five services and Nginx as the front-facing reverse proxy with automatic SSL certificates. The README is written in Chinese and includes security reminders: change all placeholder passwords before deploying, keep the environment file out of version control, and restrict the server firewall to only ports 22, 80, and 443.

Copy-paste prompts

Prompt 1
Explain how a reverse proxy can expose an OpenAI-compatible API endpoint backed by a different underlying service.
Prompt 2
Show me how to set up Nginx as a reverse proxy with automatic Let's Encrypt SSL certificates for a self-hosted API.
Prompt 3
How do I use a Makefile to standardize setup and deploy steps for a multi-container Docker project?
Prompt 4
Explain how token pooling across multiple accounts can help avoid rate limits in a self-hosted API gateway.
Prompt 5
What firewall rules should I set on a VPS that only needs to expose SSH, HTTP, and HTTPS?

Frequently asked questions

What is llm-api-gateway?

A self-hosted Docker stack that turns a ChatGPT Plus subscription and a cheap VPS into an OpenAI-compatible API endpoint for developer tools.

What language is llm-api-gateway written in?

Mainly Python. The stack also includes Python, Docker, Nginx.

What license does llm-api-gateway use?

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

How hard is llm-api-gateway to set up?

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

Who is llm-api-gateway for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.