Accounts - List Usages

Get usages for the requested Cognitive Services account

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages?api-version=2023-05-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages?api-version=2023-05-01&$filter={$filter}

URI Parameters

Name In Required Type Description
accountName
path True

string

The name of Cognitive Services account.

Regex pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$

resourceGroupName
path True

string

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string

The ID of the target subscription.

api-version
query True

string

The API version to use for this operation.

$filter
query

string

An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names).

Responses

Name Type Description
200 OK

UsageListResult

The usages for Cognitive Services account were retrieved successfully.

Other Status Codes

ErrorResponse

Error response describing why the operation failed. If the resource does not exist, 404 (NotFound) will be returned.

Examples

Get Usages

Sample Request

GET https://management.azure.com/subscriptions/5a4f5c2e-6983-4ccb-bd34-2196d5b5bbd3/resourceGroups/myResourceGroup/providers/Microsoft.CognitiveServices/accounts/TestUsage02/usages?api-version=2023-05-01

Sample Response

{
  "value": [
    {
      "name": {
        "value": "Face.Transactions",
        "localizedValue": "Face.Transactions"
      },
      "status": "Included",
      "currentValue": 3,
      "limit": 30000,
      "nextResetTime": "2018-03-28T09:33:51Z",
      "quotaPeriod": "30.00:00:00",
      "unit": "Count"
    }
  ]
}

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

MetricName

A metric name.

QuotaUsageStatus

Cognitive Services account quota usage status.

UnitType

The unit of the metric.

Usage

The usage data for a usage request.

UsageListResult

The response to a list usage request.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

MetricName

A metric name.

Name Type Description
localizedValue

string

The friendly name of the metric.

value

string

The name of the metric.

QuotaUsageStatus

Cognitive Services account quota usage status.

Name Type Description
Blocked

string

InOverage

string

Included

string

Unknown

string

UnitType

The unit of the metric.

Name Type Description
Bytes

string

BytesPerSecond

string

Count

string

CountPerSecond

string

Milliseconds

string

Percent

string

Seconds

string

Usage

The usage data for a usage request.

Name Type Description
currentValue

number

Current value for this metric.

limit

number

Maximum value for this metric.

name

MetricName

The name information for the metric.

nextResetTime

string

Next reset time for current quota.

quotaPeriod

string

The quota period used to summarize the usage values.

status

QuotaUsageStatus

Cognitive Services account quota usage status.

unit

UnitType

The unit of the metric.

UsageListResult

The response to a list usage request.

Name Type Description
nextLink

string

The link used to get the next page of Usages.

value

Usage[]

The list of usages for Cognitive Service account.