Overview
Satori uses API keys for authentication, powered by Clerk’s API key management system. Each API key is tied to a specific tenant (you, the developer), and all memories stored using that key are isolated to your account.API Key Structure
Satori API keys follow this format:Creating an API Key
1
Sign in to your dashboard
Visit satori.dev/dashboard and sign in with your account.
2
Navigate to API Keys
Click on “API Keys” in the sidebar navigation.
3
Create a new key
Click “Create API Key” and give it a descriptive name:
4
Copy your key
Your API key will be displayed once. Copy it immediately and store it securely.
5
Add to environment variables
Store your API key in your environment variables:
.env.local
Using API Keys
Server-Side Usage (Recommended)
Always use API keys on the server side, never in client-side code:app/api/chat/route.ts
Client-Side (Never Do This)
Authentication Headers
When making direct HTTP requests to the Satori API, include your API key in thex-api-key header:
Tenant Isolation Model
Satori uses a two-level isolation model:Level 1: Tenant (API Key Owner)
Your API key identifies you as the tenant. All memories created with your key belong to your account.Level 2: End Users (Your Application’s Users)
Within your tenant, you can have unlimited end users, each with isolated memories:Think of it like this: Your API key is your “account”, and
userId is how you separate your users’ data within your account.API Key Verification Flow
Here’s what happens when you make a request:1
Request includes API key
Your application sends a request with the
x-api-key header:2
Satori verifies with Clerk
The Satori server verifies the key with Clerk:
3
Request is scoped to tenant
All database queries are automatically scoped to your tenant:
Managing API Keys
List Your Keys
View all your active API keys:Revoke a Key
Revoke an API key to immediately prevent all access:Security Best Practices
Use environment variables
Use environment variables
Store API keys in environment variables, never hardcode them:
Rotate keys regularly
Rotate keys regularly
Create a new API key and update your applications, then revoke the old key:
- Create new key in dashboard
- Update environment variables in all environments
- Deploy updates
- Revoke old key
Use different keys per environment
Use different keys per environment
Separate keys for development, staging, and production:
Monitor key usage
Monitor key usage
Check the “Last used” timestamp in your dashboard to detect unused or compromised keys.
Never commit keys to Git
Never commit keys to Git
Add environment files to
.gitignore:.gitignore
Rate Limiting
API keys are subject to rate limits to prevent abuse:| Limit Type | Value |
|---|---|
| Requests per minute | 100 |
| Memories per user | Unlimited |
| Concurrent requests | 10 |
Need higher limits? Contact support to discuss enterprise plans.