API Keys#

class ApiKeysClient(*, sdk_config: SDKConfiguration, generated_client: ApiClient)[source]#

Bases: object

Client for managing Arize API keys.

This class is primarily intended for internal use within the SDK. Users are highly encouraged to access resource-specific functionality via arize.ArizeClient.

The API keys client is a thin wrapper around the generated REST API client, using the shared generated API client owned by arize.config.SDKConfiguration.

Parameters:
  • sdk_config (SDKConfiguration) – Resolved SDK configuration.

  • generated_client (ApiClient) – Shared generated API client instance.

list(*, key_type: ApiKeyType | None = None, status: ApiKeyStatus | None = None, space: str | None = None, user_id: str | None = None, limit: int = DEFAULT_LIST_LIMIT, cursor: str | None = None) ListApiKeysResponse[source]#

List API keys.

This endpoint supports cursor-based pagination. Optionally filter by key_type, status, space, and user_id.

Service keys (key_type=ApiKeyType.SERVICE): provide space to return all service keys for that space. When key_type is omitted alongside space, service keys are returned implicitly. Optionally combine with user_id to filter by creator — available to any caller with space access.

User keys (key_type=ApiKeyType.USER): returned by default (no space). Provide user_id to view keys for a specific user — account admins only; non-admins receive a 403.

Parameters:
  • key_type (ApiKeyType | None) – Optional key type filter (ApiKeyType.USER or ApiKeyType.SERVICE).

  • status (ApiKeyStatus | None) – Optional status filter (ApiKeyStatus.ACTIVE or ApiKeyStatus.REVOKED). Defaults to ApiKeyStatus.ACTIVE on the server side when omitted.

  • space (str | None) – Space name or ID. When provided, filters to service keys for that space. Accepts a human-readable name or a base64 identifier.

  • user_id (str | None) – Base64 identifier of the user whose keys to return. For service keys (with space), filters by creator and is available to any caller with space access. For user keys (without space), requires account admin role.

  • limit (int) – Maximum number of keys to return (1 to 100). Defaults to 50.

  • cursor (str | None) – Opaque pagination cursor from a previous response.

Returns:

A paginated API key list response from the Arize REST API.

Raises:

ApiException – If the API request fails.

Return type:

ListApiKeysResponse

create(*, name: str, description: str | None = None, expires_at: datetime | None = None) UserApiKeyCreated[source]#

Create a new user API key.

Creates a user-type key that authenticates as the creating user with their full permissions. To create a space-scoped service key, use create_service_key instead.

The returned UserApiKeyCreated object contains the full raw key value in its key field. This is the only time the raw key is returned. Store it securely.

Parameters:
  • name (str) – User-defined name for the API key (max 256 characters).

  • description (str | None) – Optional description (max 1000 characters).

  • expires_at (datetime | None) – Optional expiration timestamp. If omitted the key never expires. Must be a future timestamp.

Returns:

The created API key, including the one-time raw key value.

Raises:

ApiException – If the API request fails (e.g. invalid parameters or insufficient permissions).

Return type:

UserApiKeyCreated

create_service_key(*, name: str, orgs: builtins.list[OrgBinding], account_role: UserRoleAssignment | None = None, description: str | None = None, expires_at: datetime | None = None) ServiceApiKeyCreated[source]#

Create a service-type API key with org and space bindings.

Service keys are tied to a dedicated service account scoped to one or more organizations, each containing one or more spaces. All spaces must belong to the same account. When no role is specified for a space or org, the server applies the default predefined role (MEMBER for spaces, READ_ONLY for orgs, MEMBER for accounts).

The returned ServiceApiKeyCreated object contains the full raw key value in its key field. This is the only time the raw key is returned. Store it securely.

Parameters:
  • name (str) – User-defined name for the API key (max 256 characters).

  • orgs (builtins.list[OrgBinding]) – List of OrgBinding objects, each specifying an optional org-level role and a list of SpaceBinding objects within that org. At least one org with at least one space is required.

  • account_role (UserRoleAssignment | None) – Optional account-level role for the bot user. When None, the server applies the default predefined MEMBER role.

  • description (str | None) – Optional description (max 1000 characters).

  • expires_at (datetime | None) – Optional expiration timestamp. If omitted the key never expires. Must be a future timestamp.

Returns:

The created API key, including the one-time raw key value.

Raises:
  • ValueError – If orgs is empty or any org has no space bindings.

  • ApiException – If the API request fails (e.g. invalid role assignment or insufficient permissions).

Return type:

ServiceApiKeyCreated

revoke(*, api_key_id: str) None[source]#

Revoke an API key.

The key’s status is set to ApiKeyStatus.REVOKED and it is deactivated immediately and permanently. This operation is irreversible — the key will stop working right away. Revoking an already-revoked key is a no-op and still succeeds.

Parameters:

api_key_id (str) – ID of the API key to revoke.

Returns:

None

Raises:

ApiException – If the API request fails (e.g. key not found or insufficient permissions).

Return type:

None

refresh(*, api_key_id: str, expires_at: datetime | None = None, grace_period_seconds: int | None = None) RefreshApiKeyResponse[source]#

Refresh an existing API key.

Atomically revokes the old key and issues a replacement with the same name, description, type, and scope.

Use grace_period_seconds to keep the old key valid briefly while your services rotate to the new key.

Parameters:
  • api_key_id (str) – ID of the API key to refresh.

  • expires_at (datetime | None) – New expiration for the replacement key. If omitted the replacement key will not expire.

  • grace_period_seconds (int | None) – Optional grace window, in seconds, during which the old key remains valid after refresh. If omitted or 0, the old key is invalidated immediately.

Returns:

The newly issued API key, including the one-time raw key value.

Raises:

ApiException – If the API request fails (e.g. key not found, already deleted, or insufficient permissions).

Return type:

RefreshApiKeyResponse

Response Types#

Public type re-exports for the api_keys subdomain.

class ApiKey(*, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)], description: Annotated[str, Strict(strict=True)] | None = None, key_type: ApiKeyType, status: ApiKeyStatus, redacted_key: Annotated[str, Strict(strict=True)], created_at: datetime, expires_at: datetime | None = None, created_by_user_id: Annotated[str, Strict(strict=True)], last_used_at: datetime | None = None)[source]#

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
id: StrictStr#
name: StrictStr#
description: StrictStr | None#
key_type: ApiKeyType#
status: ApiKeyStatus#
redacted_key: StrictStr#
created_at: datetime#
expires_at: datetime | None#
created_by_user_id: StrictStr#
last_used_at: datetime | None#
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

to_str() str[source]#

Returns the string representation of the model using alias

Return type:

str

to_json() str[source]#

Returns the JSON representation of the model using alias

Return type:

str

classmethod from_json(json_str: str) Self | None[source]#

Create an instance of ApiKey from a JSON string

Parameters:

json_str (str)

Return type:

Self | None

to_dict() Dict[str, Any][source]#

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic’s self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.

Return type:

Dict[str, Any]

classmethod from_dict(obj: Dict[str, Any] | None) Self | None[source]#

Create an instance of ApiKey from a dict

Parameters:

obj (Dict[str, Any] | None)

Return type:

Self | None

class ApiKeyStatus(value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: str, Enum

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 = 'ACTIVE'#
REVOKED = 'REVOKED'#
classmethod from_json(json_str: str) Self[source]#

Create an instance of ApiKeyStatus from a JSON string

Parameters:

json_str (str)

Return type:

Self

class ApiKeyType(value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: str, Enum

Type of the API key. - USER - Personal key that authenticates as the creating user. - SERVICE - Key that authenticates as a service account with explicitly granted access.

USER = 'USER'#
SERVICE = 'SERVICE'#
classmethod from_json(json_str: str) Self[source]#

Create an instance of ApiKeyType from a JSON string

Parameters:

json_str (str)

Return type:

Self

class CreateApiKeyResponse(*args, oneof_schema_1_validator: UserApiKeyCreated | None = None, oneof_schema_2_validator: ServiceApiKeyCreated | None = None, actual_instance: ServiceApiKeyCreated | UserApiKeyCreated | None = None, one_of_schemas: Set[str] = {'ServiceApiKeyCreated', 'UserApiKeyCreated'}, discriminator_value_class_map: Dict[str, str] = {})[source]#

Bases: BaseModel

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 a bot_user with the service account’s resolved role assignments.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
oneof_schema_1_validator: UserApiKeyCreated | None#
oneof_schema_2_validator: ServiceApiKeyCreated | None#
actual_instance: ServiceApiKeyCreated | UserApiKeyCreated | None#
one_of_schemas: Set[str]#
model_config: ClassVar[ConfigDict] = {'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

discriminator_value_class_map: Dict[str, str]#
classmethod actual_instance_must_validate_oneof(v)[source]#
classmethod from_dict(obj: str | Dict[str, Any]) Self[source]#
Parameters:

obj (str | Dict[str, Any])

Return type:

Self

classmethod from_json(json_str: str) Self[source]#

Returns the object represented by the json string

Parameters:

json_str (str)

Return type:

Self

to_json() str[source]#

Returns the JSON representation of the actual instance

Return type:

str

to_dict() Dict[str, Any] | ServiceApiKeyCreated | UserApiKeyCreated | None[source]#

Returns the dict representation of the actual instance

Return type:

Dict[str, Any] | ServiceApiKeyCreated | UserApiKeyCreated | None

to_str() str[source]#

Returns the string representation of the actual instance

Return type:

str

class CustomRoleAssignment(*, type: SpaceRoleAssignmentType, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)] | None = None)[source]#

Bases: BaseModel

A custom RBAC role assignment.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
  • type (SpaceRoleAssignmentType)

  • id (Annotated[str, Strict(strict=True)])

  • name (Annotated[str, Strict(strict=True)] | None)

type: SpaceRoleAssignmentType#
id: StrictStr#
name: StrictStr | None#
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

to_str() str[source]#

Returns the string representation of the model using alias

Return type:

str

to_json() str[source]#

Returns the JSON representation of the model using alias

Return type:

str

classmethod from_json(json_str: str) Self | None[source]#

Create an instance of CustomRoleAssignment from a JSON string

Parameters:

json_str (str)

Return type:

Self | None

to_dict() Dict[str, Any][source]#

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic’s self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.

  • OpenAPI readOnly fields are excluded.

Return type:

Dict[str, Any]

classmethod from_dict(obj: Dict[str, Any] | None) Self | None[source]#

Create an instance of CustomRoleAssignment from a dict

Parameters:

obj (Dict[str, Any] | None)

Return type:

Self | None

class ListApiKeysResponse(*, api_keys: List[ApiKey], pagination: PaginationMetadata)[source]#

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
api_keys: List[ApiKey]#
pagination: PaginationMetadata#
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

to_str() str[source]#

Returns the string representation of the model using alias

Return type:

str

to_json() str[source]#

Returns the JSON representation of the model using alias

Return type:

str

classmethod from_json(json_str: str) Self | None[source]#

Create an instance of ListApiKeysResponse from a JSON string

Parameters:

json_str (str)

Return type:

Self | None

to_dict() Dict[str, Any][source]#

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic’s self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.

Return type:

Dict[str, Any]

classmethod from_dict(obj: Dict[str, Any] | None) Self | None[source]#

Create an instance of ListApiKeysResponse from a dict

Parameters:

obj (Dict[str, Any] | None)

Return type:

Self | None

to_df(by_alias: bool = False, exclude_none: str | bool = True, json_normalize: bool = False, convert_dtypes: bool = True, expand_field: str = 'additional_properties', expand_prefix: str = '') pd.DataFrame#

Convert a list of objects to a pandas.DataFrame.

Behavior:
  • If an item is a Pydantic v2 model, use .model_dump(by_alias=…).

  • If an item is a mapping (dict-like), use it as-is.

  • Otherwise, raise a ValueError (unsupported row type).

Parameters:
  • self (object) – The object instance containing the field to convert.

  • by_alias (bool) – Use field aliases when dumping Pydantic models.

  • exclude_none (str | bool) – Control None/NaN column dropping. - False: keep Nones as-is - “all”: drop columns where all values are None/NaN - “any”: drop columns where any value is None/NaN - True: alias for “all”

  • json_normalize (bool) – If True, flatten nested dicts via pandas.json_normalize.

  • convert_dtypes (bool) – If True, call DataFrame.convert_dtypes() at the end.

  • expand_field (str) – If set, look for this field in each row and expand its keys into top-level columns.

  • expand_prefix (str) – If set, prefix expanded column names with this string.

Returns:

The converted DataFrame.

Return type:

pandas.DataFrame

class OrgBinding(org_id: str, spaces: list[~arize.api_keys.types.SpaceBinding] = <factory>, role: ~organization_role_assignment.OrganizationRoleAssignment | None = None)[source]#

Bases: object

Declares one organization that the service key’s bot user should access.

The binding answers “which org?”. Each org binding contains one or more SpaceBinding objects that specify which spaces within that org the bot user can access and with what role.

Parameters:
org_id#

HMAC-encoded ID of the organization.

Type:

str

spaces#

Space bindings within this organization. At least one is required. All spaces must belong to this organization.

Type:

list[arize.api_keys.types.SpaceBinding]

role#

Role to assign the bot user at the organization level. When None, the server defaults to the predefined READ_ONLY role. Use OrganizationPredefinedRoleAssignment for built-in roles or OrganizationCustomRoleAssignment for custom RBAC roles.

Type:

arize._generated.api_client.models.organization_role_assignment.OrganizationRoleAssignment | None

org_id: str#
spaces: list[SpaceBinding]#
role: OrganizationRoleAssignment | None = None#
class OrganizationCustomRoleAssignment(*, type: OrganizationRoleAssignmentType, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)] | None = None)[source]#

Bases: BaseModel

A custom RBAC role assignment.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
  • type (OrganizationRoleAssignmentType)

  • id (Annotated[str, Strict(strict=True)])

  • name (Annotated[str, Strict(strict=True)] | None)

type: OrganizationRoleAssignmentType#
id: StrictStr#
name: StrictStr | None#
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

to_str() str[source]#

Returns the string representation of the model using alias

Return type:

str

to_json() str[source]#

Returns the JSON representation of the model using alias

Return type:

str

classmethod from_json(json_str: str) Self | None[source]#

Create an instance of OrganizationCustomRoleAssignment from a JSON string

Parameters:

json_str (str)

Return type:

Self | None

to_dict() Dict[str, Any][source]#

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic’s self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.

  • OpenAPI readOnly fields are excluded.

Return type:

Dict[str, Any]

classmethod from_dict(obj: Dict[str, Any] | None) Self | None[source]#

Create an instance of OrganizationCustomRoleAssignment from a dict

Parameters:

obj (Dict[str, Any] | None)

Return type:

Self | None

class OrganizationPredefinedRoleAssignment(*, type: OrganizationRoleAssignmentType, name: OrganizationRole)[source]#

Bases: BaseModel

A predefined organization role assignment.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
type: OrganizationRoleAssignmentType#
name: OrganizationRole#
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

to_str() str[source]#

Returns the string representation of the model using alias

Return type:

str

to_json() str[source]#

Returns the JSON representation of the model using alias

Return type:

str

classmethod from_json(json_str: str) Self | None[source]#

Create an instance of OrganizationPredefinedRoleAssignment from a JSON string

Parameters:

json_str (str)

Return type:

Self | None

to_dict() Dict[str, Any][source]#

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic’s self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.

Return type:

Dict[str, Any]

classmethod from_dict(obj: Dict[str, Any] | None) Self | None[source]#

Create an instance of OrganizationPredefinedRoleAssignment from a dict

Parameters:

obj (Dict[str, Any] | None)

Return type:

Self | None

class OrganizationRoleAssignment(*args, oneof_schema_1_validator: OrganizationPredefinedRoleAssignment | None = None, oneof_schema_2_validator: OrganizationCustomRoleAssignment | None = None, actual_instance: OrganizationCustomRoleAssignment | OrganizationPredefinedRoleAssignment | None = None, one_of_schemas: Set[str] = {'OrganizationCustomRoleAssignment', 'OrganizationPredefinedRoleAssignment'}, discriminator_value_class_map: Dict[str, str] = {})[source]#

Bases: BaseModel

A role assignment for an organization membership. Discriminated by type: - PREDEFINED: one of the predefined roles (ADMIN, MEMBER, READ_ONLY, ANNOTATOR) - CUSTOM: a custom RBAC role identified by its ID

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
oneof_schema_1_validator: OrganizationPredefinedRoleAssignment | None#
oneof_schema_2_validator: OrganizationCustomRoleAssignment | None#
actual_instance: OrganizationCustomRoleAssignment | OrganizationPredefinedRoleAssignment | None#
one_of_schemas: Set[str]#
model_config: ClassVar[ConfigDict] = {'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

discriminator_value_class_map: Dict[str, str]#
classmethod actual_instance_must_validate_oneof(v)[source]#
classmethod from_dict(obj: str | Dict[str, Any]) Self[source]#
Parameters:

obj (str | Dict[str, Any])

Return type:

Self

classmethod from_json(json_str: str) Self[source]#

Returns the object represented by the json string

Parameters:

json_str (str)

Return type:

Self

to_json() str[source]#

Returns the JSON representation of the actual instance

Return type:

str

to_dict() Dict[str, Any] | OrganizationCustomRoleAssignment | OrganizationPredefinedRoleAssignment | None[source]#

Returns the dict representation of the actual instance

Return type:

Dict[str, Any] | OrganizationCustomRoleAssignment | OrganizationPredefinedRoleAssignment | None

to_str() str[source]#

Returns the string representation of the actual instance

Return type:

str

class PredefinedRoleAssignment(*, type: SpaceRoleAssignmentType, name: UserSpaceRole)[source]#

Bases: BaseModel

A predefined space role assignment.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
type: SpaceRoleAssignmentType#
name: UserSpaceRole#
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

to_str() str[source]#

Returns the string representation of the model using alias

Return type:

str

to_json() str[source]#

Returns the JSON representation of the model using alias

Return type:

str

classmethod from_json(json_str: str) Self | None[source]#

Create an instance of PredefinedRoleAssignment from a JSON string

Parameters:

json_str (str)

Return type:

Self | None

to_dict() Dict[str, Any][source]#

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic’s self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.

Return type:

Dict[str, Any]

classmethod from_dict(obj: Dict[str, Any] | None) Self | None[source]#

Create an instance of PredefinedRoleAssignment from a dict

Parameters:

obj (Dict[str, Any] | None)

Return type:

Self | None

class RefreshApiKeyResponse(*, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)], description: Annotated[str, Strict(strict=True)] | None = None, key_type: ApiKeyType, status: ApiKeyStatus, redacted_key: Annotated[str, Strict(strict=True)], created_at: datetime, expires_at: datetime | None = None, created_by_user_id: Annotated[str, Strict(strict=True)], last_used_at: datetime | None = None, key: Annotated[str, Strict(strict=True)])[source]#

Bases: BaseModel

The refreshed API key credential and its metadata. Refresh replaces the key secret but preserves the key’s identity (ID, name, type, bindings). Unlike key creation, refresh does not return bot_user details — refresh never creates a new service account and the existing bot user’s bindings are unchanged.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
id: StrictStr#
name: StrictStr#
description: StrictStr | None#
key_type: ApiKeyType#
status: ApiKeyStatus#
redacted_key: StrictStr#
created_at: datetime#
expires_at: datetime | None#
created_by_user_id: StrictStr#
last_used_at: datetime | None#
key: StrictStr#
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

to_str() str[source]#

Returns the string representation of the model using alias

Return type:

str

to_json() str[source]#

Returns the JSON representation of the model using alias

Return type:

str

classmethod from_json(json_str: str) Self | None[source]#

Create an instance of RefreshApiKeyResponse from a JSON string

Parameters:

json_str (str)

Return type:

Self | None

to_dict() Dict[str, Any][source]#

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic’s self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.

Return type:

Dict[str, Any]

classmethod from_dict(obj: Dict[str, Any] | None) Self | None[source]#

Create an instance of RefreshApiKeyResponse from a dict

Parameters:

obj (Dict[str, Any] | None)

Return type:

Self | None

class ServiceApiKeyCreated(*, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)], description: Annotated[str, Strict(strict=True)] | None = None, key_type: Annotated[str, Strict(strict=True)], status: ApiKeyStatus, redacted_key: Annotated[str, Strict(strict=True)], created_at: datetime, expires_at: datetime | None = None, created_by_user_id: Annotated[str, Strict(strict=True)], last_used_at: datetime | None = None, key: Annotated[str, Strict(strict=True)], bot_user: ServiceKeyBotUser)[source]#

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
id: StrictStr#
name: StrictStr#
description: StrictStr | None#
key_type: StrictStr#
status: ApiKeyStatus#
redacted_key: StrictStr#
created_at: datetime#
expires_at: datetime | None#
created_by_user_id: StrictStr#
last_used_at: datetime | None#
key: StrictStr#
bot_user: ServiceKeyBotUser#
classmethod key_type_validate_enum(value)[source]#

Validates the enum

model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

to_str() str[source]#

Returns the string representation of the model using alias

Return type:

str

to_json() str[source]#

Returns the JSON representation of the model using alias

Return type:

str

classmethod from_json(json_str: str) Self | None[source]#

Create an instance of ServiceApiKeyCreated from a JSON string

Parameters:

json_str (str)

Return type:

Self | None

to_dict() Dict[str, Any][source]#

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic’s self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.

Return type:

Dict[str, Any]

classmethod from_dict(obj: Dict[str, Any] | None) Self | None[source]#

Create an instance of ServiceApiKeyCreated from a dict

Parameters:

obj (Dict[str, Any] | None)

Return type:

Self | None

class ServiceKeyBotUser(*, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)], account_role: UserRoleAssignment, organizations: Annotated[List[ServiceKeyBotUserOrgAssignment], MinLen(min_length=1)])[source]#

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
id: StrictStr#
name: StrictStr#
account_role: UserRoleAssignment#
organizations: Annotated[List[ServiceKeyBotUserOrgAssignment], Field(min_length=1)]#
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

to_str() str[source]#

Returns the string representation of the model using alias

Return type:

str

to_json() str[source]#

Returns the JSON representation of the model using alias

Return type:

str

classmethod from_json(json_str: str) Self | None[source]#

Create an instance of ServiceKeyBotUser from a JSON string

Parameters:

json_str (str)

Return type:

Self | None

to_dict() Dict[str, Any][source]#

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic’s self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.

Return type:

Dict[str, Any]

classmethod from_dict(obj: Dict[str, Any] | None) Self | None[source]#

Create an instance of ServiceKeyBotUser from a dict

Parameters:

obj (Dict[str, Any] | None)

Return type:

Self | None

class ServiceKeyBotUserOrgAssignment(*, org_id: Annotated[str, Strict(strict=True)], role: OrganizationRoleAssignment, spaces: List[ServiceKeyBotUserSpaceAssignment])[source]#

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
org_id: StrictStr#
role: OrganizationRoleAssignment#
spaces: List[ServiceKeyBotUserSpaceAssignment]#
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

to_str() str[source]#

Returns the string representation of the model using alias

Return type:

str

to_json() str[source]#

Returns the JSON representation of the model using alias

Return type:

str

classmethod from_json(json_str: str) Self | None[source]#

Create an instance of ServiceKeyBotUserOrgAssignment from a JSON string

Parameters:

json_str (str)

Return type:

Self | None

to_dict() Dict[str, Any][source]#

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic’s self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.

Return type:

Dict[str, Any]

classmethod from_dict(obj: Dict[str, Any] | None) Self | None[source]#

Create an instance of ServiceKeyBotUserOrgAssignment from a dict

Parameters:

obj (Dict[str, Any] | None)

Return type:

Self | None

class ServiceKeyBotUserSpaceAssignment(*, space_id: Annotated[str, Strict(strict=True)], role: SpaceRoleAssignment)[source]#

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
space_id: StrictStr#
role: SpaceRoleAssignment#
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

to_str() str[source]#

Returns the string representation of the model using alias

Return type:

str

to_json() str[source]#

Returns the JSON representation of the model using alias

Return type:

str

classmethod from_json(json_str: str) Self | None[source]#

Create an instance of ServiceKeyBotUserSpaceAssignment from a JSON string

Parameters:

json_str (str)

Return type:

Self | None

to_dict() Dict[str, Any][source]#

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic’s self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.

Return type:

Dict[str, Any]

classmethod from_dict(obj: Dict[str, Any] | None) Self | None[source]#

Create an instance of ServiceKeyBotUserSpaceAssignment from a dict

Parameters:

obj (Dict[str, Any] | None)

Return type:

Self | None

class ServiceKeySpaceAssignment(*, space_id: Annotated[str, Strict(strict=True)], role: SpaceRoleAssignment | None = None)[source]#

Bases: BaseModel

Declares one space that the service key’s service account should have access to. The space assignment (space_id) identifies the target space. The role assignment (role) specifies the level of access within that space — either a named predefined role or a custom RBAC role identified by its ID.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
space_id: StrictStr#
role: SpaceRoleAssignment | None#
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

to_str() str[source]#

Returns the string representation of the model using alias

Return type:

str

to_json() str[source]#

Returns the JSON representation of the model using alias

Return type:

str

classmethod from_json(json_str: str) Self | None[source]#

Create an instance of ServiceKeySpaceAssignment from a JSON string

Parameters:

json_str (str)

Return type:

Self | None

to_dict() Dict[str, Any][source]#

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic’s self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.

Return type:

Dict[str, Any]

classmethod from_dict(obj: Dict[str, Any] | None) Self | None[source]#

Create an instance of ServiceKeySpaceAssignment from a dict

Parameters:

obj (Dict[str, Any] | None)

Return type:

Self | None

class SpaceBinding(space: str, role: SpaceRoleAssignment | None = None)[source]#

Bases: object

Declares one space that the service key’s bot user should access.

The binding answers “which space?” The role assignment answers “with what role?”. A role assignment is either a named predefined role (e.g. PredefinedRoleAssignment(name="MEMBER")) or a custom RBAC role referenced by ID (CustomRoleAssignment(id="<encoded-role-id>")).

Parameters:
space#

Space name or base64-encoded space ID.

Type:

str

role#

Role to assign the bot user within this space. When None, the server defaults to the predefined MEMBER role. Use PredefinedRoleAssignment for built-in roles (ADMIN, MEMBER, READ_ONLY) or CustomRoleAssignment for custom RBAC roles.

Type:

arize._generated.api_client.models.space_role_assignment.SpaceRoleAssignment | None

space: str#
role: SpaceRoleAssignment | None = None#
class SpaceRoleAssignment(*args, oneof_schema_1_validator: PredefinedRoleAssignment | None = None, oneof_schema_2_validator: CustomRoleAssignment | None = None, actual_instance: CustomRoleAssignment | PredefinedRoleAssignment | None = None, one_of_schemas: Set[str] = {'CustomRoleAssignment', 'PredefinedRoleAssignment'}, discriminator_value_class_map: Dict[str, str] = {})[source]#

Bases: BaseModel

Specifies which role to assign within a space. Discriminated by type: - PREDEFINED: a built-in platform role — { “type”: “PREDEFINED”, “name”: “ADMIN” | “MEMBER” | “READ_ONLY” | “ANNOTATOR” } - CUSTOM: a custom RBAC role identified by its ID — { “type”: “CUSTOM”, “id”: “<encoded-role-id>” } Used wherever a space-level role assignment is required (memberships, service key bindings, etc.).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
oneof_schema_1_validator: PredefinedRoleAssignment | None#
oneof_schema_2_validator: CustomRoleAssignment | None#
actual_instance: CustomRoleAssignment | PredefinedRoleAssignment | None#
one_of_schemas: Set[str]#
model_config: ClassVar[ConfigDict] = {'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

discriminator_value_class_map: Dict[str, str]#
classmethod actual_instance_must_validate_oneof(v)[source]#
classmethod from_dict(obj: str | Dict[str, Any]) Self[source]#
Parameters:

obj (str | Dict[str, Any])

Return type:

Self

classmethod from_json(json_str: str) Self[source]#

Returns the object represented by the json string

Parameters:

json_str (str)

Return type:

Self

to_json() str[source]#

Returns the JSON representation of the actual instance

Return type:

str

to_dict() Dict[str, Any] | CustomRoleAssignment | PredefinedRoleAssignment | None[source]#

Returns the dict representation of the actual instance

Return type:

Dict[str, Any] | CustomRoleAssignment | PredefinedRoleAssignment | None

to_str() str[source]#

Returns the string representation of the actual instance

Return type:

str

class UserApiKeyCreated(*, id: Annotated[str, Strict(strict=True)], name: Annotated[str, Strict(strict=True)], description: Annotated[str, Strict(strict=True)] | None = None, key_type: Annotated[str, Strict(strict=True)], status: ApiKeyStatus, redacted_key: Annotated[str, Strict(strict=True)], created_at: datetime, expires_at: datetime | None = None, created_by_user_id: Annotated[str, Strict(strict=True)], last_used_at: datetime | None = None, key: Annotated[str, Strict(strict=True)])[source]#

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
id: StrictStr#
name: StrictStr#
description: StrictStr | None#
key_type: StrictStr#
status: ApiKeyStatus#
redacted_key: StrictStr#
created_at: datetime#
expires_at: datetime | None#
created_by_user_id: StrictStr#
last_used_at: datetime | None#
key: StrictStr#
classmethod key_type_validate_enum(value)[source]#

Validates the enum

model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

to_str() str[source]#

Returns the string representation of the model using alias

Return type:

str

to_json() str[source]#

Returns the JSON representation of the model using alias

Return type:

str

classmethod from_json(json_str: str) Self | None[source]#

Create an instance of UserApiKeyCreated from a JSON string

Parameters:

json_str (str)

Return type:

Self | None

to_dict() Dict[str, Any][source]#

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic’s self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.

Return type:

Dict[str, Any]

classmethod from_dict(obj: Dict[str, Any] | None) Self | None[source]#

Create an instance of UserApiKeyCreated from a dict

Parameters:

obj (Dict[str, Any] | None)

Return type:

Self | None

class UserRoleAssignment(*args, oneof_schema_1_validator: PredefinedUserRoleAssignment | None = None, oneof_schema_2_validator: CustomUserRoleAssignment | None = None, actual_instance: CustomUserRoleAssignment | PredefinedUserRoleAssignment | None = None, one_of_schemas: Set[str] = {'CustomUserRoleAssignment', 'PredefinedUserRoleAssignment'}, discriminator_value_class_map: Dict[str, str] = {})[source]#

Bases: BaseModel

An account-level role assignment. Discriminated by type: - PREDEFINED: one of the predefined roles (admin, member, annotator) - CUSTOM: a custom RBAC role identified by its ID Note: CUSTOM role assignments are not yet supported and are reserved for future use.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
  • oneof_schema_1_validator (PredefinedUserRoleAssignment | None)

  • oneof_schema_2_validator (CustomUserRoleAssignment | None)

  • actual_instance (CustomUserRoleAssignment | PredefinedUserRoleAssignment | None)

  • one_of_schemas (Set[str])

  • discriminator_value_class_map (Dict[str, str])

oneof_schema_1_validator: PredefinedUserRoleAssignment | None#
oneof_schema_2_validator: CustomUserRoleAssignment | None#
actual_instance: CustomUserRoleAssignment | PredefinedUserRoleAssignment | None#
one_of_schemas: Set[str]#
model_config: ClassVar[ConfigDict] = {'protected_namespaces': (), 'validate_assignment': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

discriminator_value_class_map: Dict[str, str]#
classmethod actual_instance_must_validate_oneof(v)[source]#
classmethod from_dict(obj: str | Dict[str, Any]) Self[source]#
Parameters:

obj (str | Dict[str, Any])

Return type:

Self

classmethod from_json(json_str: str) Self[source]#

Returns the object represented by the json string

Parameters:

json_str (str)

Return type:

Self

to_json() str[source]#

Returns the JSON representation of the actual instance

Return type:

str

to_dict() Dict[str, Any] | CustomUserRoleAssignment | PredefinedUserRoleAssignment | None[source]#

Returns the dict representation of the actual instance

Return type:

Dict[str, Any] | CustomUserRoleAssignment | PredefinedUserRoleAssignment | None

to_str() str[source]#

Returns the string representation of the actual instance

Return type:

str