How to Use Claude 3.5 in Cursor via OkRouter
Complete guide to integrating AI models in Cursor IDE with 20% cost savings
20% Cheaper
Save money compared to OpenRouter or direct APIs
500+ Models
Access Claude, GPT-4, DeepSeek, and more
5 Min Setup
Quick and easy configuration
Cursor is one of the most popular AI-powered code editors in 2025, and it works great with Claude 3.5 Sonnet, GPT-4, and other leading AI models. However, using these models directly or through OpenRouter can be expensive.
In this guide, you'll learn how to configure Cursor to use OkRouter, which gives you access to 500+ AI models at 20% lower cost than OpenRouter, with the same OpenAI-compatible API.
Prerequisites
- Cursor IDE installed (download from cursor.sh)
- OkRouter account (free signup at api.okrouter.com)
- Basic understanding of API keys
Step-by-Step Setup Guide
Get Your OkRouter API Key
First, you need to create an OkRouter account and get your API key.
- Visit api.okrouter.com/login
- Sign up for a free account (no credit card required)
- Navigate to the API Keys section in your dashboard
- Click "Create New API Key" and copy it
💡 Pro Tip:
OkRouter offers a generous free tier to get started. You only pay for what you use after that.
Open Cursor Settings
Configure Cursor to use a custom API provider.
- Open Cursor IDE
- Press
Cmd/Ctrl + ,to open Settings - Navigate to Models or AI Settings
- Look for "Custom API Provider" or "OpenAI Compatible API"
Configure OkRouter API
Add OkRouter as your API provider with the correct settings.
https://api.okrouter.com/v1sk-okr-your-api-key-hereclaude-3-5-sonnet-20241022⚠️ Important:
Make sure to include /v1 at the end of the base URL for OpenAI compatibility.
Choose Your AI Model
Select from 500+ available models based on your needs.
Popular Models for Cursor:
Best for code generation and complex reasoning
claude-3-5-sonnet-20241022Excellent for general coding tasks
gpt-4-turboMost cost-effective for high-volume usage
deepseek-chatTest Your Setup
Verify that everything is working correctly.
- Open any code file in Cursor
- Press
Cmd/Ctrl + Kto open the AI chat - Type a simple prompt like "Write a hello world function"
- Verify that you get a response from your selected model
✅ Success!
If you see a response, your setup is complete. You're now using AI models at 20% lower cost!
Cost Comparison: OkRouter vs OpenRouter
| Model | OpenRouter | OkRouter | Savings |
|---|---|---|---|
| Claude 3.5 Sonnet | $3.00/1M | $2.40/1M | 20% |
| GPT-4 Turbo | $10.00/1M | $8.00/1M | 20% |
| DeepSeek V3 | $0.35/1M | $0.27/1M | 23% |
* Prices are approximate and may vary. Check our pricing page for current rates.
Troubleshooting Common Issues
❌ "Invalid API Key" Error
Make sure you copied the entire API key from your OkRouter dashboard. API keys start with sk-okr-.
❌ "Connection Failed" Error
Verify that your base URL is exactly https://api.okrouter.com/v1 (including the /v1).
❌ "Model Not Found" Error
Check that you're using the correct model ID. Visit our models page for the full list.
❌ Slow Response Times
OkRouter has automatic failover. If one provider is slow, try switching to a different model or contact support.
Frequently Asked Questions
Can I use multiple models in Cursor?
Yes! You can configure multiple API providers in Cursor and switch between them. Set up OkRouter for cost-effective access to 500+ models.
Is OkRouter compatible with all Cursor features?
Yes, OkRouter is 100% OpenAI-compatible, so all Cursor features work seamlessly including chat, code completion, and inline editing.
How much will I save compared to OpenRouter?
On average, you'll save 20% on all models. For high-volume usage, this can add up to hundreds of dollars per month.
Can I switch back to OpenRouter if needed?
Absolutely! Just change the base URL and API key in your Cursor settings. There's no lock-in.
Start Using AI in Cursor for 20% Less
Get your free OkRouter API key and start saving today