DescribeMOTokenUsageDetail

更新时间:
复制 MD 格式

Queries the token usage records of RDS AI Assistant Ultimate Edition.

Operation description

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

rdsai:DescribeMOTokenUsageDetail

get

*All Resource

*

None None

Request syntax

GET  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

Region

string

No

The region in which the instance resides.

cn-beijing

InstanceId

string

Yes

The instance ID.

rds_copilot***_public_cn-*********6

ApiKey

string

No

The API key used for the request.

sk-rds-*****

UsageType

string

No

The type of usage to query.

text

ConsumerName

string

No

The consumer associated with the API key.

16******4_rds_copilot****_public_cn-4****02

Model

string

No

The model that was called.

qwen-flash

StartTime

string

No

The start time in ISO 8601 format (UTC).

2026-01-04T16:00:00Z

EndTime

string

No

The end time in ISO 8601 format (UTC).

2025-12-13T16:00:00Z

Cursor

string

No

The cursor-based pagination token. This parameter takes priority over Page. Leave this parameter empty for the first call. For subsequent calls, use the NextCursor value returned in the previous response.

eyJpZCI6MTIzNDUsInRzIjoiMjAyNi0wNC0wOFQwMDowMDowMFoifQ==

Page

integer

No

The page number. Minimum value: 1. Default value: 1.

2

PageSize

integer

No

The number of records per page.

10

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

Id of the request

FE9C65D7-930F-57A5-A207-8C396329241C

TotalCount

integer

The total number of records that match the query conditions.

20

NextCursor

string

The cursor for the next page. An empty value indicates the last page.

eyJpZCI6MTIzNDUsInRzIjoiMjAyNi0wNC0wOFQwMDowMDowMFoifQ==

PageSize

integer

The number of records per page.

10

Page

integer

The page number.

1

Records

array<object>

The list of records returned.

object

The token usage record.

Region

string

The region in which the instance resides.

cn-beijing

InstanceId

string

The instance ID.

rds_copilot***_public_cn-*********6

ConsumerName

string

The consumer associated with the API key.

16******4_rds_copilot****_public_cn-4****02

Model

string

The model that was called.

qwen-flash

TotalTokens

number

The total number of tokens.

100000

InputTokens

number

The number of input tokens consumed.

10000

OutputTokens

number

The number of output tokens consumed.

10000

RequestTime

string

The request time in ISO 8601 format (UTC).

2026-04-01T01:00:00Z

ExtraInfo

string

The additional information passed by the user in the extra_info field during the request. The value is a JSON string.

{"label": "test"}

UsageType

string

The usage type.

text

Examples

Success response

JSON format

{
  "RequestId": "FE9C65D7-930F-57A5-A207-8C396329241C",
  "TotalCount": 20,
  "NextCursor": "eyJpZCI6MTIzNDUsInRzIjoiMjAyNi0wNC0wOFQwMDowMDowMFoifQ==",
  "PageSize": 10,
  "Page": 1,
  "Records": [
    {
      "Region": "cn-beijing",
      "InstanceId": "rds_copilot***_public_cn-*********6",
      "ConsumerName": "16******4_rds_copilot****_public_cn-4****02",
      "Model": "qwen-flash",
      "TotalTokens": 100000,
      "InputTokens": 10000,
      "OutputTokens": 10000,
      "RequestTime": "2026-04-01T01:00:00Z",
      "ExtraInfo": "{\"label\": \"test\"}"
    }
  ],
  "UsageType": "text"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.