Getting started with SpeechKit
You can test speech recognition and synthesis on the SpeechKit demo page. For information on pricing, see SpeechKit pricing.
Getting started
To work with the SpeechKit API, you need to pass authentication. The authentication method depends on the account type:
- Get an IAM token for your Yandex account or federated account.
- Get the ID of the folder for which your account has the
ai.speechkit-stt.user
,ai.speechkit-tts.user
, or higher roles. -
When accessing SpeechKit via the API, provide the received parameters in each request:
-
For API v1 and API v2:
Specify the IAM token in the
Authorization
header in the following format:Authorization: Bearer <IAM token>
Specify the folder ID in the request body in the
folderId
parameter. -
For API v3:
- Specify the IAM token in the
Authorization
header. - Specify the folder ID in the
x-folder-id
header.
Authorization: Bearer <IAM_token> x-folder-id <folder_ID>
- Specify the IAM token in the
-
SpeechKit supports two authentication methods based on service accounts:
-
Using an IAM token:
-
Specify the obtained IAM token in the
Authorization
header in the following format:Authorization: Bearer <IAM token>
-
With API keys.
API keys do not expire. This means that this authentication method is simpler, but less secure. Use it if you can't automatically request an IAM token.
-
Specify the obtained API key in the
Authorization
header in the following format:Authorization: Api-Key <API key>
Do not specify the folder ID in your requests, as YandexGPT uses the folder in which the service account was created.
Speech recognition
Learn how to recognize short and long pre-recorded audio files in SpeechKit. The service also supports voice recognition in real time.
Speech synthesis
Learn how to convert text to audio using the SpeechKit API v1 and API v3. The API v3 provides more flexibility for speech synthesis setup. For more information about the differences between the API versions, see Synthesis options.