Free OpenAI-compatible APIs: 4 that work today
Four free LLM APIs that work with the OpenAI SDK by changing one line: OpenRouter (13 free models), Gemini, Groq and Cloudflare, with base URLs and limits.
Checked 22 November 2026 from each provider's own docs. Free tiers change, so follow the source links before you build on one.
Swap one line, keep your code
Each API below works with the official OpenAI libraries. Change base_url and the API key, and pick a model the provider offers for free.
from openai import OpenAI
client = OpenAI(base_url="BASE_URL_FROM_THE_LIST", api_key="YOUR_KEY")4 free OpenAI-compatible APIs
- OpenRouter
https://openrouter.ai/api/v1Free: 13 free models today (IDs end in :free), checked live every 30 minutes · 20 requests a minute; 50 a day, or 1,000 a day after buying 10 credits · docs - Google Gemini API
https://generativelanguage.googleapis.com/v1beta/openai/Free: Gemini 4 Hydrogen, Gemini 3.8 Flash, Gemini 3.6 Flash and Gemini 3.5 Flash-Lite · Set per model, shown in Google AI Studio; daily limits reset at midnight Pacific time · docs - Groq
https://api.groq.com/openai/v1Free: gpt-oss-120b, gpt-oss-20b and qwen3.8-27b · 30 requests a minute and 1,000 a day per model, plus token caps · docs - Cloudflare Workers AI
https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/v1Free: Most Workers AI models, within 10,000 Neurons a day · 10,000 Neurons a day, reset at 00:00 UTC · docs
More free AI guides
- Free AI model APIEvery free LLM API, plus the free OpenRouter models Upcurrent checks every 30 minutes
- Free LLM APIs with no credit cardWhich free tiers start without a card
- How to get a free LLM API keyFive steps to your first request
Questions
Which free APIs are OpenAI-compatible?
OpenRouter, Google's Gemini API, Groq and Cloudflare Workers AI all offer OpenAI-compatible endpoints with a free tier. OpenRouter has 13 free models today.
What is the Gemini OpenAI-compatible base URL?
https://generativelanguage.googleapis.com/v1beta/openai/ — Google says this support is still in beta.
What is the Groq OpenAI-compatible base URL?
https://api.groq.com/openai/v1. Groq notes a few OpenAI fields such as logprobs and logit_bias are not supported.
Get this in your inbox at 7am
One free email each morning with the AI repos, models and stories that are picking up speed, including new free models. Your own time zone, no spam.