Creating API Keys
API keys are associated with Deepgram Projects, which organize all of your Deepgram resources and consist of a set of users, a set of API keys, and billing and monitoring settings.
When you create an API key, you assign it a Role, which determines which actions it can be used to perform in the associated Project. Deepgram uses a tiered system of access control to provide granular access to its endpoints. To learn more about roles, see Working with Roles.
Create an API key using the Deepgram Console
Section titled “Create an API key using the Deepgram Console”You must create your first API key using the Deepgram Console. Thereafter, you can continue to add additional API keys using the Console, or you can create additional API Keys using the Deepgram API.
-
Log in to the Deepgram Console.
-
Locate the Projects drop down on the top-left, select the project to which you want to add an API Key.
-
Select Settings.
-
Select the API Keys view.
-
Select Create a New API Key.
-
Enter settings, and select Create Key:
Name Description Friendly Name (Comment) Name or comment to help you identify and differentiate between your keys. Permissions Role to assign to the API Key. The API Key may perform only the actions allowed by the permissions associated with this role. To learn more about roles, see Working with Roles. Expiration Expiration date to assign to the API Key. You can enter a specific date, select a duration of time to keep the key valid, or set the key to never expire. Tag Labels to associate with the API Key. Any requests sent using the key will also be tagged with the associated labels. Once set, tags cannot be changed. To learn more about managing multiple projects using tags, see Using Multiple Projects. -
Copy the key secret and save it somewhere safe, then select Got it. For security reasons, we won’t be able to show you the key again.
Create an API Key using the Deepgram API
Section titled “Create an API Key using the Deepgram API”Once you created your first API key using the Deepgram Console you can now use the API to create additional keys as needed.
Example Request
curl --request POST \
--url https://api.deepgram.com/v1/projects/your_project_id/keys \
--header 'Authorization: Token YOUR_TOKEN' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"comment": "a nice comment",
"scopes": [
"usage:read",
"usage:write",
"keys:write"
]
}
'Temporary API Key Limits
Section titled “Temporary API Key Limits”If you choose to create temporary API keys, please be aware that those are limited to 250 per day. If you need temporary API tokens for your application we recommend using Token-Based Authentication.
What’s Next