Getting your API key
Open the project page
Navigate to your project dashboard at minns.ai and select the project you want to authenticate against.
Using your API key
Include the key in theAuthorization header of every request:
With the SDK
Pass your API key when creating the client:Authorization: Bearer <key> header to every request.
Environment variables
Store your key in an environment variable — never hardcode it:Key rotation
Rotating API keys regularly is a security best practice. Minns Memory Layer supports seamless rotation with zero downtime — you can have multiple active keys at the same time during the transition period.How to rotate
Create a new key
On the project page, go to Settings → API Keys and click Create Key. Name it something like
production-v2 so you can track the rotation.Deploy the new key
Update your application’s environment variables with the new key. Deploy the change to all instances.
Verify the new key is working
Monitor your application logs to confirm requests are succeeding with the new key. Check the API Keys page — you’ll see request counts incrementing on the new key.
Rotation checklist
| Step | Action | Verification |
|---|---|---|
| 1 | Create new key on project page | Key appears in the API Keys list |
| 2 | Update MINNS_API_KEY in all environments | Environment variable updated |
| 3 | Redeploy application | All instances using new key |
| 4 | Monitor for 24 hours | No 401 errors in logs |
| 5 | Revoke old key | Old key shows “Revoked” status |
Key types
| Prefix | Environment | Use case |
|---|---|---|
mk_live_ | Production | Live agent traffic — full access |
mk_test_ | Testing | Development and staging — same API, isolated data |
Test keys operate against the same API but use an isolated data namespace. Events ingested with a test key won’t appear in production queries.
Error responses
If authentication fails, the API returns a401 Unauthorized response:
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized | Missing or invalid Authorization header | Check that the header is Bearer <key> with no extra spaces |
401 Unauthorized | Key has been revoked | Create a new key on the project page |
403 Forbidden | Key doesn’t have permission for this endpoint | Check key permissions in project settings |
Security best practices
Use environment variables
Never hardcode API keys. Use
.env files locally and secrets managers in production (AWS Secrets Manager, Vault, etc.).Rotate regularly
Rotate keys every 90 days, or immediately if you suspect a key has been compromised.
Use separate keys per environment
Create distinct keys for development, staging, and production. Revoke dev keys freely without affecting prod.
Audit key usage
Check the project page periodically to see which keys are active and how much traffic each one handles.
Next steps
Quickstart
Get your first event logged in under 5 minutes.
SDK installation
Set up the full SDK with all configuration options.
