Routescope APIRoutescope API
RouteScope Self-Service

Get my usage logs

🔑 Requires token authentication (TokenAuth)

Returns the call logs of the user that owns the current token with pagination, supporting filters by time range, token name, model name, group and request 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>

Use Bearer Token for authentication. Format: Authorization: Bearer sk-xxxxxx

In: header

Query Parameters

p?integer

Page number, starting from 1. Defaults to 1 when omitted.

Range1 <= value
page_size?integer

Page size. Uses the server default (usually 10) when omitted.

Range1 <= value
start_timestamp?integer

Start time (Unix timestamp in seconds)

end_timestamp?integer

End time (Unix timestamp in seconds)

token_name?string

Filter by token name

model_name?string

Filter by model name

group?string

Filter by group

request_id?string

Filter by exact request ID

Response Body

application/json

How is this guide?

Last updated on