Skip to main content
Get Memory Router running in three steps. The only change to your application is the base URL (and, in BYOK mode, one header).

Step 1: Get a MemoryLake key

Sign up for MemoryLake and create an API key in the console. The Free tier includes memory storage to start.
Keep your MemoryLake key in an environment variable such as MEMORYLAKE_API_KEY. See Authentication for details on managing keys.

Step 2: Pick a mode and swap the base URL

Choose how you want to connect, then point your SDK at the matching Router endpoint:
ModeBase URLKeys
BYOK (bring your own key)https://router.memorylake.ai/v1/openaiYour provider key + MemoryLake key
MemoryLake-hostedhttps://router.memorylake.ai/v1MemoryLake key only
For BYOK, keep your provider key as the SDK’s API key and add the MemoryLake key as the x-memorylake-api-key header. For hosted, just use your MemoryLake key — no provider account required. See Deployment Modes for a full comparison.

BYOK — your provider key

import OpenAI from "openai";

// BYOK: you send your own provider key. We encrypt it in transit,
// forward it to the provider, and never store it.
const client = new OpenAI({
  baseURL: "https://router.memorylake.ai/v1/openai",
  apiKey: process.env.OPENAI_API_KEY,        // your provider key
  defaultHeaders: {
    // encrypted in transit · passthrough only · never stored
    "x-memorylake-api-key": process.env.MEMORYLAKE_API_KEY,
  },
});

MemoryLake-hosted — one key

import OpenAI from "openai";

// Non-BYOK: no provider account. MemoryLake hosts the models,
// so a single MemoryLake key is all you need.
const client = new OpenAI({
  baseURL: "https://router.memorylake.ai/v1",
  apiKey: process.env.MEMORYLAKE_API_KEY,
});

// Pick any built-in model, e.g. "claude-opus-4-8" or "gpt-5".

Step 3: Call as normal

Send requests exactly as you do today. Memory is recalled and stored automatically — no extra calls, no retrieval code.
TypeScript
const completion = await client.chat.completions.create({
  model: "claude-opus-4-8",
  messages: [{ role: "user", content: "Remind me what we decided last time." }],
});

console.log(completion.choices[0].message.content);
Read the diagnostic response headers to confirm that memory was injected and to see token savings on each call.

Next Steps

Deployment Modes

Full comparison of BYOK and hosted, plus supported providers.

Observability

Understand the diagnostic headers and graceful fallback.