docs/public/cursor/openrouter-setup.mdx
Use your OpenRouter key so memory notes run off-plan on your OpenRouter credit. You do not clone the repo.
<Warning> **Never** send a personal `sk-or-` key to `https://cmem.ai/api/inference`. For your own OpenRouter account, leave the base URL empty (or `https://openrouter.ai/api/v1`). CMEM Pro uses the cmem.ai inference URL with a **CMEM Pro** key, not your OpenRouter key. </Warning>npx claude-mem install
Pick Cursor, then pick your OpenRouter key as the memory provider.
<Warning> `npm install -g claude-mem` is the library only. Always install with `npx claude-mem install`. </Warning>mkdir -p ~/.claude-mem
cat > ~/.claude-mem/settings.json << 'EOF'
{
"CLAUDE_MEM_PROVIDER": "openrouter",
"CLAUDE_MEM_OPENROUTER_API_KEY": "YOUR_OPENROUTER_API_KEY"
}
EOF
Leave CLAUDE_MEM_OPENROUTER_BASE_URL unset for OpenRouter itself. Then re-run npx claude-mem install so Cursor hooks and the worker are in place. Do not restart a healthy worker.
Close and reopen Cursor so hooks load.
Health: curl -s "http://127.0.0.1:${CLAUDE_MEM_WORKER_PORT}/api/health". Open the worker URL from install to see notes.
Set CLAUDE_MEM_OPENROUTER_MODEL if you do not want the default. Free model ids on OpenRouter often end in :free — check the model list.
{
"CLAUDE_MEM_PROVIDER": "openrouter",
"CLAUDE_MEM_OPENROUTER_API_KEY": "your-key",
"CLAUDE_MEM_OPENROUTER_MODEL": "google/gemini-2.0-flash-exp:free"
}
The OpenRouter provider is a generic OpenAI-compatible client. Set CLAUDE_MEM_OPENROUTER_BASE_URL to DeepSeek, LM Studio, or any gateway that speaks /chat/completions. The model id is sent as-is.
{
"CLAUDE_MEM_PROVIDER": "openrouter",
"CLAUDE_MEM_OPENROUTER_BASE_URL": "https://api.deepseek.com",
"CLAUDE_MEM_OPENROUTER_MODEL": "deepseek-chat",
"CLAUDE_MEM_OPENROUTER_API_KEY": "YOUR_DEEPSEEK_API_KEY"
}
{
"CLAUDE_MEM_PROVIDER": "openrouter",
"CLAUDE_MEM_OPENROUTER_BASE_URL": "http://localhost:1234/v1",
"CLAUDE_MEM_OPENROUTER_MODEL": "your-local-model-id"
}
Key not configured — cat ~/.claude-mem/settings.json should show provider openrouter and your key.
Model not found — check the id at OpenRouter Models.
Worker idle — read ~/.claude-mem/logs/worker-YYYY-MM-DD.log. Do not restart a healthy worker.