Skip to content

Preview: Model Atlas is in development and not yet available.

Create an API key

POST/v1/api-keysPortal sign-in

Returns the full key once, in key. Store it: it can’t be shown again. Your plan sets how many active keys your account can have (entitlements.limits.api_keys on GET /v1/account; one before a plan is granted): at the limit, 409 conflict. To rotate, create a new key, switch to it, then revoke the old one.

Authorization

Portal sign-in Authorization: Bearer $MA_ACCESS_TOKEN

Sign in to the portal and send its access token. Portal sign-in isn't available yet, so you can read this endpoint but not call it.

Request body

Required, application/json.

  • namestringrequired

    A name to tell the key apart. Spaces around it are trimmed; then it must be 1 to 100 characters, with no control characters.

    Range
    1 to 100 characters
    Example
    Production
Example request body
{
"name": "Production"
}

Responses

The new key, with the full key in key.

application/json · ApiKeyCreated

  • idstring (uuid)required

    The key’s ID, to get or revoke it.

    Example
    6f1c2a9e-4b7d-4e3a-9c51-2d8f0b7e3a14
  • namestringrequired

    The name you gave it.

    Example
    Production
  • prefixstringrequired

    The key’s public part, to tell keys apart: the 8 characters after ma_live_ (or ma_test_ for a test key).

    Example
    p4ppuj7y
  • created_atstring (date-time)required

    When the key was created.

    Example
    2026-11-26T15:10:00Z
  • last_used_atstring (date-time)requirednullable

    Updated at most once a minute.

    Example
    2026-11-28T09:41:00Z
  • revoked_atstring (date-time)requirednullable

    When the key was revoked. Null while it works.

    Example
    null
  • keystringrequired

    The full key, shown once: ma_live_ (ma_test_ for a test key), the 8-character prefix, _, then a 52-character secret. Send it as Authorization: Bearer <key>. The example is shortened.

    Example
    ma_test_p4ppuj7y_ji3ebqcb6iwsvw…
201 example
{
"id": "6f1c2a9e-4b7d-4e3a-9c51-2d8f0b7e3a14",
"name": "Production",
"prefix": "p4ppuj7y",
"created_at": "2026-11-26T15:10:00Z",
"last_used_at": null,
"revoked_at": null,
"key": "ma_test_p4ppuj7y_ji3ebqcb6iwsvw…"
}