Logging

Get log statistics

Returns statistics for logs matching the specified filters.

GET
/api/logs/stats
AuthorizationBearer <token>

Bearer token authentication. Use your MPilot virtual-key JWT or admin JWT. Virtual keys (prefixed with sk-bf-) can also be passed here.

In: header

Query Parameters

providers?string

Comma-separated list of providers to filter by

models?string

Comma-separated list of models to filter by

status?string

Comma-separated list of statuses to filter by

objects?string

Comma-separated list of object types to filter by

selected_key_ids?string

Comma-separated list of selected key IDs to filter by

virtual_key_ids?string

Comma-separated list of virtual key IDs to filter by

routing_rule_ids?string

Comma-separated list of routing rule IDs to filter by

routing_engine_used?string

Comma-separated list of routing engines to filter by (routing-rule, governance, or loadbalancing)

start_time?string

Start time filter (RFC3339 format)

Formatdate-time
end_time?string

End time filter (RFC3339 format)

Formatdate-time
min_latency?number

Minimum latency filter

max_latency?number

Maximum latency filter

min_tokens?integer

Minimum tokens filter

max_tokens?integer

Maximum tokens filter

min_cost?number

Minimum cost filter

max_cost?number

Maximum cost filter

missing_cost_only?boolean

Only show logs with missing cost

content_search?string

Search in request/response content

Response Body

curl -X GET "https://loading/{AI_GATEWAY_URL}/api/logs/stats?providers=string&models=string&status=string&objects=string&selected_key_ids=string&virtual_key_ids=string&routing_rule_ids=string&routing_engine_used=string&start_time=2019-08-24T14%3A15%3A22Z&end_time=2019-08-24T14%3A15%3A22Z&min_latency=0&max_latency=0&min_tokens=0&max_tokens=0&min_cost=0&max_cost=0&missing_cost_only=true&content_search=string"
{
  "total_requests": 0,
  "total_tokens": 0,
  "total_cost": 0,
  "average_latency": 0,
  "success_rate": 0
}
{
  "event_id": "string",
  "type": "string",
  "is_bifrost_error": true,
  "status_code": 0,
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "event_id": "string"
  },
  "extra_fields": {
    "provider": "openai",
    "model_requested": "string",
    "request_type": "string"
  }
}
{
  "event_id": "string",
  "type": "string",
  "is_bifrost_error": true,
  "status_code": 0,
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "event_id": "string"
  },
  "extra_fields": {
    "provider": "openai",
    "model_requested": "string",
    "request_type": "string"
  }
}
On this page

On this page

No Headings