Free API Keys Models is a practical reference repository centered around one notebook:
models.ipynb
It contains the minimal initialization code for four LLM providers offering usable free API tiers, covering both chat models and embedding models where available.
No:
- ❌ SDK hunting
- ❌ complicated boilerplate
- ❌ half-finished quickstarts
- ❌ unnecessary abstractions
- ❌ marketing filler
Just:
Provider
↓
Import
↓
Model class
↓
Model name
↓
API key
↓
model.invoke(...)
The goal is simple:
Pick a provider → copy the initialization → add your API key → start building.
When experimenting with LLM applications, changing providers shouldn't mean rewriting your entire application.
This repository demonstrates how different providers can expose a consistent LangChain model interface:
┌──────────────────────────────────────────┐
│ Your AI Application │
├──────────────────────────────────────────┤
│ Chains • Agents • RAG • Tools │
├──────────────────────────────────────────┤
│ LangChain API │
├──────────────────────────────────────────┤
│ │
│ Google OpenRouter Groq Qwen │
│ │
└──────────────────────────────────────────┘
Change the provider.
Your downstream LangChain code can remain essentially the same.
flowchart LR
A["📓 Open models.ipynb"] --> B["🔍 Choose Provider"]
B --> C["📋 Copy Initialization"]
C --> D["🔑 Add API Key"]
D --> E["⚡ Create Model"]
E --> F["🚀 model.invoke(...)"]
F --> G["🤖 Build Chains / Agents / RAG"]
style A fill:#111827,color:#fff
style B fill:#1e293b,color:#fff
style C fill:#334155,color:#fff
style D fill:#7c3aed,color:#fff
style E fill:#0369a1,color:#fff
style F fill:#059669,color:#fff
style G fill:#16a34a,color:#fff
📓 Open notebook
↓
🔍 Pick provider
↓
📋 Copy code
↓
🔐 Configure .env
↓
⚡ Invoke model
↓
🤖 Build your application
| Provider | Type | Model | Package / Client | Connection |
|---|---|---|---|---|
| Chat | gemini-3.8-flash |
langchain-google-genai |
Native | |
| Embedding | gemini-embedding-2 |
google-genai |
Native | |
| 🔀 OpenRouter | Chat | nvidia/nemotron-3-super-120b-a12b:free |
langchain-openai |
OpenAI-compatible |
| 🔀 OpenRouter | Embedding | nvidia/nemotron-3-embed-1b:free |
requests |
REST API |
| ⚡ Groq | Chat | openai/gpt-oss-120b |
langchain-groq |
Native |
| 🌐 Qwen | Chat | qwen3.7-flash |
langchain-openai |
OpenAI-compatible |
Chat model
└── gemini-3.8-flash (langchain-google-genai)
Embedding model
└── gemini-embedding-2 (google-genai)
Authentication
└── GOOGLE_API_KEY
Native Gemini integration for chat through LangChain, plus embeddings through the official Google GenAI client.
Chat model
└── nvidia/nemotron-3-super-120b-a12b:free (langchain-openai)
Embedding model
└── nvidia/nemotron-3-embed-1b:free (requests)
Base URL
└── https://openrouter.ai/api/v1
Authentication
└── OPENROUTER_API_KEY
Highlight
└── 🔀 Access to free-tagged models
Model
└── openai/gpt-oss-120b
Package
└── langchain-groq
Authentication
└── GROQ_API_KEY
Highlight
└── ⚡ Extremely fast inference
Model
└── qwen3.7-flash
Package
└── langchain-openai
Protocol
└── OpenAI-compatible API
Base URL
└── https://dashscope-intl.aliyuncs.com/compatible-mode/v1
Authentication
└── QWEN_API_KEY
git clone https://github.com/SalikAhmad702/Free-API-Keys-Models.git
cd Free-API-Keys-Modelspython -m venv venv
venv\Scripts\activatepython -m venv venv
source venv/bin/activatepip install -r requirements.txtuv pip install -r requirements.txtIf you only need one provider:
# Google (chat + embeddings)
uv pip install langchain-google-genai google-genai
# OpenRouter and Qwen (OpenAI-compatible) + embeddings via REST
uv pip install langchain-openai requests
# Groq
uv pip install langchain-groq
# Env loading
uv pip install python-dotenvEach provider section inside the notebook also contains its corresponding uv pip install command.
Create your environment file:
cp .env.example .envThen add the API keys for the providers you want to use.
GOOGLE_API_KEY=""
OPENROUTER_API_KEY=""
GROQ_API_KEY=""
QWEN_API_KEY=""
⚠️ Never commit your real.envfile to GitHub.
Only configure the providers you actually plan to use.
jupyter notebook models.ipynbThen:
📓 models.ipynb
│
├── 🔵 Google (Chat + Embedding)
├── 🔀 OpenRouter (Chat + Embedding)
├── ⚡ Groq
└── 🌐 Qwen
Choose a provider and run its self-contained code cell.
Every provider follows the same fundamental idea.
from dotenv import load_dotenv
from langchain_groq import ChatGroq
load_dotenv()
model = ChatGroq(
model="openai/gpt-oss-120b"
)
response = model.invoke(
"Explain RAG in one sentence."
)
print(response.content)The important part is the consistent interface:
model.invoke(...)That means your application can continue using the same LangChain abstractions for:
┌──────────────┐
│ Model │
└──────┬───────┘
│
┌────────────────┼────────────────┐
↓ ↓ ↓
Chains Agents RAG
│ │ │
└────────────────┼────────────────┘
↓
AI Application
OpenRouter and Qwen use an OpenAI-compatible interface through ChatOpenAI.
from dotenv import load_dotenv
from langchain_openai import ChatOpenAI
import os
load_dotenv()
model = ChatOpenAI(
model="nvidia/nemotron-3-super-120b-a12b:free",
base_url="https://openrouter.ai/api/v1",
api_key=os.getenv("OPENROUTER_API_KEY"),
)from dotenv import load_dotenv
from langchain_openai import ChatOpenAI
import os
load_dotenv()
model = ChatOpenAI(
model="qwen3.7-flash",
api_key=os.getenv("QWEN_API_KEY"),
base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
)The provider changes.
The rest of your LangChain architecture doesn't need to.
The notebook also includes working embedding examples:
🔵 Google → gemini-embedding-2 (google-genai)
🔀 OpenRouter → nvidia/nemotron-3-embed-1b:free (REST via requests)
Each example prints the embedding dimensions and the first five values, so you can confirm your key and model are working before wiring them into a RAG pipeline.
Think of the model as a replaceable component:
YOUR APPLICATION
│
▼
┌─────────────────┐
│ LangChain │
└────────┬────────┘
│
model.invoke()
│
┌──────────┬───────┴───┬──────────┐
│ │ │ │
▼ ▼ ▼ ▼
Google OpenRouter Groq Qwen
│ │ │ │
└──────────┴───────┬───┴──────────┘
│
Same application
This makes experimentation much easier when testing different providers.
| Provider | Console |
|---|---|
| 🔵 Google (AI Studio) | aistudio.google.com/apikey |
| 🔀 OpenRouter | openrouter.ai/keys |
| ⚡ Groq | console.groq.com/keys |
| 🌐 Qwen — DashScope Intl | dashscope-intl.console.aliyun.com |
Note: Free-tier availability, quotas, model access, and rate limits can change. Check each provider's current console before relying on a model in production.
Free-API-Keys-Models/
│
├── 📓 models.ipynb
│ └── Provider initialization examples
│
├── 🔐 .env.example
│ └── API key template
│
├── 📦 requirements.txt
│ └── Dependencies for all providers
│
└── 📖 README.md
└── Project documentation
One provider
↓
One markdown heading
↓
One self-contained code cell
↓
Copy → Paste → Run
- 🔵 Google Gemini (chat + embeddings)
- 🔀 OpenRouter (chat + embeddings)
- ⚡ Groq
- 🌐 Qwen
- 🌊 Streaming response examples
- ⚡ Latency benchmark
- 🧠 Quality benchmark
- 📊 Compare all four providers automatically
Free API Reference
│
├── Providers
├── Models
├── Embeddings
├── Streaming
├── Structured Output
├── Tool Calling
├── RAG
├── Agents
└── Benchmarks
Found another provider with a real free tier?
Add it using the same philosophy:
1 Provider
1 Markdown section
1 Self-contained code cell
1 Clear model name
git checkout -b add/provider-namegit commit -m "feat: add <provider> setup"git push origin add/provider-nameThen open a Pull Request.
If this repository saved you time searching through provider documentation: