GET
/
api
/
workflows
/
{workflowName}
/
token-usage
读取 workflow token 用量
curl --request GET \
  --url https://wfapi.yuhe.space/api/workflows/{workflowName}/token-usage \
  --header 'Authorization: Bearer <token>'
{
  "errCode": 123,
  "errMessage": "<string>",
  "data": {
    "workflowName": "<string>",
    "workflowTotal": {
      "inputTokens": 123,
      "outputTokens": 123,
      "totalTokens": 123,
      "reasoningTokens": 123,
      "cachedInputTokens": 123,
      "cacheCreationTokens": 123,
      "calls": 123,
      "updatedAt": "2023-11-07T05:31:56Z"
    },
    "conversationId": "<string>",
    "conversationTotal": {
      "inputTokens": 123,
      "outputTokens": 123,
      "totalTokens": 123,
      "reasoningTokens": 123,
      "cachedInputTokens": 123,
      "cacheCreationTokens": 123,
      "calls": 123,
      "updatedAt": "2023-11-07T05:31:56Z"
    },
    "entries": [
      {
        "inputTokens": 123,
        "outputTokens": 123,
        "totalTokens": 123,
        "reasoningTokens": 123,
        "cachedInputTokens": 123,
        "cacheCreationTokens": 123,
        "calls": 123,
        "id": "<string>",
        "workflowName": "<string>",
        "runId": "<string>",
        "sequence": 123,
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z",
        "conversationId": "<string>",
        "nodeName": "<string>",
        "providerName": "<string>",
        "modelId": "<string>",
        "metadata": {}
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

workflowName
string
required

Query Parameters

conversationId
string

传入后同时返回该 conversation 聚合。

includeEntries
boolean

和 conversationId 一起使用,返回 tokenUsage.entry.* 明细。

Response

workflow token 用量详情。

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