Authentication
Authenticate API requests with project-scoped API keys.
API Keys
All API requests require an API key sent in the Authorization header. API keys are project-scoped — create them in your dashboard.
Keys start with ctx_ and are shown only once when created. Store them securely.
Creating an API key
Follow these steps to create an API key from the MemoryKit Platform:
-
Sign in — Go to platform.memorykit.io and sign in with your account.
-
Open API Keys — In the left sidebar, click API Keys. You'll see a list of your existing keys (if any) and their scopes.
-
Click "Create API Key" — The button is in the top-right corner of the API Keys page. A modal dialog will open.
-
Configure the key:
- Name — Give the key a descriptive name (e.g., "Production Backend", "Dev Testing").
- Project — Select which project this key belongs to. Each key is scoped to a single project.
- Scopes — Check the permissions this key should have (see Key scopes below). Use the minimum required scopes for security.
-
Copy the key — After clicking Create, the key will be displayed once. Copy it immediately and store it in a secure location (e.g., environment variable, secrets manager).
API keys are displayed only once at creation time. If you lose a key, you'll need to create a new one.
Using the key
Key scopes
API keys can be scoped to limit access:
| Scope | Description |
|---|---|
memories:read | Read and search memories |
memories:write | Create, update, and delete memories |
chats:read | Read chat sessions and history |
chats:write | Create chats and send messages |
users:read | Read user data |
users:write | Create and update users |
Security best practices
- Never expose API keys in client-side code — Use a backend proxy to make API calls.
- Use environment variables — Store keys in
MEMORYKIT_API_KEYenv var, not in source code. - Rotate keys periodically — Create a new key, update your app, then delete the old one.
- Use the minimum required scopes — A read-only search app only needs
memories:read. - Use separate keys per environment — Different keys for development, staging, and production.