Free alternatives to the OpenAI API

7 services, checked weekly

The OpenAI API is mainly paid per token. These AI APIs have a lasting free plan or free tier for text generation and chat, usually with a free key and a rate limit, and several (such as Groq, OpenRouter and Pollinations.ai) accept the same request format as the OpenAI API, so existing code often works by changing the base address.

ServiceCategoryAPI keyFormatsFree use
Google Gemini APIArtificial intelligenceNeeded, freeJSONFree tier for most text, speech and embedding models with a free API key and rate limits; content sent on the free tier may be used by Google to improve its products, so use the paid tier for private data.
Groq APIArtificial intelligenceNeeded, freeJSONFree plan with a free API key and rate limits per model; paid plans for higher limits.
OpenRouterArtificial intelligence–JSONFree models are limited to 20 requests per minute and 50 per day, or 1,000 per day once you have bought at least 10 credits; other models are paid per token.
Cloudflare Workers AIArtificial intelligenceNeededJSONThe Workers Free plan includes 10,000 'neurons' (Cloudflare's unit of AI compute) per day; requests above that fail until the daily reset, unless you move to the paid plan.
GitHub ModelsArtificial intelligenceNeededJSONFree for every GitHub account, with daily and per-minute request limits per model that depend on your Copilot plan; paid usage is available for more.
Cohere APIArtificial intelligence–JSONFree trial key without a time limit, limited to 1,000 calls per month and a per-minute rate limit; production use needs a paid key.
Pollinations.aiArtificial intelligenceNot needed–Free, works without a key or sign-up; registering gives higher limits.