Siddhio.ai guide
Free LLM APIs: Where to Start
Use free tiers from Google, Groq and OpenRouter for prototypes, with one code pattern that works for all of them.
The short version
Several providers offer permanent free tiers for text models. For prototypes, the usual starting points are the Gemini API through Google AI Studio, Groq for very fast open models, and OpenRouter's models marked :free. Free tiers are rate-limited and change often, so check each provider's limits page before you rely on them.
| Provider | What's free | OpenAI-compatible base URL |
|---|---|---|
| Google Gemini API | Selected Flash and Flash-Lite models; limits shown in AI Studio | https://generativelanguage.googleapis.com/v1beta/openai/ |
| Groq | Open models with per-minute and per-day caps | https://api.groq.com/openai/v1 |
| OpenRouter | Models ending in :free, with request caps | https://openrouter.ai/api/v1 |
| Cloudflare Workers AI | A daily allowance of “neurons” | See Cloudflare's docs |
One pattern for all of them
Most of these providers accept the OpenAI SDK format, so you can switch by changing three values:
from openai import OpenAI
import os
client = OpenAI(
base_url="https://api.groq.com/openai/v1", # or another provider
api_key=os.environ["GROQ_API_KEY"],
)
reply = client.chat.completions.create(
model="<model-id from the provider's model list>",
messages=[{"role": "user", "content": "Write a product title for a linen tote bag."}],
)
print(reply.choices[0].message.content)
Rules that save you trouble
- Never put sensitive data into a free tier without reading its terms; some free tiers may use prompts to improve their models.
- Model IDs expire. Keep the model name in a config value, not hard-coded everywhere.
- Plan a fallback. If one provider rate-limits you, retry with another.
- Keep keys secret. Use environment variables, never the code you publish.