Mengambil penggunaan token AI kumulatif untuk sesi tertentu.
Deskripsi operasi
Description
This operation retrieves usage statistics for AI tokens in a specified session. It provides a breakdown of tokens for prompts, completions, and thoughts, as well as the total token count and the number of cache-hit tokens.
Coba sekarang
Test
RAM authorization
Sintaks permintaan
POST HTTP/1.1
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| Jsonrpc |
string |
No |
Versi JSON-RPC. Nilainya selalu 2.0. |
2.0 |
| Id |
string |
No |
ID yang diberikan oleh peminta, yang akan dikembalikan di tanggapan. |
1033814166 |
| Params |
object |
No |
Parameter bisnis. |
|
| SessionId |
string |
No |
The session ID. Required. |
sess_0f12abc34 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The ID of the request. |
B313938A-4475-599B-98EB-A0875019FD5B |
| JsonRpcResponse |
object |
The JSON-RPC result. |
|
| Jsonrpc |
string |
The JSON-RPC version. The value is always 2.0. |
2.0 |
| Id |
string |
The ID provided by the requester, which is echoed in the response. |
8212598228302533855 |
| Result |
object |
Token usage result. |
|
| PromptTokens |
integer |
1000 |
|
| CompletionTokens |
integer |
2000 |
|
| ThoughtsTokens |
integer |
3000 |
|
| TotalTokens |
integer |
2000 |
|
| CachedTokens |
integer |
4000 |
Contoh
Respons sukses
JSONformat
{
"RequestId": "B313938A-4475-599B-98EB-A0875019FD5B",
"JsonRpcResponse": {
"Jsonrpc": "2.0",
"Id": "8212598228302533855",
"Result": {
"PromptTokens": 1000,
"CompletionTokens": 2000,
"ThoughtsTokens": 3000,
"TotalTokens": 2000,
"CachedTokens": 4000
}
}
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.