anatools.anaclient.api_keys module

API Keys Functions

create_api_key(self, name, expires=None, organizationId=None)
Creates a new API Key for the user account for the current organization. User will only see this key once, so make sure to save it.

To use the api key on login, ensure it is set as an environment variable called RENDEREDAI_API_KEY on next use of anatools or send it as an init parameter called APIKey. This call can only be used when logged in with email/password.

Parameters
  • name (str) – Name of the API Key.

  • organizationId (str) – Organization ID to set the API Key access at. If no organization is provided, it will use the current context.

  • expires (str) – Expiration date to set for the API Key. If none provided, a default expiration a week out will get set.

Returns

API Key in plain-text or failure message about API key creation

Return type

str

delete_api_key(self, name)

Deletes the API key from user account. This call can only be used when logged in with email/password.

Parameters

name (str) – Name of the API Key to delete.

Returns

Success or failure message about API key deletion

Return type

bool

get_api_key_data(self, name)

Returns information about specific api key. This call will return data only when logged in with email/password.

Parameters

name (str) – Name of the API Key.

Returns

Information about API Key

Return type

[dict]

get_api_keys(self)

Queries the api keys associated with user’s account. This call will return data only when logged in with email/password.

Returns

Names of API keys associated with user’s account.

Return type

[dict]