Create an API key
Create a new API key for the authenticated user.
- Choose
key_type: "USER"for a personal key that authenticates as you, orkey_type: "SERVICE"for an automated service account key. The field is required. - For service keys, supply at least one space via the
organizationsarray. The service account is granted membership in each specified space. Multiple organizations and multiple spaces per organization are supported. - For
USERkeys, the key inherits the authenticated user’s own permissions. - You may only assign roles at or below your own privilege level. Attempting to
assign a role higher than your own returns
422 Unprocessable Entity. - All roles default to minimum privilege when omitted: space roles default to
MEMBER, organization roles default toREAD_ONLY, andaccount_roledefaults toMEMBER.
Authorization:
- User keys: Requires the
developeruser permission flag. Returns403when this flag is absent. - Service keys: Requires the
SERVICE_KEY_CREATEpermission in the target space (space member or above).
The full API key value (key) is only returned once in the creation response.
Store it securely — it cannot be retrieved again. Use the redacted_key field on
subsequent reads.
Authorizations
Most Arize AI endpoints require authentication. For those endpoints that require authentication, include your API key in the request header using the format
Body
Body containing API key creation parameters
- Option 1
- Option 2
Request body for creating an API key. Set key_type to select the kind of key:
USER— authenticates as the creating user, inheriting their current permissions.SERVICE— authenticates as a service account: a dedicated, automatically provisioned identity with roles explicitly configured in the spaces you specify. Use this for automation, CI/CD pipelines, or any workload that should run independently of a specific user.
The type of key to create. Use "USER" for a personal key that authenticates
as you with your current permissions. Use "SERVICE" for a key tied to a
dedicated service account with its own explicitly configured access across
one or more spaces.
USER User-defined name for the API key.
256"My dev key"
Optional user-defined description for the API key.
1000"Used for local development."
Optional expiration timestamp. If omitted the key never expires.
"2026-01-01T00:00:00Z"
Response
API key successfully created or refreshed. The raw key is only returned once.
- Option 1
- Option 2
Response for a newly created or refreshed API key. The key_type field discriminates the variant:
USER— standard user key; no bot user.SERVICE— service key tied to a service account; includes abot_userwith the service account's resolved role assignments.
Unique identifier for the API key.
User-defined name for the API key.
Discriminator value for user keys.
USER Current status of the API key.
- ACTIVE - The key is valid for use.
- REVOKED - The key has been revoked and is no longer valid.
ACTIVE, REVOKED Redacted version of the key suitable for display (e.g., "ak-abc...xyz").
Timestamp when the key was created.
ID of the user who created the key.
The full API key value. Only returned once at creation or refresh time. Store it securely — it cannot be retrieved again.
Optional user-defined description for the API key.
Optional timestamp when the key will expire.
Approximate timestamp when the key was last used for authentication. This value is periodically updated and may not reflect the most recent usage.