← all repositories
acheong08/ChatGPT-to-API

A reverse proxy that treats ChatGPT's website like an API it never asked to be

Because OpenAI's official API has no free tier, this Go server automates browser login flows to expose ChatGPT's web UI as an OpenAI-compatible endpoint.

ChatGPT-to-API
Velocity · 7d
+1.0
★ / day
Trend
steady
star history

What it does

ChatGPT-to-API is a Go server that reverse-engineers ChatGPT’s web interface into a fake OpenAI-compatible API. You feed it account credentials; it handles browser automation, token refresh, Cloudflare cookies, and CAPTCHA hurdles, then serves v1/chat/completions on localhost. Multiple accounts cycle automatically to spread load.

The interesting bit

The project treats account maintenance as infrastructure: tokens auto-renew every 7 days, Plus users get Cloudflare rate-limit bypass via PUID cookies, and GPT-4 access requires exporting a browser HAR file to satisfy CAPTCHA. It’s a brittle, elaborate workaround for an API paywall.

Key highlights

  • OpenAI-compatible endpoint (/v1/chat/completions) with optional custom API key gating
  • Automated token and PUID retrieval via OpenAIAuth from email/password pairs
  • Multi-account rotation with access_tokens.json and proxy support
  • GPT-4 support for Plus subscribers (requires manual HAR export from browser dev tools)
  • Admin PATCH endpoint for runtime token updates

Caveats

  • Author explicitly states “you will not get free support” and documentation is intentionally limited
  • Requires unblocked IP for authentication; Cloudflare blocks are your problem
  • HAR file step for GPT-4 is manual and fragile
  • “Scalable” and “for production” in the repo description are aspirational; this is fundamentally a TOS-grey workaround

Verdict

Worth a look if you need programmatic ChatGPT access without an API budget and accept the maintenance burden. Skip it if you want stability, support, or a clear conscience about terms of service.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.