/
SaaS
/
Understanding SaaS Usage

Usage

Overview

This section describes how to make requests to Speechmatics SaaS to understand your usage of the service. Usage is reported as the number of jobs successfully processed in a time period, along with the total duration of the corresponding audio files.

As for other requests to Speechmatics SaaS, usage is queried using an Authorization Token. Usage is returned for the account associated with the Authorization Token. When using the examples below, you should replace the Authorization Token shown with your own.

All usage is reported on a Coordinated Universal Time (UTC) calendar day basis. Note that usage for the current day (in UTC) is not included in the results.

Note that deleting a completed job will have no effect on reported usage.

Requesting Usage

The following request retrieves usage for all jobs from the beginning of 15 September 2020 until the end of 31 December 2020. More precisely, this includes all jobs completed successfully at or after 2020-09-15T00:00Z and before 2021-01-01T00:00Z.

The since and until parameters are both optional:

  • If since is omitted, then usage is reported from the day on which the first job was successfully processed for the account.
  • If until is omitted, then usage is reported until the end of the previous UTC day.

Linux example

curl -L -X GET "https://asr.api.speechmatics.com/v2/usage?since=2020-09-15&until=2020-12-31" -H "Authorization: Bearer NDFjOTE3NGEtOWVm" | jq

Windows example

curl.exe -L -X GET "https://asr.api.speechmatics.com/v2/usage?since=2020-09-15&until=2020-12-31" -H "Authorization: Bearer NDFjOTE3NGEtOWVm" | jq

The response

The response is a JSON object containing usage information. See API Reference for full details.

The response JSON contains since and until properties which should be interpreted in the same way as the since and until query parameters. In general, the since value is returned as the first day in the specified time period on which a job was successfully processed. If the since query parameter is not provided and there is no usage during the specified time period, then the since value is returned as 1970-01-01.

The response also contains summary and details properties. The summary value lists the total usage for each SaaS mode and job type. Currently, mode will always be batch and type will be one of transcription or alignment. The details value lists a more granular breakdown of usage by mode, job type, language and operating point. Each object in summary and details contains count and duration_hrs fields which report the total number of successfully completed jobs and the total audio duration (in hours) of these jobs. If there is no usage in the specified time period, then the summary and details values will be null.

Here is an example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  'since': '2020-09-15',
  'until': '2020-12-31',
  'summary': [
    {
      'mode': 'batch',
      'type': 'transcription',
      'count': 55386,
      'duration_hrs': 8432.16
    },
    {
      'mode': 'batch',
      'type': 'alignment',
      'count': 489,
      'duration_hrs': 70.53
    }
  ],
  'details':[
    {
      'mode': 'batch',
      'type': 'transcription',
      'language': 'sv',
      'operating_point': 'standard',
      'count': 27830,
      'duration_hrs': 5204.55
    },
    {
      'mode': 'batch',
      'type': 'transcription',
      'language': 'de',
      'operating_point': 'enhanced',
      'count': 27556,
      'duration_hrs': 3227.61
    },
    {
      'mode': 'batch',
      'type': 'alignment',
      'language': 'en',
      'count': 489,
      'duration_hrs': 70.53
    }
  ]
}