Use free LLM APIs in Cherry Studio, Cline & Cursor
Got a free API key from the directory? Plug it into your favorite desktop chat client or AI coding agent in about three minutes.
- ~2 min
1. Grab an OpenAI-compatible free key
Pick 1–2 providers tagged "OpenAI API" from the directory and copy three strings: Base URL, API Key, and one free Model ID.
- ~1 min
2. Paste those three fields into your client
In Cherry Studio, Cline, Roo Code, or Cursor, select the "OpenAI Compatible" provider mode and enter the Base URL, Key, and Model ID.
- ~30 sec
3. Run a quick connectivity check
Verify the key returns HTTP 200 in our browser-local API tester (or the client’s built-in test button) before starting a long session.
Cherry Studio (Desktop chat client)
- Open Settings → Model Providers and select a built-in provider (OpenRouter, Groq, Gemini, Zhipu, SiliconFlow) or click Add for a custom OpenAI-compatible provider.
- Paste your API Key and verified Base URL (if a client auto-appends /v1 and returns 404, trim the trailing /v1).
- Add the free Model ID copied from our provider page and start chatting.
Cline / Roo Code (VS Code coding agents)
- Open plugin settings and choose "OpenAI Compatible" as the API Provider.
- Enter the provider Base URL (e.g. https://openrouter.ai/api/v1 or https://generativelanguage.googleapis.com/v1beta/openai/).
- Paste your API Key and pick a free model with at least 64K context (such as Gemini Flash, DeepSeek, Qwen3, or gpt-oss-120b).
Cursor (Custom OpenAI Base URL)
- Open Cursor Settings → Models and expand the OpenAI API Key section.
- Enable "Override OpenAI Base URL", paste the free Base URL and API Key, and add the exact free Model ID via "Add model".
- Note: some Cursor-managed agent features require a Cursor plan; custom free keys work best for chat and direct edits.
Local router (combine multiple free keys to avoid 429s)
- Heavy coding agents quickly hit single-provider RPM limits on free tiers.
- Follow our local router guide to put 3–4 free keys behind http://localhost:3001/v1 so your client never needs manual switching.
Copyable environment & SDK example
# Example: OpenRouter free tier (no card)
OPENAI_BASE_URL="https://openrouter.ai/api/v1"
OPENAI_API_KEY="sk-or-v1-your-key"
OPENAI_MODEL="google/gemma-4-31b-it:free"
# Example: Zhipu GLM-4.7-Flash (China direct, zero token cost)
# OPENAI_BASE_URL="https://open.bigmodel.cn/api/paas/v4"
# OPENAI_MODEL="glm-4.7-flash"Node.js / TypeScript
import OpenAI from "openai";
const client = new OpenAI({
baseURL: process.env.OPENAI_BASE_URL,
apiKey: process.env.OPENAI_API_KEY,
});
const res = await client.chat.completions.create({
model: process.env.OPENAI_MODEL || "glm-4.7-flash",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(res.choices[0].message.content);Questions
- Why does my client return HTTP 404 after entering the Base URL?
- Some apps automatically append /v1/chat/completions while others expect the Base URL to already end in /v1. If you see 404, toggle the trailing /v1 once and re-test.
- Which free models work best for coding agents like Cline or Roo Code?
- Pick free models with large context windows (64K+) and strong instruction following, such as Google Gemini Flash, DeepSeek, Qwen3, or gpt-oss-120b.
- What should I do when my coding agent hits HTTP 429 rate limits?
- Use our Stack Builder to pick 2–3 backup free providers, or run the local OpenAI-compatible router so requests rotate automatically across keys.