Authentication with the Translate API

The Translate API interface requires you to provide your authentication credentials in each request. The authentication method depends on the type of account you use to send requests:

  1. Get an IAM token for your Yandex account, federated account, or local account. Make sure to provide the folder ID in the folderId field in the body of each request.

    Provide the token in the Authorization header of each request in the following format:

    Authorization: Bearer <IAM_token>
            
  2. Get the ID of any folder for which your account has the ai.translate.user role or higher. Make sure to provide the folder ID in the folderId field in the body of each request.

  1. Choose one of the authentication methods:

    • Get an IAM token. Provide the IAM token in the Authorization header in the following format:

      Authorization: Bearer <IAM_token>
              
    • Create an API key. Provide the API key in the Authorization header in the following format:

      Authorization: Api-Key <API_key>
              
  2. Assign the service account the ai.translate.user role or higher for the folder where it was created.

    Do not specify the folder ID in your requests, as Translate uses the folder where the service account was created.

See also

Previous