Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Free OpenAI-Compatible API — Drop-in ChatGPT API Replacements

Use the OpenAI SDK against free providers — Groq, Gemini, Mistral, Cohere, OpenRouter, and 25+ more. No OpenAI bill, no credit card.

🌐 Browse all OpenAI-compatible free APIs at freellms.org


What is a Free OpenAI-Compatible API?

Any API that accepts the OpenAI Chat Completions request format (/v1/chat/completions, messages, model, apiKey). You can swap https://api.openai.com/v1 for any provider below and your code keeps working — for free.

Full directory of OpenAI-compatible providers: freellms.org


OpenAI-Compatible Free API Directory

Provider Base URL Free Tier OpenAI-Compatible
Groq https://api.groq.com/openai/v1 30 RPM, 14,400 RPD ✅ Full
Google Gemini https://generativelanguage.googleapis.com/v1beta 15 RPM, 1,500 RPD ✅ Full
Mistral AI https://api.mistral.ai/v1 Free tier ✅ Full
Cohere https://api.cohere.com/v2 20 RPM ✅ Full
OpenRouter https://openrouter.ai/api/v1 1K RPD ✅ Full
NVIDIA NIM https://integrate.api.nvidia.com/v1 Free tier ✅ Full
GitHub Models https://models.github.ai/inference Free tier ✅ Full
Cloudflare Workers AI https://api.cloudflare.com/client/v4/accounts/{id}/ai/run 10K neurons/day ✅ Full
Cerebras https://api.cerebras.ai/v1 5 RPM ✅ Full
Hugging Face https://router.huggingface.co/v1 Free tier ✅ Full
SambaNova https://api.sambanova.ai/v1 20 RPM ✅ Full
LLM7.io https://api.llm7.io/v1 30 RPM ✅ Full
Z AI (Zhipu) https://open.bigmodel.cn/api/paas/v4 Free tier ✅ Full
DeepSeek https://api.deepseek.com/v1 Free tier ✅ Full

All base URLs + free API keys: freellms.org


Quick Start — Replace OpenAI with a Free API in 30 Seconds

Python (OpenAI SDK)

from openai import OpenAI

# Before: paid OpenAI
# client = OpenAI(api_key="sk-...")

# After: free Groq (no credit card)
client = OpenAI(
    base_url="https://api.groq.com/openai/v1",   # free OpenAI-compatible API
    api_key="YOUR_FREE_KEY",                      # get at freellms.org
)

response = client.chat.completions.create(
    model="llama-3.3-70b-versatile",              # free model
    messages=[{"role": "user", "content": "Hello, free ChatGPT!"}],
)
print(response.choices[0].message.content)

Codex CLI

export OPENAI_BASE_URL="https://api.groq.com/openai/v1"
export OPENAI_API_KEY="your-free-key"            # freellms.org
codex --model "llama-3.3-70b-versatile"

Cursor

Settings → Models → Add Model
  Model name: llama-3.3-70b-versatile
  Base URL: https://api.groq.com/openai/v1
  API key: your-free-key                        # freellms.org

Claude Code

export ANTHROPIC_BASE_URL="https://openrouter.ai/api"
export ANTHROPIC_AUTH_TOKEN="sk-or-v1-your-key"  # openrouter.ai/keys
export ANTHROPIC_API_KEY=""

Step-by-step config for every tool: freellms.org


Why use a free OpenAI-compatible API?

  • Drop-in replacement — same SDK, same request format, zero code changes
  • No OpenAI bill — permanently free tiers, not trial credits
  • No credit card — most providers issue keys on email signup
  • Multi-provider — switch Groq → Gemini → Mistral by changing one URL
  • Works everywhere — Cursor, Codex, Claude Code, Aider, Cline, Open WebUI

Browse all OpenAI-compatible providers, get free keys, and copy config snippets at freellms.org.


Related Resources

License

MIT — provider data sourced from freellms.org, updated daily.

About

Free OpenAI-compatible API — drop-in ChatGPT API replacement. Use OpenAI SDK with Groq, Gemini, Mistral, Cohere, OpenRouter. No OpenAI bill, no credit card. GPT-4 / GPT-3 alternatives, chat completions endpoint.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors