Skip to main content

User Auth Data

User Auth Data Management

Manage API key configurations (auth-data) and their associations to AI systems. These methods let you create, view, edit, delete, and map auth-data to specific AI systems.

Create Cloud Auth Data

create_cloud_auth_data(name, provider_type, api_key)

Creates a new REMOTE_CLOUD auth-data configuration with a single API key. The server validates and encrypts the key.

Method Parameters

name | required string

Display name for this auth configuration.


provider_type | required ProviderTypeEnum

Cloud provider. Examples: "openai", "azure", "anthropic", "mistral", "togetherai", "lambdalabs", "databricks", "bedrock", "gemini".


api_key | required string

Plaintext API key. Stored encrypted server‑side.


Returns

UserAuthDataRecordEntity

Example

from dynamofl.entities import ProviderTypeEnum

record = dfl.create_cloud_auth_data(
name="Primary OpenAI",
provider_type=ProviderTypeEnum.OPENAI,
api_key="sk-***",
)

Get User Auth Data + Associations

get_user_auth_data_and_associations(auth_type?, provider_type?)

Returns the user's auth-data grouped by provider along with the AI system mappings for each entry.

Method Parameters

auth_type | optional AuthDataAuthTypeEnum

Filter by auth type. Examples: "REMOTE_CLOUD", "REMOTE_CUSTOM".


provider_type | optional ProviderTypeEnum

Filter by provider. Examples: "openai", "azure", "anthropic"


Returns

GetUserLevelAuthDataAndModelAssociationEntity

Example

from dynamofl.entities import AuthDataAuthTypeEnum, ProviderTypeEnum

listing = dfl.get_user_auth_data_and_associations(
auth_type=AuthDataAuthTypeEnum.REMOTE_CLOUD,
provider_type=ProviderTypeEnum.OPENAI,
)

Get Auth Data (by ID)

get_auth_data(auth_id)

Fetch a single auth-data row and its AI system mappings for the user.

Method Parameters

auth_id | required int

The auth-data id to fetch.


Returns

GetAuthDataByIdEntity

Example

details = dfl.get_auth_data(auth_id=123)

Edit Auth Data

edit_auth_data(auth_id, name?, api_key?)

Edit the display name and/or API key on a REMOTE_CLOUD auth-data configuration.

Method Parameters

auth_id | required int

The auth-data id to edit.


name | optional string

New display name.


api_key | optional string

New plaintext API key (will be validated and encrypted).


Returns

UserAuthDataRecordEntity

Example

updated = dfl.edit_auth_data(
auth_id=123,
name="Prod OpenAI Key",
api_key="sk-***",
)

Delete Auth Data

delete_auth_data(auth_id)

Delete a user's auth-data row by id.

Method Parameters

auth_id | required int

The auth-data id to delete.


Returns

DeleteAuthDataResponseEntity

Example

resp = dfl.delete_auth_data(auth_id=123)

Update AI System Mappings

update_auth_mappings_on_auth_data(auth_id, ai_systems_to_add?, ai_systems_to_remove?)

Associate or remove AI system mappings for a given auth-data id. Use this to link API keys to specific models and set primaries via the server’s policy.

Method Parameters

auth_id | required int

The auth-data id to update.


ai_systems_to_add | optional List[string]

Model ids to associate with this auth-data.


ai_systems_to_remove | optional List[string]

Model ids to remove from association.


Returns

UpdateAuthMappingsOnAuthDataResponseEntity

Example

result = dfl.update_auth_mappings_on_auth_data(
auth_id=123,
ai_systems_to_add=["model_key_a", "model_key_b"],
ai_systems_to_remove=["old_model_key"],
)

Notes

  • For remote AI systems, the model creation flow requires providing auth_data_ids and a primary_auth_data_id. Do not pass plaintext API keys to model creation; the server resolves keys from your auth-data. This is reflected in the AI Systems creation methods such as create_openai_model, create_azure_model, etc.