Free alternatives to the OpenAI API

11 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 APIAI models and chatNeeded, 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 APIAI models and chatNeeded, freeJSONFree plan with a free API key and rate limits per model; paid plans for higher limits.
OpenRouterAI models and chatNeeded, freeJSONFree 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 AIAI models and chatNeeded, freeJSONThe 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 ModelsAI models and chatNeeded, freeJSONFree 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 APIAI models and chatNeeded, freeJSONFree 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.
Z.ai API (GLM Flash models)AI models and chatNeeded, freeJSONFree with a free API key for the Flash models: GLM-4.7-Flash, GLM-4.5-Flash and GLM-4.6V-Flash.
OVHcloud AI EndpointsAI models and chatNot neededJSONFree without a key at up to 2 requests per minute per IP address and per model; an API key from a paid Public Cloud project raises this to 400 requests per minute, billed per token.
RequestyAI models and chatNeeded, freeJSONFree with a free API key for models marked free, up to 200 requests per day, no credit card; other models are paid per token.
Kilo AI GatewayAI models and chatNot neededJSONFree without a key for models tagged :free, up to 200 requests per hour per IP address; other models need a Kilo API key and paid credits.
Pollinations.aiSpeech, image and audioNot needed–Free, works without a key or sign-up; registering gives higher limits.