MemoryRouterMemoryRouter

Coding Tools

Give Codex, Claude Code, Cursor, Windsurf, and other coding tools persistent memory.

Give your coding tools persistent memory. Same vault, same memories, whether you're chatting in OpenClaw or coding in Cursor.

This page covers the proxy (base URL) path, which works with any tool that lets you set an OpenAI- or Anthropic-compatible base URL — Cursor, Windsurf, Zed, and others.

For Claude Code and Codex there are now dedicated packages with deterministic hook-based memory, which is the recommended path for those two tools: Claude Code and Codex. Both also work with the MCP server.


How It Works

MemoryRouter acts as a proxy between your coding tool and your AI provider. Set ANTHROPIC_BASE_URL or OPENAI_BASE_URL to MemoryRouter's endpoint, and every request gets relevant memories injected automatically.

Coding Tool → MemoryRouter → AI Provider → Response

          injects relevant memories

Your API keys pass through untouched (BYOK). MemoryRouter just adds context.


Read-Only Keys

For coding tools, use a read-only key so coding sessions don't pollute your memory vault with tool calls and file diffs.

Take your normal key:

mk_40a267...

Add ro_ after mk_:

mk_ro_40a267...

That's it. Read-only keys inject memories but never store. No new key to generate: it's the same key with a prefix convention.

This prefix convention applies to API keys used with the proxy. Connector and MCP access uses OAuth scopes instead (memories:read, memories:write, memories:delete), which are independent grants — see authentication and scopes. Both mechanisms agree: a read-only credential can never write, and read-only OAuth tokens are additionally downgraded to read mode at the API-key layer.


Setup

Claude Code (proxy path)

Prefer npx memoryrouter-claude init for Claude Code. Use the proxy variables below only if you specifically want the base-URL approach instead of hooks.

export ANTHROPIC_BASE_URL=https://api.memoryrouter.ai/v1
export ANTHROPIC_API_KEY=sk-ant-...        # Your real Anthropic key
export MEMORY_KEY=mk_ro_your-key-here      # Read-only memory key

OpenAI Codex

export OPENAI_BASE_URL=https://api.memoryrouter.ai/v1
export OPENAI_API_KEY=sk-...               # Your real OpenAI key
export MEMORY_KEY=mk_ro_your-key-here      # Read-only memory key

Cursor

In Cursor settings, set the API base URL to:

https://api.memoryrouter.ai/v1

Set your MEMORY_KEY environment variable to your read-only key.

Windsurf

Same pattern: set the base URL to https://api.memoryrouter.ai/v1 in your Windsurf configuration and export MEMORY_KEY.

Aider

export OPENAI_API_BASE=https://api.memoryrouter.ai/v1
export OPENAI_API_KEY=sk-...
export MEMORY_KEY=mk_ro_your-key-here

Continue, Cody, and others

Any tool that supports a custom base URL works. Point it at https://api.memoryrouter.ai/v1 and set the MEMORY_KEY environment variable.


Cross-Tool Memory

The killer feature: all your tools share the same memory vault.

  • Chat with your AI in OpenClaw at night → memories stored
  • Code in Cursor the next morning → those memories are injected
  • Switch to Codex for a different task → same context available

One vault. Every tool. Unified memory across your entire workflow.


Read-Only vs Read-Write

Key TypeFormatRetrieves MemoriesStores Sessions
Read-Writemk_40a267...
Read-Onlymk_ro_40a267...

Recommended: Use read-only keys for coding tools. Coding sessions generate tons of tool calls, file diffs, and intermediate output that would add noise to your vault. Read-only gives you the context without the clutter.


Pricing

Same as all MemoryRouter usage:

PlanPriceIncludes
Trial$0 for 14 daysFull access during the trial. Accounts created before 2026-06-05 keep their original 50M included-token allowance.
Pro$0.10 / 1M tokensPay as you go.

Get your Memory Key at app.memoryrouter.ai.

On this page