↓Skip to main content
  1. My Blog Posts and Stories/

Free AI APIs: A Guide to Free Tiers

··1401 words·7 mins

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.

  1. 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.
  2. One-time signup credit — a small amount of credit when you make an account. It runs out and does not renew.
  3. 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 word “free” is doing a lot of work. It never means unlimited, and it rarely means free forever. The limits also change often, a provider can end a free tier with a single docs update.

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.

ProviderTier typeFree models (examples)Approximate limitsAPI key
Google GeminiRecurring free tierGemini Flash familyRPM / TPM / RPD, varies by modelaistudio.google.com
GroqRecurring free planLlama, GPT-OSS, Qwene.g. 30 RPM, ~12K TPMconsole.groq.com
Cloudflare Workers AIRecurring dailyLlama and others10,000 Neurons per daydash.cloudflare.com
MistralFree plan + creditsMistral modelsLimited messages and API creditsconsole.mistral.ai
OpenRouterFree :free modelsLlama, DeepSeek, GemmaLow daily cap; credit balance can blockopenrouter.ai
Together AISignup credit, dynamic limitsLlama, QwenDynamic, no fixed capapi.together.ai
Cerebras$5 trial, 30 daysGPT-OSS 120B, GLM 4.7, Gemma 45 RPM, 30K TPMcloud.cerebras.ai

A few details are worth calling out.

  1. 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.
  2. 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.
  3. OpenRouter is subtle. The :free models are free to call, but if your account balance goes to zero or negative, even the free models can error until you top up.
Cerebras is the one that surprised me. Their pricing page still hints at “free credits”, but their docs now state there is no permanently free tier — only a $5 credit that expires after 30 days and needs a verified payment method. I found this only after reading the FAQ on their rate-limits page.

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.

OpenAI-compatible request

quota or error

quota or error

quota or error

Your app or coding tool

LiteLLM Gateway

Gemini free tier

Groq free tier

Mistral free tier

OpenRouter free model

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.

Keep these for personal use only. Free tiers are for individual development. Pooling keys across a team or reselling access can break the provider’s terms and get your account banned.

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.

  1. Google AI Studio — create an API key for the Gemini API.
  2. Groq — create an API key under API Keys.
  3. Mistral — create an API key under API Keys.
  4. 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).

  1. Log in to http://localhost:4000/ui with username admin and your master key as the password.
  2. Open Models + Endpoints, go to the All Models tab, and click + Add Model.
  3. Pick the provider — for example Gemini — and paste its API key. Later models on the same provider can reuse the saved credential.
  4. Choose the model (for example gemini-2.5-flash) and give it the public name your client will call, like gemini-flash.
  5. Save. Repeat for Groq, Mistral, and OpenRouter.

The new models are live straight away — no restart needed.

Models added through the UI live in the database, so they need the PostgreSQL connection from Step 5. They will not show up in your 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.

The models endpoint returning the four configured models
The /v1/models endpoint

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.

The LiteLLM dashboard login page
LiteLLM dashboard login

Recent LiteLLM versions need a PostgreSQL database for the dashboard and for spend tracking. If login says “Not connected to DB”, set 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.

  1. LiteLLM
  2. LiteLLM Proxy documentation
  3. Google Gemini API rate limits
  4. Groq rate limits
  5. Cloudflare Workers AI pricing
↑