Skip to content

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

API keys and auth

Catalog and event endpoints need an API key. Account, key and webhook endpoints need a portal sign-in instead. Each reference page shows which one with its badge: “API key”, “Portal sign-in” or “No auth”.

Sign in on Your account (or sign up there, where sign-up is open). A new account starts on the Free plan. Create a key on the same page: it’s shown once, so copy it then. You can list and revoke your keys there too.

ma_live_<prefix>_<secret>
  • ma_live_ keys work on the production API. ma_test_ keys work on test deployments only. A key for the wrong one gets 401 unauthorized.
  • The prefix is 8 characters. It isn’t secret: key lists show it, so you can tell keys apart.
  • The secret is long and random. It’s shown once, when the key is created. We store only a hash of it, so we can’t show it again or recover it.

Send the key in the Authorization header on every request:

Terminal window
curl -H "Authorization: Bearer $MA_API_KEY" "$MA_API/v1/providers?limit=20"
You send You get
No Authorization: Bearer header 401 unauthorized: “Send your API key: Authorization: Bearer ma_live_…”
A malformed, unknown or revoked key, or one for the other kind of deployment 401 unauthorized: “The API key isn’t valid or has been revoked.”
A good key, on an account without an active plan 403 forbidden: “This account has no active plan, so its keys can’t read the catalog yet.”

GET /v1/health, GET /v1/openapi.yaml and GET /v1/sources (how fresh each source is) need no key.

Keep keys on your server. Don’t put one in a browser app, a mobile app or source control: anyone with the key can use your plan.

There’s no rotate call. To rotate:

  1. Create a new key.
  2. Deploy it everywhere the old one is used.
  3. Revoke the old key.

Your plan sets how many active keys your account can have (entitlements.limits.api_keys on GET /v1/account). At the limit, creating one more is 409 conflict. With a limit of 1, revoke the old key first, then create the new one.

GET /v1/api-keys lists your keys, revoked ones included, with each one’s prefix, created_at, last_used_at and revoked_at. last_used_at is updated at most once a minute.

Each API server caches a checked key for up to 60 seconds. So:

  • A revoked key can keep working for up to a minute.
  • A plan change (a plan granted, a field group added or removed) takes up to a minute to apply.

The secret is still checked on every request: the cache only saves the lookup.

/v1/account, /v1/api-keys, /v1/webhook-endpoints, /v1/webhook-subscriptions and /v1/deliveries take a portal access token (Authorization: Bearer $MA_ACCESS_TOKEN), not an API key. Your account uses them for you: it signs you in (on the Model Atlas sign-in page, then back here) and keeps the access token in that tab only, for an hour. Webhooks have no page yet: your Model Atlas contact can set them up.