Skip to content
Request
Response

Log

API call log management.

Endpoints

GET https://ai-tokenhub.com/v1/admin/logs
GET https://ai-tokenhub.com/v1/admin/logs/{id}

Query Parameters

ParameterTypeDescription
start_timestringStart time (ISO 8601)
end_timestringEnd time (ISO 8601)
api_key_idstringAPI Key ID
modelstringModel name
statusstringStatus (success/error)
pageintegerPage number
page_sizeintegerItems per page (max 100)

Get Logs

bash
curl "https://ai-tokenhub.com/v1/admin/logs?page=1&page_size=50" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

json
{
  "object": "list",
  "data": [
    {
      "id": "log_xxx",
      "api_key_id": "key_xxx",
      "model": "gpt-4o",
      "request_tokens": 100,
      "response_tokens": 50,
      "status": "success",
      "latency": 1200,
      "created_at": "2024-01-01T12:00:00Z"
    }
  ]
}

Fields

FieldTypeDescription
idstringLog ID
api_key_idstringAPI Key ID
modelstringModel called
request_tokensintegerRequest tokens
statusstringCall status
latencyintegerLatency (ms)