docs/public/cursor/openrouter-setup.mdx
This guide walks you through setting up Claude-Mem in Cursor using OpenRouter. OpenRouter provides access to 100+ AI models from various providers, including several free options.
<Info> **Model variety:** Access Claude, GPT-4, Gemini, Llama, Mistral, and many more through a single API key. </Info># Clone the repository
git clone https://github.com/thedotmack/claude-mem.git
cd claude-mem
# Install dependencies
bun install
# Build the project
bun run build
Run the setup wizard which guides you through everything:
bun run cursor:setup
When prompted for provider, select OpenRouter.
Create the settings file manually:
# Create settings directory
mkdir -p ~/.claude-mem
# Create settings file with OpenRouter configuration
cat > ~/.claude-mem/settings.json << 'EOF'
{
"CLAUDE_MEM_PROVIDER": "openrouter",
"CLAUDE_MEM_OPENROUTER_API_KEY": "YOUR_OPENROUTER_API_KEY"
}
EOF
Replace YOUR_OPENROUTER_API_KEY with your actual API key.
Then install hooks and start the worker:
bun run cursor:install
bun run worker:start
Close and reopen Cursor IDE for the hooks to take effect.
# Check worker is running
bun run worker:status
# Check hooks are installed
bun run cursor:status
Open http://localhost:37777 to see the memory viewer.
| Model | Provider | Notes |
|---|---|---|
google/gemini-2.0-flash-exp:free | Fast, capable | |
xiaomi/mimo-v2-flash:free | Xiaomi | Good general purpose |
| Model | Approx. Cost | Notes |
|---|---|---|
anthropic/claude-3-haiku | ~$0.25/1M tokens | Fast, efficient |
google/gemini-flash-1.5 | ~$0.075/1M tokens | Great value |
mistralai/mistral-7b-instruct | ~$0.07/1M tokens | Budget option |
To specify a model, add to your settings:
{
"CLAUDE_MEM_PROVIDER": "openrouter",
"CLAUDE_MEM_OPENROUTER_API_KEY": "your-key",
"CLAUDE_MEM_OPENROUTER_MODEL": "google/gemini-2.0-flash-exp:free"
}
OpenRouter charges per token. To manage costs:
Ensure your settings file exists with the correct format:
cat ~/.claude-mem/settings.json
Should output something like:
{
"CLAUDE_MEM_PROVIDER": "openrouter",
"CLAUDE_MEM_OPENROUTER_API_KEY": "sk-or-..."
}
:free suffix in their IDOpenRouter rate limits vary by model and your account tier. If you hit limits:
Check the worker logs for details:
bun run worker:logs
Common issues:
You can switch between OpenRouter, Gemini, and Claude SDK at any time by updating your settings. No restart required - changes take effect on the next observation.
{
"CLAUDE_MEM_PROVIDER": "gemini"
}