ExBifrost.Api.Providers (ex_bifrost v0.1.0)

Copy Markdown View Source

API calls for all endpoints tagged Providers.

Summary

Functions

Add a new provider Adds a new provider with the specified configuration.

Create a key for a provider Creates a new API key for the specified provider. The key id is auto-generated if omitted. enabled defaults to true if omitted. value is required and must not be empty. Keys cannot be created on keyless providers.

Delete a provider Removes a provider from the configuration.

Delete a key from a provider Deletes a key from the specified provider. Returns the deleted key.

Get model parameters Returns the available parameter definitions for models.

Get a specific provider Returns the configuration for a specific provider.

Get a specific key for a provider Returns a single key for the specified provider.

List base models Returns a list of base models from the model catalog.

List all keys Returns a list of all configured API keys across all providers.

List model details Lists available models with capability metadata, when available from the model catalog, with optional filtering by query, provider, or keys.

List models Lists available models with optional filtering by query, provider, or keys.

List keys for a provider Returns all keys configured for a specific provider.

List all providers Returns a list of all configured providers with their configurations and status.

Update a provider Updates a provider's configuration. Expects ALL fields to be provided, including both edited and non-edited fields. Partial updates are not supported.

Update a key for a provider Updates an existing key. Send the full key object. Redacted values sent back unchanged are automatically preserved (the server merges them with the stored raw values).

Functions

add_provider(connection, add_provider_request, opts \\ [])

Add a new provider Adds a new provider with the specified configuration.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • add_provider_request (AddProviderRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.ProviderResponse.t} on success
  • {:error, Tesla.Env.t} on failure

create_provider_key(connection, provider, key, opts \\ [])

@spec create_provider_key(
  Tesla.Env.client(),
  String.t(),
  ExBifrost.Model.Key.t(),
  keyword()
) ::
  {:ok, ExBifrost.Model.BifrostError.t()}
  | {:ok, ExBifrost.Model.Key.t()}
  | {:error, Tesla.Env.t()}

Create a key for a provider Creates a new API key for the specified provider. The key id is auto-generated if omitted. enabled defaults to true if omitted. value is required and must not be empty. Keys cannot be created on keyless providers.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • provider (String.t): Provider name
  • key (Key):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.Key.t} on success
  • {:error, Tesla.Env.t} on failure

delete_provider(connection, provider, opts \\ [])

@spec delete_provider(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExBifrost.Model.ProviderResponse.t()}
  | {:ok, ExBifrost.Model.BifrostError.t()}
  | {:error, Tesla.Env.t()}

Delete a provider Removes a provider from the configuration.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • provider (String.t): Provider name
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.ProviderResponse.t} on success
  • {:error, Tesla.Env.t} on failure

delete_provider_key(connection, provider, key_id, opts \\ [])

@spec delete_provider_key(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, ExBifrost.Model.BifrostError.t()}
  | {:ok, ExBifrost.Model.Key.t()}
  | {:error, Tesla.Env.t()}

Delete a key from a provider Deletes a key from the specified provider. Returns the deleted key.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • provider (String.t): Provider name
  • key_id (String.t): Key ID
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.Key.t} on success
  • {:error, Tesla.Env.t} on failure

get_model_parameters(connection, opts \\ [])

@spec get_model_parameters(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, ExBifrost.Model.BifrostError.t()}
  | {:error, Tesla.Env.t()}

Get model parameters Returns the available parameter definitions for models.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

get_provider(connection, provider, opts \\ [])

@spec get_provider(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExBifrost.Model.ProviderResponse.t()}
  | {:ok, ExBifrost.Model.BifrostError.t()}
  | {:error, Tesla.Env.t()}

Get a specific provider Returns the configuration for a specific provider.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • provider (String.t): Provider name
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.ProviderResponse.t} on success
  • {:error, Tesla.Env.t} on failure

get_provider_key(connection, provider, key_id, opts \\ [])

@spec get_provider_key(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, ExBifrost.Model.BifrostError.t()}
  | {:ok, ExBifrost.Model.Key.t()}
  | {:error, Tesla.Env.t()}

Get a specific key for a provider Returns a single key for the specified provider.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • provider (String.t): Provider name
  • key_id (String.t): Key ID
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.Key.t} on success
  • {:error, Tesla.Env.t} on failure

list_base_models(connection, opts \\ [])

@spec list_base_models(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, ExBifrost.Model.BifrostError.t()}
  | {:error, Tesla.Env.t()}

List base models Returns a list of base models from the model catalog.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :query (String.t): Filter models by name
    • :provider (String.t): Filter by provider
    • :limit (integer()): Maximum number of results to return

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

list_keys(connection, opts \\ [])

@spec list_keys(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, ExBifrost.Model.BifrostError.t()}
  | {:ok, [ExBifrost.Model.Key.t()]}
  | {:error, Tesla.Env.t()}

List all keys Returns a list of all configured API keys across all providers.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, [%Key{}, ...]} on success
  • {:error, Tesla.Env.t} on failure

list_model_details_management(connection, opts \\ [])

@spec list_model_details_management(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, ExBifrost.Model.BifrostError.t()}
  | {:ok, ExBifrost.Model.ListModelDetailsManagement200Response.t()}
  | {:error, Tesla.Env.t()}

List model details Lists available models with capability metadata, when available from the model catalog, with optional filtering by query, provider, or keys.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :query (String.t): Filter models by name (case-insensitive partial match)
    • :provider (String.t): Filter by specific provider name
    • :keys ([String.t]): Comma-separated list of key IDs to filter models accessible by those keys
    • :limit (integer()): Maximum number of results to return (default 20)
    • :unfiltered (boolean()): If true, return all models including those filtered out by provider-level restrictions

Returns

  • {:ok, ExBifrost.Model.ListModelDetailsManagement200Response.t} on success
  • {:error, Tesla.Env.t} on failure

list_models_management(connection, opts \\ [])

@spec list_models_management(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, ExBifrost.Model.BifrostError.t()}
  | {:ok, ExBifrost.Model.ListModelsManagement200Response.t()}
  | {:error, Tesla.Env.t()}

List models Lists available models with optional filtering by query, provider, or keys.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :query (String.t): Filter models by name (case-insensitive partial match)
    • :provider (String.t): Filter by specific provider name
    • :keys ([String.t]): Comma-separated list of key IDs to filter models accessible by those keys
    • :limit (integer()): Maximum number of results to return (default 5)
    • :unfiltered (boolean()): If true, return all models including those filtered out by provider-level restrictions

Returns

  • {:ok, ExBifrost.Model.ListModelsManagement200Response.t} on success
  • {:error, Tesla.Env.t} on failure

list_provider_keys(connection, provider, opts \\ [])

@spec list_provider_keys(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExBifrost.Model.BifrostError.t()}
  | {:ok, ExBifrost.Model.ListProviderKeysResponse.t()}
  | {:error, Tesla.Env.t()}

List keys for a provider Returns all keys configured for a specific provider.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • provider (String.t): Provider name
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.ListProviderKeysResponse.t} on success
  • {:error, Tesla.Env.t} on failure

list_providers(connection, opts \\ [])

@spec list_providers(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, ExBifrost.Model.ListProvidersResponse.t()}
  | {:ok, ExBifrost.Model.BifrostError.t()}
  | {:error, Tesla.Env.t()}

List all providers Returns a list of all configured providers with their configurations and status.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.ListProvidersResponse.t} on success
  • {:error, Tesla.Env.t} on failure

update_provider(connection, provider, update_provider_request, opts \\ [])

Update a provider Updates a provider's configuration. Expects ALL fields to be provided, including both edited and non-edited fields. Partial updates are not supported.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • provider (String.t): Provider name
  • update_provider_request (UpdateProviderRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.ProviderResponse.t} on success
  • {:error, Tesla.Env.t} on failure

update_provider_key(connection, provider, key_id, key, opts \\ [])

@spec update_provider_key(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  ExBifrost.Model.Key.t(),
  keyword()
) ::
  {:ok, ExBifrost.Model.BifrostError.t()}
  | {:ok, ExBifrost.Model.Key.t()}
  | {:error, Tesla.Env.t()}

Update a key for a provider Updates an existing key. Send the full key object. Redacted values sent back unchanged are automatically preserved (the server merges them with the stored raw values).

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • provider (String.t): Provider name
  • key_id (String.t): Key ID
  • key (Key):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.Key.t} on success
  • {:error, Tesla.Env.t} on failure