List Keys
List all keys for a given user / team / organization.
Parameters: expand: Optional[List[str]] - Expand related objects (e.g. 'user' to include user information) status: Optional[str] - Filter by status. Currently supports "deleted" to query deleted keys.
Returns: { "keys": List[str] or List[UserAPIKeyAuth], "total_count": int, "current_page": int, "total_pages": int, }
When expand includes "user", each key object will include a "user" field with the associated user object. Note: When expand=user is specified, full key objects are returned regardless of the return_full_object parameter.
Query parameters
Page number
Page number
Page size
Page size
Filter keys by user ID. Exact match by default; set substring_matching=true (admin only) for case-insensitive substring matching.
Filter keys by user ID. Exact match by default; set substring_matching=true (admin only) for case-insensitive substring matching.
Filter keys by team ID
Filter keys by team ID
Filter keys by organization ID
Filter keys by organization ID
Filter keys by key hash
Filter keys by key hash
Filter keys by key alias. Exact match by default; set substring_matching=true (admin only) for case-insensitive substring matching.
Filter keys by key alias. Exact match by default; set substring_matching=true (admin only) for case-insensitive substring matching.
Combined search: matches keys whose token (key hash) equals the value OR whose key_alias contains it (case-insensitive).
Combined search: matches keys whose token (key hash) equals the value OR whose key_alias contains it (case-insensitive).
Return full key object
Return full key object
Include all keys for teams that user is an admin of.
Include all keys for teams that user is an admin of.
Include keys created by the user
Include keys created by the user
Column to sort by (e.g. 'user_id', 'created_at', 'spend')
Column to sort by (e.g. 'user_id', 'created_at', 'spend')
Sort order ('asc' or 'desc')
Sort order ('asc' or 'desc')
Expand related objects (e.g. 'user')
Expand related objects (e.g. 'user')
Filter by status (e.g. 'deleted')
Filter by status (e.g. 'deleted')
Filter keys by project ID
Filter keys by project ID
Filter keys by access group ID
Filter keys by access group ID
Filter keys by agent ID
Filter keys by agent ID
If true (proxy admins only), match user_id/key_alias as case-insensitive substrings instead of exact values. Defaults to false: /key/list matched these exactly before substring search was added, and an exact user_id/key_alias filter must never return another user's keys.
If true (proxy admins only), match user_id/key_alias as case-insensitive substrings instead of exact values. Defaults to false: /key/list matched these exactly before substring search was added, and an exact user_id/key_alias filter must never return another user's keys.
Filter keys by expiration. 'expired' returns keys whose expires is in the past; 'active' returns keys that never expire or expire in the future. Omit to return keys regardless of expiration.
Filter keys by expiration. 'expired' returns keys whose expires is in the past; 'active' returns keys that never expire or expire in the future. Omit to return keys regardless of expiration.
Response
Successful Response