API Keys
Daytona API keys are used to authenticate requests to the Daytona API. Daytona provides an option to generate an API key for managing your API requests, list all generated API keys, and revoke an API key.
Generate an API Key
Daytona provides an option to generate API keys.
- Run the following command to generate an API key:
daytona api-key generate
Upon running this command, Daytona will prompt you to enter a name for the API key.
Name>
Upon successful generation of the API key, Daytona will display the following confirmation message:
You have successfully generated a new API Key and Server URL, which you can find below:
DAYTONA_API_KEY=your-api-keyDAYTONA_SERVER_URL=your-server-url
Daytona provides an option to connect to the Daytona Server instantly from a client machine by running the following command:
daytona profile add -a <your-server-url> -k <your-api-key>
List API Keys
Daytona provides an option to list all generated API keys.
- Run the following command to list all generated API keys:
daytona api-key list
Upon running this command, Daytona will display the list of all generated API keys.
Name Type──────────────────────────────────────────default client
Revoke an API Key
Daytona provides an option to revoke API keys.
- Run the following command to revoke an API key:
daytona api-key revoke
Upon running this command, Daytona will prompt you to enter the name of the API key that you want to revoke.
Select an API key to revoke1 item===MyAPIKeyclient
-
Press
Enter
on the selected API key to revoke it. -
Confirm the revocation by selecting
Yes
orNo
.
Revoke API Key 'test'?Are you sure you want to revoke 'test'?
[Yes] [No]
API key revoked