Last verified: October 2026. Free-tier models change often — check the provider pages on free-llm.com before relying on a specific model.
Point OpenCode at any free OpenAI-compatible backend in 30 seconds.
OpenCode supports multiple LLM providers through environment variables or the /connect command. When you configure a free provider, OpenCode routes API calls through that backend instead of paid options.
export GROQ_API_KEY="gsk_your_groq_api_key"Get your key at console.groq.com/keys. Recommended model: openai/gpt-oss-120b (llama-3.3-70b-versatile was retired from Groq's free tier on August 16, 2026).
export GOOGLE_API_KEY="your_google_ai_studio_key"Get your key at aistudio.google.com. Recommended model: gemini-3.8-flash (Gemini 2.0 was shut down on June 1, 2026; Pro models are no longer on the free tier).
export OPENROUTER_API_KEY="sk-or-v1-your_openrouter_key"Get your key at openrouter.ai/keys. Recommended model: nvidia/nemotron-3-ultra-550b-a55b:free (the free catalog rotates quickly — see the official free models list). Some free models may use your prompts for training.
export MISTRAL_API_KEY="your_mistral_key"Get your key at console.mistral.ai/api-keys. Recommended model: codestral-latest for coding tasks (open-mistral-nemo was retired on July 31, 2026).
export CEREBRAS_API_KEY="your_cerebras_key"Get your key at cerebras.ai/inference. Recommended model: gpt-oss-120b (llama-3.3-70b is deprecated). Since August 2026 a verified payment method is required to activate the $5 trial credit (valid 30 days).
OpenCode has a built-in /connect command that simplifies provider setup:
- Run
/connectin the OpenCode TUI - Select your provider (opencode, groq, google, etc.)
- Follow the prompts to enter your API key
- Start coding with free models!
Add to your shell profile (~/.zshrc or ~/.bashrc):
# Free LLM API backend for OpenCode
export GROQ_API_KEY="gsk_your_key_here"
# OR
export GOOGLE_API_KEY="your_key_here"
# OR
export OPENROUTER_API_KEY="sk-or-v1-your_key_here"| Feature | OpenCode | Claude Code | Cursor | Codex CLI |
|---|---|---|---|---|
| Open Source | ✅ | ❌ | ❌ | ❌ |
| Free Models | ✅ (via providers) | ❌ | ❌ | ❌ |
| Terminal + Desktop + IDE | ✅ | Terminal only | Desktop only | Terminal only |
| GitHub Copilot Support | ✅ | ❌ | ❌ | ❌ |
| ChatGPT Plus/Pro Support | ✅ | ❌ | ❌ | ❌ |
| Multi-session | ✅ | ❌ | ❌ | ❌ |
| Share Links | ✅ | ❌ | ❌ | ❌ |
For the best free experience with OpenCode:
- Get a Groq API key (fastest, no credit card required)
- Install OpenCode:
curl -fsSL https://opencode.ai/install | bash - Configure: Run
/connect, select groq, paste your key - Start coding: OpenCode will use GPT OSS 120B for free
- Free tiers have rate limits. Groq: ~1,000 requests/day on
gpt-oss-120b. OpenRouter: 50 requests/day (1,000 with $10 of lifetime credits). - OpenCode works best with models that support tool use well (GPT OSS 120B, Qwen3.8 27B, Nemotron 3 Ultra).
- The
/connectcommand makes setup easier than manual environment variables.
See the full Provider Directory and Quick Reference in the main README for all 55+ providers, or browse free-llm.com.