Request headers for troubleshooting in Yandex SpeechKit

If you get an error sending requests to the API and need help, use these guidelines or contact support.

The support team will solve your issue faster if you use advanced HTTP request and response headers.

Request headers

Use the following headers when making HTTP requests:

  • x-client-request-id is a unique request ID. We recommend using a UUID. Send this ID to the technical support team to help us find a specific request in the system and assist you.

    You can generate a UUID either online or through the library for the programming language you use.

  • x-data-logging-enabled: Flag that enables saving user-provided data from the request.

    By default, the service does not store data you send via the API. Your data will be stored if you provide true in this header. Along with the request ID, this will help technical support solve your problem.

Examples

For example, the following headers will help you find your request and use the provided audio to refine your recognition model.

export FOLDER_ID=<folder_ID>
        export IAM_TOKEN=<IAM_token>
        
        curl \
          --verbose \
          --insecure \
          --header "x-client-request-id: fa18fa9b-176d-4ae0-92b8-bd78********" \
          --header "x-data-logging-enabled: true" \
          --header "authorization: Bearer ${IAM_TOKEN}" \
          --header "x-folder-id: ${FOLDER_ID}" \
          --data @request.json https://stt.api.cloud.yandex.net:443/stt/v3/recognizeFileAsync
        

Where:

  • FOLDER_ID: ID of the folder for which your account has the editor role or higher.
  • IAM_TOKEN: IAM token used for authentication.
  • request.json: File with the recognition request body.

Tip

Use the -v or --verbose flag to output the full command execution log to the terminal.

Response headers

Each server response contains headers that provide even more information about the request execution:

  • x-request-id: Unique response ID
  • x-server-trace-id: Unique request execution log ID

To get the x-request-id and x-server-trace-id values, your application must log server response headers.

You can find an example of implementing access to gRPC headers in the grpc-go documentation.