abacusai.api_key

Classes

ApiKey

An API Key to authenticate requests to the Abacus.AI API

Module Contents

class abacusai.api_key.ApiKey(client, apiKeyId=None, apiKey=None, apiKeySuffix=None, tag=None, type=None, createdAt=None, expiresAt=None, isExpired=None, logRequests=None, ownerEmail=None, systemCreated=None)

Bases: abacusai.return_class.AbstractApiClass

An API Key to authenticate requests to the Abacus.AI API

Parameters:
  • client (ApiClient) – An authenticated API Client instance

  • apiKeyId (str) – The unique ID for the API key

  • apiKey (str) – The unique API key scoped to a specific organization. Value will be partially obscured.

  • apiKeySuffix (str) – The last 4 characters of the API key.

  • tag (str) – A user-friendly tag for the API key.

  • type (str) – The type of the API key, either ‘default’, ‘code-llm’, ‘terminal’, or ‘computer-use’.

  • createdAt (str) – The timestamp when the API key was created.

  • expiresAt (str) – The timestamp when the API key will expire.

  • isExpired (bool) – Whether the API key has expired.

  • logRequests (bool) – Whether RouteLLM API calls made with the key are recorded for the organization’s activity log export.

  • ownerEmail (str) – The email of the key’s owner; only in an administrator’s listing of the organization’s keys.

  • systemCreated (bool) – Whether the platform created the key (the agent’s and deployed apps’ keys); only in that listing.

api_key_id = None
api_key = None
api_key_suffix = None
tag = None
type = None
created_at = None
expires_at = None
is_expired = None
log_requests = None
owner_email = None
system_created = None
deprecated_keys
__repr__()
to_dict()

Get a dict representation of the parameters in this class

Returns:

The dict value representation of the class parameters

Return type:

dict

delete()

Delete a specified API key.

An administrator may revoke any key of the organization, the platform’s own keys included; everyone else only their own. Deleting the key a deployed agent or app signs its calls with breaks that app until it gets a new key.

Deliberately not behind disable_for_self_serve_org: revoking a key only removes access, and the desktop, terminal and system key types a self-serve organization can hold are created on paths that never require API metering, so gating the revoke left those keys listed (list_organization_api_keys is ungated for administrators) but impossible to delete without first turning a billing feature on.

Parameters:

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