GET
/
api
/
token-usage
读取系统 token 用量
curl --request GET \
  --url https://wfapi.yuhe.space/api/token-usage \
  --header 'Authorization: Bearer <token>'
{
  "errCode": 123,
  "errMessage": "<string>",
  "data": {
    "systemTotal": {
      "inputTokens": 123,
      "outputTokens": 123,
      "totalTokens": 123,
      "reasoningTokens": 123,
      "cachedInputTokens": 123,
      "cacheCreationTokens": 123,
      "calls": 123,
      "updatedAt": "2023-11-07T05:31:56Z"
    },
    "workflows": [
      {
        "workflowName": "<string>",
        "total": {
          "inputTokens": 123,
          "outputTokens": 123,
          "totalTokens": 123,
          "reasoningTokens": 123,
          "cachedInputTokens": 123,
          "cacheCreationTokens": 123,
          "calls": 123,
          "updatedAt": "2023-11-07T05:31:56Z"
        },
        "updatedAt": "2023-11-07T05:31:56Z"
      }
    ],
    "hasMore": true,
    "total": 123,
    "nextCursor": "<string>"
  }
}

Authorizations

Authorization
string
header
required

使用 WORKFLOW_SERVER_ADMIN_KEY 或已创建的账号 API Key。

Query Parameters

pageSize
integer
Required range: 1 <= x <= 100
cursor
string

Response

系统总量和 workflow token 用量分页。

errCode
integer
required
errMessage
string
required
Allowed value: ""
data
object
required