Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex AI Studio
    • About Yandex AI Studio
    • Yandex Workflows
    • Quotas and limits
    • Terms and definitions
  • Compatibility with OpenAI
    • About Yandex Cloud ML SDK
      • Overview
      • Authentication
      • Request retries
  • Access management
  • Pricing policy
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Authentication methods classes
  • class yandex_cloud_ml_sdk.auth.APIKeyAuth
  • class yandex_cloud_ml_sdk.auth.EnvIAMTokenAuth
  • class yandex_cloud_ml_sdk.auth.IAMTokenAuth
  • class yandex_cloud_ml_sdk.auth.MetadataAuth
  • class yandex_cloud_ml_sdk.auth.NoAuth
  • class yandex_cloud_ml_sdk.auth.OAuthTokenAuth
  • class yandex_cloud_ml_sdk.auth.YandexCloudCLIAuth
  1. Yandex Cloud ML SDK
  2. SDK reference
  3. Authentication

Authentication

Written by
Yandex Cloud
Updated at August 22, 2025
  • Authentication methods classes
    • class yandex_cloud_ml_sdk.auth.APIKeyAuth
    • class yandex_cloud_ml_sdk.auth.EnvIAMTokenAuth
    • class yandex_cloud_ml_sdk.auth.IAMTokenAuth
    • class yandex_cloud_ml_sdk.auth.MetadataAuth
    • class yandex_cloud_ml_sdk.auth.NoAuth
    • class yandex_cloud_ml_sdk.auth.OAuthTokenAuth
    • class yandex_cloud_ml_sdk.auth.YandexCloudCLIAuth

Here must be algorithm about how auto-authorization works

And here – how SDK will work if you pass a string to SDK auth param

Authentication methods classesAuthentication methods classes

class yandexcloudmlsdk.auth.APIKeyAuthclass yandex_cloud_ml_sdk.auth.APIKeyAuth

Authentication method using an API key.

Read more about the API key in the IAM documentation.

class yandexcloudmlsdk.auth.EnvIAMTokenAuthclass yandex_cloud_ml_sdk.auth.EnvIAMTokenAuth

Auth method, which takes IAM token from environment variable for every request.

It is assumed that the token will be refreshed in the environment before it expires.

However, by default, the YC_TOKEN environment variable is used when auto-selecting the auth method, in order to be compatible with a Yandex DataSphere environment. Therefore, it is not recommended to use this environment variable when setting up a personal work environment.

class yandexcloudmlsdk.auth.IAMTokenAuthclass yandex_cloud_ml_sdk.auth.IAMTokenAuth

Authentication method using an IAM token.

Read more about the IAM token in the AIM documentation.

class yandexcloudmlsdk.auth.MetadataAuthclass yandex_cloud_ml_sdk.auth.MetadataAuth

Authentication class for retrieving IAM tokens from metadata service.

This class retrieves IAM tokens from the Google Cloud metadata service. Read more in the VM metadata documentation.

class yandexcloudmlsdk.auth.NoAuthclass yandex_cloud_ml_sdk.auth.NoAuth

class yandexcloudmlsdk.auth.OAuthTokenAuthclass yandex_cloud_ml_sdk.auth.OAuthTokenAuth

Auth method that uses an OAuth token for authentication.

This class extends the RefresheableIAMTokenAuth to provide functionality for managing and using an OAuth token for authentication purposes.

Read more about the OAuth token in the corresponding documentation.

class yandexcloudmlsdk.auth.YandexCloudCLIAuthclass yandex_cloud_ml_sdk.auth.YandexCloudCLIAuth

Authentication class for Yandex Cloud CLI using IAM tokens.

It handles the initialization and retrieval of IAM tokens via the Yandex Cloud CLI that should be installed and configured.

Yandex Cloud CLI is a downloadable software for managing cloud resources via the command line. Read more in the CLI documentation.

Was the article helpful?

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