← all repositories
xtekky/gpt4free

A universal adapter for LLMs that won't charge your credit card

GPT4Free wraps free and scraped AI providers behind a single OpenAI-compatible API so you can swap models without swapping code.

gpt4free
Velocity · 7d
+57
★ / day
Trend
steady
star history

What it does GPT4Free (g4f) is a Python library, local web GUI, and FastAPI server that aggregates dozens of LLM and media-generation providers—free tiers, browser-automated scrapes, and local inference—behind one OpenAI-compatible interface. You write standard chat.completions.create calls; the project handles provider switching, async clients, image generation, and even an MCP server for Claude Desktop integration.

The interesting bit The project treats “free” as an infrastructure layer. It bundles browser automation for cookie-based logins, ships Docker images with an optional VNC desktop for provider authentication, and auto-updates its slim container on startup. There’s even a browser JS client served from CDN that needs no backend at all.

Key highlights

  • OpenAI-compatible REST API and Python/JS clients; drop-in replacement for standard SDK code
  • 66k+ stars, actively maintained by @hlohaus after @xtekky created it
  • Docker deployment with full and slim variants (x86_64 + arm64)
  • MCP server exposing web search, scraping, and image generation to Claude Desktop
  • Supports media generation (image/audio/video) through providers like Pollinations
  • Windows .exe launcher available for non-technical users

Caveats

  • Many providers require Chrome/Chromium, browser cookies, or HAR files; setup friction varies by provider
  • “Free” means “someone else is paying or scraping”; provider availability and rate limits are inherently unstable
  • The README notes a security, privacy, and takedown policy exists—worth reading before production use

Verdict Good for prototyping, personal automation, or anyone who wants to experiment with multiple models without managing twenty API keys. Skip it if you need guaranteed uptime, commercial support, or a clear legal chain of custody for your prompts.

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