The two surfaces, side by side
| Personal key | Organization key | |
|---|---|---|
| Endpoint | POST /v1/api-keys | POST /v1/orgs/{org_id}/api-keys |
| Who can create | Any authenticated user | Owner or admin of the org |
| Billed to | The user’s billing account | The org’s billing account |
| Acts as | The user’s identity + permissions | The user’s identity, scoped to the org |
| Visible in | Settings → Personal → API keys | Settings → Organization → API keys |
| Survives departure? | No — when the user leaves, key revokes | Yes — admin must explicitly revoke |
| Revoke | The user (or admin via support) | Owner, admin, or original creator |
mnm_ prefix; they’re identical at the wire level. The difference is billing attribution and lifecycle ownership.
When to use which
Personal key, every time — unless one of the things below applies.- Local development. A developer on the team using Mnemom from their laptop. Personal key.
- Per-engineer CI accounts. Each engineer has their own CI runner credentialed against their personal account. Personal key. (You probably want option 2 below for actual CI.)
- Single-purpose script you’re running yourself. Personal key.
- Shared CI/CD infrastructure that runs as the org, not as a specific engineer. Survives engineer turnover.
- Service-account-style automation — a cron job, a webhook receiver, a third-party integration that needs to outlive any individual member’s tenure.
- Audit / compliance posture that needs requests attributed to the org rather than to a person. The audit log tags org-level keys distinctly from user-level keys.
Creating a key
Personal
Organization
key field. You see it once. Mnemom stores only its SHA-256 hash; we cannot recover the secret if you lose it.
Rotation
Two endpoints, identical contract:POST /v1/api-keys/{key_id}/rotatePOST /v1/orgs/{org_id}/api-keys/{key_id}/rotate
name and scopes, then immediately revokes the old key. The full new secret returns in the 201 response.
No grace period — by design
The old key is invalid as soon as the response reaches you. Rotation is for the suspect or compromised case where you do not want overlap. If you need overlap with an in-flight deploy, don’t rotate. Instead:POST /v1/api-keysto create a second key.- Update your deployment to use the new key.
- Verify it’s working in production.
DELETE /v1/api-keys/{old_key_id}to retire the original.
Failure semantics
- Insert-new fails: the response is 500; your old key is still valid. Try again.
- Insert-new succeeds, soft-revoke fails: the response is 500 with a hint pointing you at
DELETE /v1/api-keys/{old_key_id}to finish manually. The new key is fully active either way — capture it before retrying.
Audit trail
Rotations log a distinctapi_key_rotated event in your billing event history (and the org audit log for org-level rotations). The event records both the old and new key_ids so support can trace a rotation chain.
Org keys after P4f tightening
Org-key creation requiresowner or admin (not member). If you’re a member who used to create org keys, the path forward is:
- Use a personal key instead. They’re billed to you, but Mnemom doesn’t double-bill — the personal-key checkmeter is a courtesy view, not a separate ledger.
- Or ask an admin to create the org key for you. Once it exists, you can rotate it (you become the creator post-rotation) but only the admin can have created it initially.
Revocation
is_active flips to false, revoked_at is timestamped, the row stays for audit. You cannot reactivate a revoked key — create a new one.
For org keys, the same shape applies under /v1/orgs/{org_id}/api-keys/{key_id}. Owner, admin, or original creator can revoke; member can only revoke keys they created themselves.
Key hygiene checklist
- Rotate annually, or whenever a member with access leaves the org. The audit log shows last_used_at per key — rotate dormant keys aggressively.
- Name your keys.
"name": "ci-prod"is much more useful than"Default"six months later when you’re triaging an alert. - Never commit secrets. The
mnm_prefix is a string git secret-scanners recognize; we recommend GitHub Secret Scanning + push protection to catch accidents. - Use scopes. Keys default to
["gateway", "api"]; if you only need one, request just one. Smaller blast radius if leaked. - Include a renewal reminder in your deploy / IaC if the key has a TTL constraint from your security policy. Mnemom keys themselves don’t expire by default.