- Jh123x: Blog, Code, Fun and everything in between./
- My Blog Posts and Stories/
- Free AI APIs: A Guide to Free Tiers/
Free AI APIs: A Guide to Free Tiers
Table of Contents
Introduction #
Free AI APIs are everywhere now. Nearly every model provider has a free tier, a signup credit, or a trial. The hard part is that they are not all the same.
Some are free forever. Some are a one-time credit. Some quietly expire after a month.
While I was researching these free tiers, I kept seeing the same three patterns. In this blog post, I will share what I found and show you how to combine the useful ones behind a single gateway with LiteLLM.
What “Free” Actually Means #
Every free API falls into one of three patterns.
- Recurring free tier — free forever, but rate-limited. You get a real API key with no card. The catch is a low request or token limit per minute or per day.
- One-time signup credit — a small amount of credit when you make an account. It runs out and does not renew.
- Time-limited trial — a credit that expires after a set number of days, and often needs a payment method up front.
The table in the next section maps each provider to one of these three tiers.
The Free Tier Landscape #
The table below summarises the tiers I looked at. The “limits” column is approximate and is correct as of the time of writing — check each provider’s own rate-limits page before you rely on it.
| Provider | Tier type | Free models (examples) | Approximate limits | API key |
|---|---|---|---|---|
| Google Gemini | Recurring free tier | Gemini Flash family | RPM / TPM / RPD, varies by model | aistudio.google.com |
| Groq | Recurring free plan | Llama, GPT-OSS, Qwen | e.g. 30 RPM, ~12K TPM | console.groq.com |
| Cloudflare Workers AI | Recurring daily | Llama and others | 10,000 Neurons per day | dash.cloudflare.com |
| Mistral | Free plan + credits | Mistral models | Limited messages and API credits | console.mistral.ai |
| OpenRouter | Free :free models | Llama, DeepSeek, Gemma | Low daily cap; credit balance can block | openrouter.ai |
| Together AI | Signup credit, dynamic limits | Llama, Qwen | Dynamic, no fixed cap | api.together.ai |
| Cerebras | $5 trial, 30 days | GPT-OSS 120B, GLM 4.7, Gemma 4 | 5 RPM, 30K TPM | cloud.cerebras.ai |
A few details are worth calling out.
- Groq is the most generous recurring tier I found. Their free plan lists real per-model limits, for example 30 requests per minute and roughly 12K tokens per minute on
llama-3.3-70b-versatile. - Cloudflare gives you 10,000 Neurons per day, every day, with no card. A Neuron is their unit for charging compute. It resets daily at midnight UTC.
- OpenRouter is subtle. The
:freemodels are free to call, but if your account balance goes to zero or negative, even the free models can error until you top up.
Why Combine Them #
One free tier is small. You will hit its rate limit quickly during real work.
The trick is to combine several tiers behind one endpoint. When one provider hits its limit, the gateway moves on to the next one automatically. This is what a gateway like LiteLLM does for you.
LiteLLM is a good fit here because it is self-hosted and uses your own keys. You stay in control of where your requests go, and there is no third-party service in the middle.
Setting Up LiteLLM #
Here is the walkthrough, step by step. I used Gemini, Groq, Mistral, and OpenRouter. You can add or remove providers as you like.
Step 1: Create the Accounts and Collect Keys #
Sign up at each provider below and copy the API key. None of these four need a card.
- Google AI Studio — create an API key for the Gemini API.
- Groq — create an API key under API Keys.
- Mistral — create an API key under API Keys.
- OpenRouter — create a key under Settings → Keys.
There are two ways to add the models: through the dashboard UI (2a) or through the config file (2b). Both use the same API keys from Step 1, so pick whichever you prefer.
Step 2a: Add Models Through the UI #
LiteLLM ships a web dashboard that lets you add models without writing any YAML.
It needs two things first: STORE_MODEL_IN_DB="true" so the models are saved to the database, and the database itself (see Step 5).
- Log in to
http://localhost:4000/uiwith usernameadminand your master key as the password. - Open Models + Endpoints, go to the All Models tab, and click + Add Model.
- Pick the provider — for example Gemini — and paste its API key. Later models on the same provider can reuse the saved credential.
- Choose the model (for example
gemini-2.5-flash) and give it the public name your client will call, likegemini-flash. - Save. Repeat for Groq, Mistral, and OpenRouter.
The new models are live straight away — no restart needed.
litellm.yaml, and a model defined in the config file cannot be edited from the UI.
If you also want the automatic fallback routing from 2b, that still lives in the config file.Step 2b: Add Models Through the Config File #
Create a file called litellm.yaml. This is the whole gateway in one file.
model_list:
- model_name: gemini-flash
litellm_params:
model: gemini/gemini-2.5-flash
api_key: os.environ/GEMINI_API_KEY
- model_name: groq-llama
litellm_params:
model: groq/llama-3.3-70b-versatile
api_key: os.environ/GROQ_API_KEY
- model_name: mistral-small
litellm_params:
model: mistral/mistral-small-latest
api_key: os.environ/MISTRAL_API_KEY
- model_name: openrouter-free
litellm_params:
model: openrouter/meta-llama/llama-3.3-70b-instruct:free
api_key: os.environ/OPENROUTER_API_KEY
router_settings:
routing_strategy: usage-based-routing
num_retries: 2
allowed_fails: 3
cooldown_time: 30
fallbacks:
- gemini-flash: ["groq-llama", "mistral-small"]
- groq-llama: ["mistral-small", "openrouter-free"]
general_settings:
master_key: os.environ/LITELLM_MASTER_KEY
The fallbacks block is the important part. If gemini-flash fails or hits its limit, the request slides to groq-llama, then mistral-small. Each model_name is the name your client will see.
Step 3: Start the Gateway #
With Docker:
docker run -d --name litellm -p 4000:4000 \
--env-file .env \
-v "$PWD/litellm.yaml:/app/config.yaml" \
ghcr.io/berriai/litellm:main-latest \
--config /app/config.yaml
Or with pip:
pip install 'litellm[proxy]'
litellm --config litellm.yaml --port 4000
Put your keys in a .env file next to the config:
GEMINI_API_KEY=...
GROQ_API_KEY=...
MISTRAL_API_KEY=...
OPENROUTER_API_KEY=...
LITELLM_MASTER_KEY=sk-1234
Step 4: Verify It Is Running #
Check the health endpoint, then list the models.
curl http://localhost:4000/health/liveliness
curl http://localhost:4000/v1/models -H "Authorization: Bearer sk-1234"
The second call should return the four model names you configured.

Step 5: The Dashboard (optional) #
LiteLLM ships a web dashboard at http://localhost:4000/ui. Log in with username admin and your master key as the password.

DATABASE_URL=postgresql://... and restart. The gateway itself keeps working without a database — only the dashboard needs one.Step 6: Point Your Client at It #
Any OpenAI-compatible tool can use the gateway. Set the base URL to http://localhost:4000/v1 and the API key to your master key (sk-1234). Then use the model names from your config, like gemini-flash or groq-llama.
Conclusion #
Free AI API tiers are real, but they are small and they change. The useful ones — Gemini, Groq, Cloudflare — are recurring but rate-limited. Others, like Cerebras, are trials wearing a free label.
Combining several tiers behind a self-hosted LiteLLM gateway is the practical way to turn them into something useful. You keep your own keys, you control the routing, and when one provider slows you down, the next one picks up.
Stay tuned — I may follow this up with a closer look at which free models are actually good enough for real coding work.