Deepgram.Manage (Deepgram v0.1.0)
View SourceManagement API services for the Deepgram API.
This module provides project and key management capabilities including project operations, API key management, member management, and usage tracking.
Summary
Functions
Creates a new API key.
Deletes an API key.
Deletes a project.
Gets all balances for a project.
Gets a specific API key.
Gets all API keys for a project.
Gets all members of a project.
Gets a specific model by ID.
Gets all available models for a project.
Gets a specific project by ID.
Gets all projects accessible by the API key.
Gets usage requests for a project.
Gets usage summary for a project.
Removes a member from a project.
Functions
@spec create_key(Deepgram.Client.t(), String.t(), Deepgram.Types.Manage.key_options()) :: {:ok, Deepgram.Types.Manage.key_response()} | {:error, any()}
Creates a new API key.
Parameters
client
- ADeepgram.Client
structproject_id
- The project IDoptions
- Key creation options (seeDeepgram.Types.Manage.key_options/0
)
Examples
iex> client = Deepgram.new(api_key: "your-api-key")
iex> options = %{comment: "My API key", scopes: ["usage:read"], tags: ["production"]}
iex> {:ok, key} = Deepgram.Manage.create_key(client, "project-id", options)
{:ok, %{api_key: %{key_id: "...", api_key: "...", ...}}}
@spec delete_key(Deepgram.Client.t(), String.t(), String.t()) :: {:ok, Deepgram.Types.Manage.message()} | {:error, any()}
Deletes an API key.
Parameters
client
- ADeepgram.Client
structproject_id
- The project IDkey_id
- The API key ID
Examples
iex> client = Deepgram.new(api_key: "your-api-key")
iex> {:ok, message} = Deepgram.Manage.delete_key(client, "project-id", "key-id")
{:ok, %{message: "API key deleted successfully"}}
@spec delete_project(Deepgram.Client.t(), String.t()) :: {:ok, Deepgram.Types.Manage.message()} | {:error, any()}
Deletes a project.
Parameters
client
- ADeepgram.Client
structproject_id
- The project ID
Examples
iex> client = Deepgram.new(api_key: "your-api-key")
iex> {:ok, message} = Deepgram.Manage.delete_project(client, "project-id")
{:ok, %{message: "Project deleted successfully"}}
@spec get_balances(Deepgram.Client.t(), String.t()) :: {:ok, Deepgram.Types.Manage.balances_response()} | {:error, any()}
Gets all balances for a project.
Parameters
client
- ADeepgram.Client
structproject_id
- The project ID
Examples
iex> client = Deepgram.new(api_key: "your-api-key")
iex> {:ok, balances} = Deepgram.Manage.get_balances(client, "project-id")
{:ok, %{balances: [%{balance_id: "...", amount: 100.0, ...}]}}
@spec get_key(Deepgram.Client.t(), String.t(), String.t()) :: {:ok, Deepgram.Types.Manage.key_response()} | {:error, any()}
Gets a specific API key.
Parameters
client
- ADeepgram.Client
structproject_id
- The project IDkey_id
- The API key ID
Examples
iex> client = Deepgram.new(api_key: "your-api-key")
iex> {:ok, key} = Deepgram.Manage.get_key(client, "project-id", "key-id")
{:ok, %{api_key: %{key_id: "...", api_key: "...", ...}}}
@spec get_keys(Deepgram.Client.t(), String.t()) :: {:ok, Deepgram.Types.Manage.keys_response()} | {:error, any()}
Gets all API keys for a project.
Parameters
client
- ADeepgram.Client
structproject_id
- The project ID
Examples
iex> client = Deepgram.new(api_key: "your-api-key")
iex> {:ok, keys} = Deepgram.Manage.get_keys(client, "project-id")
{:ok, %{api_keys: [%{key_id: "...", api_key: "...", ...}]}}
@spec get_members(Deepgram.Client.t(), String.t()) :: {:ok, Deepgram.Types.Manage.members_response()} | {:error, any()}
Gets all members of a project.
Parameters
client
- ADeepgram.Client
structproject_id
- The project ID
Examples
iex> client = Deepgram.new(api_key: "your-api-key")
iex> {:ok, members} = Deepgram.Manage.get_members(client, "project-id")
{:ok, %{members: [%{member_id: "...", email: "...", ...}]}}
@spec get_model(Deepgram.Client.t(), String.t(), String.t()) :: {:ok, Deepgram.Types.Manage.model_response()} | {:error, any()}
Gets a specific model by ID.
Parameters
client
- ADeepgram.Client
structproject_id
- The project IDmodel_id
- The model ID
Examples
iex> client = Deepgram.new(api_key: "your-api-key")
iex> {:ok, model} = Deepgram.Manage.get_model(client, "project-id", "model-id")
{:ok, %{name: "nova-2", canonical_name: "...", ...}}
@spec get_models(Deepgram.Client.t(), String.t()) :: {:ok, Deepgram.Types.Manage.models_response()} | {:error, any()}
Gets all available models for a project.
Parameters
client
- ADeepgram.Client
structproject_id
- The project ID
Examples
iex> client = Deepgram.new(api_key: "your-api-key")
iex> {:ok, models} = Deepgram.Manage.get_models(client, "project-id")
{:ok, %{stt: [...], tts: [...], read: [...]}}
@spec get_project(Deepgram.Client.t(), String.t()) :: {:ok, Deepgram.Types.Manage.project()} | {:error, any()}
Gets a specific project by ID.
Parameters
client
- ADeepgram.Client
structproject_id
- The project ID
Examples
iex> client = Deepgram.new(api_key: "your-api-key")
iex> {:ok, project} = Deepgram.Manage.get_project(client, "project-id")
{:ok, %{project_id: "...", name: "...", ...}}
@spec get_projects(Deepgram.Client.t()) :: {:ok, Deepgram.Types.Manage.projects_response()} | {:error, any()}
Gets all projects accessible by the API key.
Parameters
client
- ADeepgram.Client
struct
Examples
iex> client = Deepgram.new(api_key: "your-api-key")
iex> {:ok, projects} = Deepgram.Manage.get_projects(client)
{:ok, %{projects: [%{project_id: "...", name: "...", ...}]}}
@spec get_usage_requests(Deepgram.Client.t(), String.t()) :: {:ok, Deepgram.Types.Manage.usage_requests_response()} | {:error, any()}
Gets usage requests for a project.
Parameters
client
- ADeepgram.Client
structproject_id
- The project ID
Examples
iex> client = Deepgram.new(api_key: "your-api-key")
iex> {:ok, usage} = Deepgram.Manage.get_usage_requests(client, "project-id")
{:ok, %{page: 1, limit: 50, requests: [%{request_id: "...", ...}]}}
@spec get_usage_summary(Deepgram.Client.t(), String.t()) :: {:ok, Deepgram.Types.Manage.usage_response()} | {:error, any()}
Gets usage summary for a project.
Parameters
client
- ADeepgram.Client
structproject_id
- The project ID
Examples
iex> client = Deepgram.new(api_key: "your-api-key")
iex> {:ok, usage} = Deepgram.Manage.get_usage_summary(client, "project-id")
{:ok, %{start: "...", end: "...", usage: %{...}}}
@spec remove_member(Deepgram.Client.t(), String.t(), String.t()) :: {:ok, Deepgram.Types.Manage.message()} | {:error, any()}
Removes a member from a project.
Parameters
client
- ADeepgram.Client
structproject_id
- The project IDmember_id
- The member ID
Examples
iex> client = Deepgram.new(api_key: "your-api-key")
iex> {:ok, message} = Deepgram.Manage.remove_member(client, "project-id", "member-id")
{:ok, %{message: "Member removed successfully"}}