Create an API key
Mint a new API key, optionally scoped to a project, capped with limit and limit_reset, or restricted with allowed_models. The raw key is returned once, in the key field.
Authentication
A management key (prefixed mgmt_), created on the dashboard’s API keys page under Management keys. Distinct from a regular gateway API key, and never used to call models.
Request
A name for the key, for example customer-acme or alice@acme.com. Shown in the dashboard and usage views.
Window the spend cap resets on; defaults to monthly.
Project to scope the key to; a key’s project can’t be changed after creation.
Canonical provider/model IDs this key may call, where a trailing * matches by prefix; omit or send null for no restriction, and an empty list blocks every model.
Response
Stable identifier for the key. A one-way hash, not the secret, so it is safe to store and log. Use it in get, update, and delete calls.
Display label (the key’s public prefix, e.g. mg_8Kx2pQ). Not the secret.
The raw API key (prefixed mg_). Shown exactly once, at creation. Store it now; it cannot be retrieved later.
User-set name for the key.
Project the key is scoped to, or null for an organization-wide key.
Models the key may call; null means unrestricted and an empty list blocks every model.