---
title: "Create organization API key"
method: POST
path: "/orgs/{org_id}/api-keys"
tags: ["Organizations"]
---

# Create organization API key

`POST /orgs/{org_id}/api-keys`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/orgs/{org_id}/api-keys`
- Auth: HTTP bearer

Mint an org-billed API key. Owners and admins may request any scope set. Members may create an org key ONLY when `scopes` is exactly `["gateway"]` (a gateway-only key that cannot call mnemom-api routes); a member must pass that scope set explicitly, and any other scope set (including the omitted-scopes default) returns 403. Viewers and auditors cannot create org keys. The key is billed to the org (for personal orgs with no billing account, a member-created key bills to the org owner's personal account) and records the caller as its creator.

## Path parameters

- `org_id` string, required

## Request body

- object
  - `name` string: Friendly name for the key (e.g., "ci-prod").
  - `scopes` ApiKeyScope[]: Capability set for this org key (ADR-049). If omitted, the API substitutes the default. For owner/admin callers `admin:org` is implicit-eligible; `admin:platform` still requires Mnemom-staff role. Member callers must send exactly `["gateway"]`.

## Response `201`

Org API key created

- ApiKey
  - `key_id` string
  - `key` string: Full secret key, only returned on creation
  - `key_prefix` string
  - `name` string
  - `org_id` string, nullable
  - `scopes` ApiKeyScope[]: Capabilities granted to this key. Default for new keys is `["gateway", "api:read", "api:write"]`. Admin scopes (`admin:org`, `admin:platform`) are opt-in and gated by the requester's role at mint time. See [API Keys → Scope vocabulary](https://docs.mnemom.ai/guides/api-keys#scope-vocabulary).
  - `created_at` string, date-time
  - `last_used_at` string, date-time, nullable

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Resource not found
- `429`: Rate-limit exceeded. The global per-IP limiter (100 requests/minute, applied to every `/v1/*` route) rejected this request. Back off until the window resets — `Retry-After` carries the cooldown in seconds and `X-RateLimit-Reset` the absolute reset time.
- `500`: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.

---

[API](https://skmtc.dev/mnemom/apis/mnemom-api.md) · [All operations](https://skmtc.dev/mnemom/apis/mnemom-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mnemom/apis/mnemom-api/revisions/274b7a6ea182?raw)
