> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memorylake.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployment Modes

> Connect with your own provider key (BYOK) or with MemoryLake-hosted models — same memory layer either way

Memory Router works two ways. Unlike proxies that force you to bring your own key, you can keep your provider account **or** let MemoryLake run the models for you. Both modes share the same endpoints — the difference is which keys you send. Everything else — prompts, streaming, tool calls — stays the same.

## Endpoints

| Protocol                  | Endpoint                                                    |
| ------------------------- | ----------------------------------------------------------- |
| OpenAI · Chat Completions | `POST https://app.memorylake.ai/openai/v1/chat/completions` |
| OpenAI · Responses        | `POST https://app.memorylake.ai/openai/v1/responses`        |
| OpenAI · Embeddings       | `POST https://app.memorylake.ai/openai/v1/embeddings`       |
| Anthropic · Messages      | `POST https://app.memorylake.ai/anthropic/v1/messages`      |

Append `?boundary_id=<id>` to enable memory on a request — see [How It Works](/features/memory-router/how-it-works#boundaries-define-the-scope).

<Note>
  With the Anthropic SDK, set `base_url` to `https://app.memorylake.ai/anthropic` (without `/v1`) — the SDK appends `/v1/messages` itself.
</Note>

## MemoryLake-hosted

No provider account required. MemoryLake runs the major models for you, so a single MemoryLake API key is all you need to start.

* One key for everything — nothing else to sign up for.
* GPT, Claude, and Qwen model families built in and ready to call by their native names.
* The simplest possible way to ship with memory.

**Keys:** MemoryLake key only, in the native auth header (`Authorization: Bearer` for OpenAI-style calls, `x-api-key` for Anthropic)

```ts TypeScript theme={null}
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://app.memorylake.ai/openai/v1",
  apiKey: process.env.MEMORYLAKE_API_KEY,
});

// Pick any built-in model by its native name, e.g. "gpt-4o-mini" or "qwen-plus".
```

## BYOK — Bring Your Own Key

Use your own provider account. Your provider key is encrypted in transit, forwarded to the provider per call, and never stored on our servers.

* Keep your existing OpenAI / Anthropic account.
* Your key, your billing, your rate limits.
* Key is encrypted + passthrough only — never persisted or logged.

**Keys:** your provider key in the provider's **native** auth header + MemoryLake key in the `x-memorylake-api-key` header

```ts TypeScript theme={null}
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://app.memorylake.ai/openai/v1",
  apiKey: process.env.OPENAI_API_KEY,        // your provider key
  defaultHeaders: {
    "x-memorylake-api-key": process.env.MEMORYLAKE_API_KEY,
  },
});
```

<Info>
  The native auth header differs by protocol: OpenAI-style calls use `Authorization: Bearer <key>`; Anthropic calls use `x-api-key: <key>`. In BYOK mode your provider key goes there, and the MemoryLake key always rides in `x-memorylake-api-key`.
</Info>

## Choosing a Mode

|                       | MemoryLake-hosted                | BYOK                                              |
| --------------------- | -------------------------------- | ------------------------------------------------- |
| Provider account      | Not required                     | Required (yours)                                  |
| Keys                  | MemoryLake key only              | Provider key + MemoryLake key                     |
| Billing & rate limits | Handled by MemoryLake            | Stay with your provider account                   |
| Best for              | Fastest path to ship with memory | Teams with existing provider contracts and quotas |

## Key Safety, by Design

<Warning>
  In BYOK mode your provider key is encrypted in transit and passed straight through to the provider on every call. MemoryLake never stores, logs, or reuses it — the design is stateless, per-request passthrough with zero server-side key storage.
</Warning>

## Supported Providers

| Provider                                           | BYOK | Hosted |
| -------------------------------------------------- | ---- | ------ |
| OpenAI / GPT (Chat Completions & Responses)        | ✅    | ✅      |
| Anthropic / Claude (Messages)                      | ✅    | ✅      |
| Alibaba Qwen (OpenAI-compatible, via `/openai/v1`) | —    | ✅      |

Additional providers and protocols are added over time; the console's **Integrations → Memory Router API** page always reflects the current catalog.

## Next Steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/features/memory-router/quickstart">
    Copy-paste setup for both modes.
  </Card>

  <Card title="Observability" icon="activity" href="/features/memory-router/observability">
    Trace requests and understand the error contract.
  </Card>
</CardGroup>
