How to Use a Free LLM API Key with Cursor IDE (No Paid Plan Needed)
Exact steps to configure Cursor IDE with a custom OpenAI-compatible API key — get GPT-4o and Claude in Cursor for free.
Why Cursor IDE?
Cursor has become one of the most popular AI-native code editors on the market. It wraps VSCode's interface around a deeply integrated AI assistant that can understand your entire codebase, write multi-file changes, and answer questions about your code in context. The problem is that Cursor's Pro plan costs $20/month, and the free tier has heavily throttled completions.
What most developers do not realize is that Cursor supports a custom API endpoint. This means you can plug in your own API key pointing to any OpenAI-compatible server — and that is exactly where FreeLLMKeys comes in.
What You Need
- Cursor IDE installed (download from cursor.com — the free tier works fine for this)
- A free API key from FreeLLMKeys (grab one from the homepage)
- The base URL:
https://aiapiv2.pekpik.com/v1
Step-by-Step Setup
Step 1 — Open Cursor Settings
Open Cursor IDE. Press Cmd + Shift + J (Mac) or Ctrl + Shift + J (Windows/Linux) to open Cursor Settings. Alternatively, go to Cursor menu → Preferences → Cursor Settings.
Step 2 — Navigate to Models
In the settings sidebar, click Models. You will see the model management screen where Cursor shows its built-in models (GPT-4o, Claude 3.5 Sonnet, etc.).
Step 3 — Enable Custom API
Scroll down to the section labeled OpenAI API Key or Override OpenAI Base URL. You will see two input fields:
- API Key: paste your FreeLLMKeys key here (e.g.,
sk-xxxxxxxxxxxxxxxx) - Override OpenAI Base URL: enter
https://aiapiv2.pekpik.com/v1
Make sure the toggle for "Use custom API key" or similar is enabled.
Step 4 — Select Your Model
Back in the Models list, make sure gpt-4o or claude-sonnet-4 is checked. These are the models available via FreeLLMKeys that work best inside Cursor.
Step 5 — Test It
Open any file in your project. Press Cmd + K to open the inline edit prompt, type a request like "add error handling to this function", and hit Enter. If it works, you are in.
Which Models Work Best in Cursor?
- gpt-4o — Best for general coding tasks, explanations, and refactoring. Very fast.
- claude-sonnet-4 or claude-opus-4 — Excellent for longer context tasks, documentation writing, and nuanced code review.
- deepseek-chat — Great for purely algorithmic or math-heavy code problems.
Troubleshooting
The key returns an error: The key may have expired (they last 24–48 hours). Go back to FreeLLMKeys, copy a fresh key, and paste it into Cursor settings.
Model not available: If you get a "model not found" error, try switching to gpt-4o which has the broadest availability.
Slow responses: The free endpoint has shared rate limits. If it feels slow, try a different key from the FreeLLMKeys list.
How This Compares to GitHub Copilot
GitHub Copilot costs $10–19/month. Cursor Pro costs $20/month. With FreeLLMKeys, you get comparable AI assistance in Cursor for free — with the bonus that you can switch between GPT-4o, Claude, and DeepSeek on demand. The tradeoff is that keys expire and you need to refresh them periodically (takes about 30 seconds). For a solo developer building personal projects or learning, this is an excellent deal.