Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Foundation Models
    • Overview
    • API authentication
  • Yandex Cloud ML SDK
  • Compatibility with OpenAI
  • Access management
  • Pricing policy
  • Public materials
  • Release notes
  1. API references
  2. API authentication

Authentication with the Yandex Foundation Models API

Written by
Yandex Cloud
Updated at March 28, 2025

To use the Yandex Foundation Models API, you need to get authenticated:

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

  2. Get the ID of the folder for which your account has the minimum required role to work with the model:

    • ai.languageModels.user or higher: For text generation models.
    • ai.imageGeneration.user or higher: For YandexART.
    • ai.assistants.editor and ai.languageModels.user or higher: For AI Assistant API.

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

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

    Authorization: Bearer <IAM_token>
    

To access Foundation Models, 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 YandexART.
  • ai.assistants.editor and ai.languageModels.user or higher: For AI Assistant API.

The Foundation Models API supports two methods of authentication with a service account:

  • With an IAM token:

    1. Get an IAM token.

    2. Provide 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. Provide the API key in the Authorization header in the following format:

      Authorization: Api-Key <API_key>
      

Do not specify the folder ID in your request headers, as the service uses the folder the service account was created in. However, you will need the parent folder ID to get the model's URI.

Was the article helpful?

Previous
Overview
Next
Overview
© 2025 Direct Cursus Technology L.L.C.