a13nDocs

列出运行用量

一页运行用量;运行编号计入所属线程中的全部运行,包括没有用量记录的运行。

GET/api/v1/usage/runs

一页运行用量;运行编号计入所属线程中的全部运行,包括没有用量记录的运行。

认证与授权

认证与授权Bearer <token>

工作空间 API 密钥(a13n_...)

传递位置: header

查询参数

run_id?|null
thread_id?|null
session_id?|null
ingested_after?|null
ingested_before?|null
limit?Limit
范围1 <= value <= 100
默认值50
cursor?|null

请求头参数

X-Workspace-ID?|

登录会话作用的工作空间 ID,登录会话必须提供。API 密钥作用于自身工作空间,无需提供;禁止指定其他工作空间。

响应体

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/usage/runs"
{  "items": [    {      "models": [        {          "average_time_to_first_chunk_seconds": 0,          "cache_read_tokens": 0,          "cache_write_tokens": 0,          "cost": "string",          "input_tokens": 0,          "model": "string",          "output_tokens": 0,          "output_tokens_per_second": 0,          "requests": 0        }      ],      "run_id": "string",      "run_number": 1,      "thread_id": "string"    }  ],  "next_cursor": "string"}