The Deepgram.keys object provides access to manage keys associated with your projects. Every function provided will required a PROJECT_ID that your current has access to manage.

List Project API Keys

You can retrieve all keys for a given project using the keys.list function.

List Project API Keys Parameters

ParameterTypeDescription
project_idStringA unique identifier for the project the API key will be created for

List Project Keys Example Request

const response = await deepgram.keys.list(PROJECT_ID);

List Project Keys Response

{
	api_keys: [
		{
			api_key_id: string,
			comment: string,
			created: string,
			scopes: Array<string>,
		},
	];
}

Create API Key

Create a new API key for a project using the keys.create function with a name for the key.

Create API Key Parameters

ParameterTypeDescription
project_idStringA unique identifier for the project the API key will be created for
comment_for_keyStringA comment to denote what the API key is for

Create API Key Example Request

const response = await deepgram.keys.create(PROJECT_ID, COMMENT_FOR_KEY);

Create API Key Response

{
  api_key_id: string,
  key: string,
  comment: string,
  created: string,
  scopes: string[]
}

Delete API Key

Delete an existing API key using the keys.delete method with project id and key id to delete.

Delete API Key Parameters

ParameterTypeDescription
project_idStringA unique identifier for the project the API key will be delete from
key_idStringA unique identifier for the API key to delete

Delete API Key Example Request

await deepgram.keys.delete(PROJECT_ID, KEY_ID);

Delete API Key Response

The keys.delete function returns a void.