Authentication
Learn how to authenticate with the Memoid API using API keys, JWT tokens, and workspace keys. Includes security best practices.
Memoid uses API keys to authenticate requests.
Getting Your API Key
Your key will look like:
mem_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2 Using Your API Key
Include the key in the Authorization header:
curl -X POST https://api.memoid.dev/v1/memories
-H "Authorization: Bearer mem_xxxxx"
-H "Content-Type: application/json"
-d '{"messages": [...], "user_id": "user_123"}' Or use Token prefix:
Authorization: Token mem_xxxxx Security Best Practices
Never expose keys in client-side code
API keys should only be used server-side. Never include them in:
- JavaScript bundles
- Mobile app code
- Public repositories
Use environment variables
export MEMOID_API_KEY=mem_xxxxx Rotate keys regularly
Generate new keys periodically and revoke old ones from the dashboard.
Rate Limits
| Plan | Requests/minute | Memories/month |
|---|---|---|
| Free | 60 | 10,000 |
| Pro | 600 | 100,000 |
| Enterprise | Unlimited | Unlimited |
Rate limit headers are included in all responses:
X-RateLimit-Limit: Maximum requests per minuteX-RateLimit-Remaining: Requests remainingX-RateLimit-Reset: Timestamp when limit resets
Troubleshooting
401 Unauthorized
- Check that your API key is correct
- Ensure the key hasn’t been revoked
- Verify the
Authorizationheader format
429 Too Many Requests
- You’ve exceeded rate limits
- Wait for the reset time or upgrade your plan