Creates a new key in the specified project

You must create your first API Key using the Deepgram Console. After you have your first API key, you can use that to create more keys for a specified project. Refer to the documentation Creating API Keys for more details.

Deepgram API Keys

📘

At a minimum to create a new Deepgram API key you will be required the set the scope:keys:write. Refer to the documentation Working with Roles & API Scopes for more details.

Deepgram API Keys can be created with different levels of roles and scopes as needed. To create a Deepgram API Key you can use the following example and set any additional roles and scopes.

🚧

Replace YOUR_DEEPGRAM_API_KEY with your Deepgram API Key.

curl --request POST \
     --url https://api.deepgram.com/v1/projects/{project_id}/keys \
     --header 'Authorization: Token ' YOUR_DEEPGRAM_API_KEY \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "comment": " A comment",
  "tags": ["A Tag"],
  "scopes": [
    "usage:write",
    "keys:write"
    .. additional scopes
  ]
}
'

A successful response:

{
  "api_key_id": "xxxxxx",
  "key": "xxxxxx",
  "comment": "A Comment",
  "scopes": [
    "keys:write",
    "keys:read",
    "usage:write"
  ],
  "tags": [
    "A Tag"
  ],
  "created": "2024-05-21T17:19:49.373761Z"
}TBD

Deepgram On-prem API Keys

📘

At a minimum to create a new On-prem API key you will be required to set the scopes: onprem:product:api and onprem:product:engine. Refer to the documentation On-Prem Product Scopes for more details.

On-prem API keys can also be created by including the desired role in the same scopes list as the On-prem product scopes when submitting the key creation request.

To create an On-prem API Key, you can use the following example which includes the default on-prem product scopes for a given project.

🚧

Replace YOUR_DEEPGRAM_API_KEY with your Deepgram API Key.

curl --request POST \
     --url https://api.deepgram.com/v1/projects/3f2504e0-4f89-11d3-9a0c-0305e82c3301/keys \
     --header 'Authorization: YOUR_DEEPGRAM_API_KEY ' \
     --header 'Content-Type: application/json' \
     --header 'accept: application/json' \
     --data '
{
  "comment": "My on-prem API key",
  "scopes": [
    "member",
    "onprem:products"
  ]
}
'

A successful response:

{
  "api_key_id": "xxxxxx",
  "key": "xxxxxxx",
  "comment": "My on-prem API key",
  "scopes": [
    "member",
    "onprem:product:api",
    "onprem:product:engine"
  ],
  "created": "2023-06-29T00:33:46.443412Z"
}
Language
Authorization
Header