Skip to main content
Static keys provide a method of authentication in Nebius AI Cloud services from third-party tools and systems.

Prerequisites

  1. Install and configure the Nebius AI Cloud CLI.
  2. To list expiring keys, install jq to filter and sort the JSON data returned by the Nebius AI Cloud CLI:

Creating a static key

Run the following command:
In this command, change the following parameters:
  • --account-service-account-id: ID of the service account for which the static key is created.
  • --service: Service for which you create the static key. The following values are possible:
  • --expires-at (optional): Date of expiration in ISO 8601 format. The default lifetime of a static key is 6 months.
Output example:
Save the token from the token parameter of the output. You will not be able to access it later.
You can also get the ID of the static key from the resource_id parameter. The ID can be helpful later if you need to get the information about the static key or revoke it.

Listing static keys

To get all static keys in your tenant, run the following command:
To get the details about a static key, run the following command:

Listing expiring keys

After a static key expires, you can’t use it for authentication. To find the keys that you need to replace soon, list the keys that expire within the next seven days, across all service accounts in your project.
List the expiring keys, sorted by expiration date:
For each key, the output contains the following fields:
  • id: ID of the key.
  • service_account_id: ID of the service account that the key belongs to.
  • expires_at: Date and time when the key expires.
To adjust the command:
  • To change the period, replace 7 in 7 * 86400 with another number of days.
  • To list keys in a project other than the one saved in your CLI profile, add --parent-id <project_ID> to the command.
The list doesn’t include keys that have already expired or keys without an expiration date. If the list is empty, no keys expire within the next seven days. To replace an expiring key, create a new static key.

Revoking a static key

You can revoke a static key by using the following command:
If you only know the token value, run the following command to revoke the token: