Create an API key
Create a new API key for the authenticated user.
key_typedefaults touserwhen omitted.- For
servicekeys,space_idis required. The service key is scoped to the given space, and a bot user will be created with the specified roles. - For
userkeys,space_idandrolesmust not be set — passing either returns400. 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
400 Bad Request. - All roles default to the minimum privilege when omitted:
space_role→member,org_role→read-only,account_role→member.
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
User-defined name for the API key.
256"CI pipeline key"
Optional user-defined description for the API key.
1000"Key used by the CI pipeline to upload evaluation results."
Type of the API key to create. Defaults to user.
- user - Key that authenticates as the creating user with their full permissions.
space_idandrolesmust not be set (returns400). - service - Key scoped to a specific space backed by a dedicated bot user.
Requires
space_id. All roles default to minimum privilege when omitted.
user, service "user"
Optional expiration timestamp. If omitted the key never expires.
"2026-01-01T00:00:00Z"
ID of the space this service key is scoped to. Required when key_type is service;
invalid for user keys (returns 400).
"U3BhY2UxMjM"
Role assignments for the service key's bot user. Only valid when key_type is service;
invalid for user keys (returns 400). When omitted, each role field defaults to
minimum privilege: space_role → member, org_role → read-only, account_role → member.
Response
API key successfully created or refreshed. The raw key is only returned once.
Unique identifier for the API key.
User-defined name for the API key.
Type of the API key.
- user - Key associated with a specific user.
- service - Key associated with a bot user for service authentication.
user, service Current status of the API key.
- active - The key is valid for use.
- deleted - The key has been deleted by a user.
active, deleted 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.