Authentication
Memory OS uses API keys to authenticate requests. Your API keys carry many privileges, so be sure to keep them secure.
Get Your API Key
You can create and manage your API keys in the dashboard.
Using Your API Key
Include your API key in the Authorization header of every request:
curl https://api.memory-os.com/v1/memories \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"SDK Authentication
Node.js / TypeScript
import { MemoryOS } from '@memory-os/sdk';
const client = new MemoryOS({
apiKey: process.env.MEMORY_OS_API_KEY
});Python
from memory_os import MemoryOS
import os
client = MemoryOS(api_key=os.environ.get("MEMORY_OS_API_KEY"))Best Practices
Security Guidelines
- • Store API keys in environment variables, never in code
- • Never commit API keys to version control
- • Use different keys for development, staging, and production
- • Rotate keys regularly and immediately if compromised
- • Restrict API key permissions to only what's needed
Environment Variables
Store your API key in a .env file:
# .env
MEMORY_OS_API_KEY=your_api_key_hereMake sure to add .env to your .gitignore file.
