Getting an IAM token for a federated account
Note
The IAM token lifetime cannot exceed 12 hours and is limited by the cookie lifetime for the federation.
CLI
If you don't have the Nebius AI command line interface yet, install and initialize it.
-
Get an IAM token:
ncp iam create-token
Specify the received IAM token when accessing Nebius AI resources via the API. Pass the IAM token in the Authorization
header in the following format:
Authorization: Bearer <IAM token>
Examples
Using an IAM token obtained via the CLI
Save the IAM token to a variable in the CLI and use it in other requests from the command line. Sample request to get cloud list:
Bash
PowerShell
export IAM_TOKEN=`ncp iam create-token`
curl -H "Authorization: Bearer ${IAM_TOKEN}" \
https://resource-manager.api.ai.nebius.cloud/resource-manager/v1/clouds
$IAM_TOKEN=ncp iam create-token
curl.exe -H "Authorization: Bearer $IAM_TOKEN" https://resource-manager.api.ai.nebius.cloud/resource-manager/v1/clouds