X-API-Key HTTP header. There are no OAuth flows or session tokens — every call your agent makes must include a valid key, and MemLayer will reject any request that is missing one or that supplies an incorrectly formatted value.
Get Your API Key
Visit memlayer.online
Open memlayer.online in your browser and click Sign Up.
Create your free account
Register with your email address. The free plan activates immediately — no credit card is required, and you receive 500 memories and 100 requests per day from the moment your account is confirmed.
Find your API key
After signing up, your API key is displayed in the dashboard under Settings → API Keys. A copy of it is also sent to the email address you registered with.
Using Your API Key
Pass your key in theX-API-Key header on every request. The examples below show the three most common integration patterns.
- Python SDK
- curl
- Python httpx
Pass your key directly to Use
MemLayerClient at initialisation time. The SDK attaches the X-API-Key header to every request automatically so you never have to manage headers yourself.AsyncMemLayerClient with the same api_key argument for async agent frameworks.Keeping Your Key Safe
Store your API key in an environment variable and read it at runtime. This keeps the key out of your source code and configuration files that might be checked in..env file with a tool like python-dotenv and add .env to your .gitignore. For production deployments, inject the key through your hosting platform’s secrets manager (e.g., AWS Secrets Manager, Vercel Environment Variables, or Kubernetes Secrets).
Authentication Errors
If MemLayer cannot authenticate your request, it returns a JSON error response with one of the following status codes and messages.| HTTP Status | Reason | Resolution |
|---|---|---|
401 | Invalid or missing API key — the X-API-Key header was absent or the key does not exist. | Check that you are including the X-API-Key header and that the key value matches what is shown in your dashboard. |
401 | Wrong key format — the key does not start with ml_live_. | Make sure you copied the full key from the dashboard, including the ml_live_ prefix. |
403 | Account suspended — your account has been flagged and access is restricted. | Contact support@memlayer.online to resolve the suspension. |
