Routescope APIRoutescope API

查询我的使用日志

🔑 需要令牌认证(TokenAuth)

分页返回当前令牌所属用户的调用日志,支持按时间、令牌名、模型名、分组和请求 ID 过滤。

GET
/api/token/self/log
curl -X GET "https://webapi.routescope.ai/api/token/self/log"
{
  "success": true,
  "message": "",
  "data": {
    "page": 1,
    "page_size": 10,
    "total": 2,
    "items": [
      {
        "id": 1,
        "user_id": 123,
        "created_at": 1710000000,
        "type": 2,
        "content": "chat completion",
        "username": "alice",
        "token_name": "default-token",
        "model_name": "gpt-4o",
        "quota": 0.024,
        "prompt_tokens": 1000,
        "completion_tokens": 2000,
        "use_time": 4,
        "is_stream": true,
        "token_id": 88,
        "group": "auto",
        "group_id": 0,
        "ip": "127.0.0.1",
        "request_id": "req_xxx",
        "other": "{\"finish_reason\":\"stop\"}"
      }
    ]
  }
}

Authorization

BearerAuth

AuthorizationBearer <token>

使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx

In: header

Query Parameters

p?integer

页码,从 1 开始;省略时默认 1

Range1 <= value
page_size?integer

每页条数;省略时使用服务端默认值(通常 10)

Range1 <= value
start_timestamp?integer

起始时间(Unix 秒级时间戳)

end_timestamp?integer

截止时间(Unix 秒级时间戳)

token_name?string

按令牌名过滤

model_name?string

按模型名过滤

group?string

按分组过滤

request_id?string

按请求 ID 精确匹配

Response Body

application/json

最后更新于