> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to set up the Nebius AI Cloud CLI

To start working with the Nebius AI Cloud CLI, configure a profile for the Nebius AI Cloud CLI by using one of the supported account types:

* [A user account](#how-to-set-up-the-cli-for-a-user-account) offers personalized access and accountability. It can be used when you, as a human user, need to manage and interact with resources.
* [A service account](#how-to-set-up-the-cli-for-a-service-account) automates the interaction of applications and services with resources.

## How to set up the CLI for a user account

To configure the CLI quickly, follow the non-interactive flow. To control the configuration process, follow the interactive flow.

<Tabs>
  <Tab title="Non-interactive flow">
    1. Create a name for the new profile in the Nebius AI Cloud CLI and save it to an environment variable:

       ```bash theme={null}
       export PROFILE_NAME=<new-profile-name>
       ```

    2. [Get the project ID](/iam/manage-projects#cli-3) and save it to an environment variable:

       ```bash theme={null}
       export PROJECT_ID=<project_ID>
       ```

    3. Create the CLI profile:

       ```bash theme={null}
       nebius profile create \
         --profile $PROFILE_NAME \
         --endpoint api.nebius.cloud \
         --federation-endpoint auth.nebius.com \
         --parent-id $PROJECT_ID
       ```

       If you have access to multiple tenants, you can specify the tenant that you want to use with this profile in the `--tenant-id` parameter.

       If you are added to someone else's [tenant](/iam/overview#tenants) and know the ID of its [federation](/iam/overview#federations), you can specify it either in the `--federation-id` parameter, or when logging in to the Nebius AI Cloud web console after running the command.

    4. On the browser tab that opens, log in to the web console if prompted. After logging in (or if you have already been logged in), you will see the following message:

       ```plaintext theme={null}
       Login is successful, you may close the browser tab and go to the console
       ```

    5. Close the browser tab and go back to your terminal window. You will see the following message:

       ```plaintext theme={null}
       Profile "<profile-name>" configured and activated
       ```

    6. Check that your new profile has been created and set as the default one:

       ```bash theme={null}
       nebius profile list
       ```

       You should see the following output:

       ```sh theme={null}
       default
       <profile-name> [default]
       ```
  </Tab>

  <Tab title="Interactive flow">
    1. [Get the project ID](/iam/manage-projects#cli-3).

    2. Create a CLI profile:

       ```sh theme={null}
       nebius profile create --parent-id <project_ID>
       ```

    3. Set up the new profile:

       1. Using arrow keys, select **Create a new profile** and press `Enter`.

       2. Specify the profile name and press `Enter`.

       3. Keep the default value for **Select api endpoint** (`api.nebius.cloud`) and press `Enter`.

       4. Under **Select authorization type**, keep `federation` and press `Enter`.

       5. Keep the default value for **Select federation endpoint** (`auth.nebius.com`) and press `Enter`.

       6. On the browser tab that opens, log into the Nebius AI Cloud web console if prompted. After logging in (or if you have already been logged in), you will see the following message:

          ```plaintext theme={null}
          Login is successful, you may close the browser tab and go to the console
          ```

       7. Close the browser tab and go back to your terminal window. If you have access to multiple tenants, the CLI will prompt you to choose a tenant ID. Choose the tenant that you want to use. If you only have access to one tenant, it is selected by default. You will see the following message:

          ```plaintext theme={null}
          Profile "<profile_name>" configured and activated
          ```

    4. Check that your new profile has been created and set as the default one:

       ```bash theme={null}
       nebius profile list
       ```

       You should see the following output:

       ```sh theme={null}
       default
       <profile-name> [default]
       ```
  </Tab>
</Tabs>

## How to set up the CLI for a service account

Before you begin, [create a service account](/iam/service-accounts/manage). You can do it with a user account or another service account within a [group](/iam/authorization/groups/index) that has the `admin` role within your tenant; for example, the default `admins` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.

To configure the CLI quickly, follow the non-interactive flow. To control the configuration process, follow the interactive flow.

<Tabs>
  <Tab title="Non-interactive flow">
    1. Open the service account page in the web console.

    2. Open your terminal.

    3. Save the service account details to environment variables:

       ```bash theme={null}
       export SA_ID=<service-account-id>
       export PUBLIC_KEY_ID=<...>
       export PRIVATE_KEY_PATH=<...>
       ```

    4. Create a name for your profile and save it to an environment variable:

       ```bash theme={null}
       export SA_PROFILE_NAME=<...>
       ```

       For example, `gpu-monitoring-sa`.

           <Warning>
             **Use one profile per project**

             Create a separate Nebius AI Cloud CLI profile for each project to ensure correct [region](/overview/regions)-specific configuration.
           </Warning>

    5. [Get the project ID](/iam/manage-projects#cli-3) and save it to an environment variable:

       ```bash theme={null}
       export PROJECT_ID=<project_ID>
       ```

    6. Create the CLI profile:

       ```bash theme={null}
       nebius profile create \
         --endpoint api.nebius.cloud \
         --service-account-id $SA_ID \
         --public-key-id $PUBLIC_KEY_ID \
         --private-key-file $PRIVATE_KEY_PATH \
         --profile $SA_PROFILE_NAME \
         --parent-id $PROJECT_ID
       ```

       You will see the following message:

       ```plaintext theme={null}
       Profile "<profile-name>" configured and activated
       ```

    7. Check that your new profile has been created and set as the default one:

       ```bash theme={null}
       nebius profile list
       ```

       You should see the following output:

       ```sh theme={null}
       default
       <profile-name> [default]
       ```
  </Tab>

  <Tab title="Interactive flow">
    1. Open the service account page in the web console.

    2. Open your terminal.

    3. Run the following command:

       ```sh theme={null}
       nebius profile create
       ```

    4. Use the arrow keys to select **Create a new profile**, then press `Enter`.

           <Warning>
             **Use one profile per project**

             Create a separate Nebius AI Cloud CLI profile for each project to ensure correct [region](/overview/regions)-specific configuration.
           </Warning>

    5. Add a profile name and press `Enter`.

    6. Keep the default value for **Select api endpoint** (api.nebius.cloud) and press `Enter`.

    7. Under **Select authorization type**, choose `service account` and press `Enter`.

    8. Under **Set service account ID**, paste the **Service account ID** from the web console.

    9. Under **Set public key ID**, paste the **Public key ID** from the web console.

    10. Under **Set path to PEM encoded private key**, specify the path to your private key in PEM format.

        You will see the following message:

        ```plaintext theme={null}
        Profile "<profile-name>" configured and activated
        ```

    11. Check that your new profile has been created and set as the default one:

        ```bash theme={null}
        nebius profile list
        ```

        You should see the following output:

        ```sh theme={null}
        default
        <profile-name> [default]
        ```

    12. [Get the project ID](/iam/manage-projects#cli-3) and add it to the CLI configuration.

        ```bash theme={null}
        nebius config set parent-id <project_ID>
        ```
  </Tab>
</Tabs>
