Yandex Cloud AI Studio API authentication

To use the Yandex Cloud AI Studio API, you need to get authenticated:

  1. Get an IAM token for your Yandex account, federated account, or local account.

  2. Get the ID of the folder for which your account has at least the minimum role for the functionality:

    • ai.languageModels.user or higher: For text generation models.
    • ai.imageGeneration.user or higher: For working with Alice AI ART.
    • ai.assistants.editor and ai.languageModels.user or higher: For Responses API.
    • ai.models.user or higher: For Realtime API.
    • serverless.mcpGateways.editor or higher: To manage MCP servers.
    • serverless.workflows.editor or higher: To manage Workflows workflows.

    You will need the folder ID to get the model's URI.

  3. When accessing AI Studio via the API, specify the IAM token in the Authorization header of each request:

    Authorization: Bearer <IAM_token>
    

To access AI Studio, your service account needs at least the minimum required role:

  • ai.languageModels.user or higher: For text generation models.
  • ai.imageGeneration.user or higher: For working with Alice AI ART.
  • ai.assistants.editor and ai.languageModels.user or higher: For Responses API.
  • ai.models.user or higher: For Realtime API.
  • serverless.mcpGateways.editor or higher: To manage MCP servers. The MCP Hub API supports only IAM token authentication.
  • serverless.workflows.editor or higher: To manage Workflows workflows. The Workflows API supports authentication with an API key only for Execution resource methods.

The AI Studio APIs support two service account authentication methods:

  • With an IAM token:

    1. Get an IAM token.

    2. Include the IAM token in the Authorization header in the following format:

      Authorization: Bearer <IAM_token>
      
  • With API keys:

    Use API keys if requesting an IAM token automatically is not an option.

    1. Get an API key.

    2. Include the API key in the Authorization header in the following format:

      Authorization: Api-Key <API_key>
      

You will need the service account parent folder ID to get the model's URI.