Skip to main content
GET
/
api
/
logs
Search and filter logs
curl --request GET \
  --url http://localhost:8080/api/logs
{
  "logs": [
    {
      "id": "<string>",
      "parent_request_id": "<string>",
      "timestamp": "2023-11-07T05:31:56Z",
      "object": "<string>",
      "provider": "<string>",
      "model": "<string>",
      "latency": 123,
      "cost": 123,
      "status": "<string>",
      "stream": true,
      "raw_response": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "input_history": [
        {
          "role": "user",
          "content": "Hello, how are you?",
          "tool_call_id": "<string>",
          "tool_calls": [
            {
              "id": "tool_123",
              "type": "function",
              "function": {
                "name": "get_weather",
                "arguments": "{\"location\": \"San Francisco, CA\"}"
              }
            }
          ],
          "refusal": "<string>",
          "annotations": [
            {
              "type": "<string>",
              "url_citation": {
                "start_index": 123,
                "end_index": 123,
                "title": "<string>",
                "url": "<string>",
                "sources": "<any>",
                "type": "<string>"
              }
            }
          ],
          "thought": "<string>"
        }
      ],
      "output_message": {
        "role": "user",
        "content": "Hello, how are you?",
        "tool_call_id": "<string>",
        "tool_calls": [
          {
            "id": "tool_123",
            "type": "function",
            "function": {
              "name": "get_weather",
              "arguments": "{\"location\": \"San Francisco, CA\"}"
            }
          }
        ],
        "refusal": "<string>",
        "annotations": [
          {
            "type": "<string>",
            "url_citation": {
              "start_index": 123,
              "end_index": 123,
              "title": "<string>",
              "url": "<string>",
              "sources": "<any>",
              "type": "<string>"
            }
          }
        ],
        "thought": "<string>"
      },
      "responses_output": [
        {
          "role": "user",
          "content": "<string>"
        }
      ],
      "embedding_output": [
        {
          "index": 123,
          "object": "embedding",
          "embedding": "<string>"
        }
      ],
      "params": {},
      "tools": [
        {
          "type": "function",
          "function": {
            "description": "<string>",
            "name": "<string>",
            "parameters": {}
          }
        }
      ],
      "tool_calls": [
        {
          "type": "function",
          "id": "<string>",
          "function": {
            "name": "<string>",
            "arguments": "<string>"
          }
        }
      ],
      "token_usage": {
        "prompt_tokens": 123,
        "completion_tokens": 123,
        "total_tokens": 123
      },
      "error_details": {
        "event_id": "evt_123",
        "type": "invalid_request_error",
        "is_bifrost_error": true,
        "status_code": 400,
        "error": {
          "type": "invalid_request_error",
          "code": "missing_required_parameter",
          "message": "Provider is required",
          "param": "<any>",
          "event_id": "evt_123"
        }
      },
      "speech_input": {
        "input": "<string>"
      },
      "transcription_input": {
        "file": "aSDinaTvuI8gbWludGxpZnk="
      },
      "speech_output": {
        "audio": "aSDinaTvuI8gbWludGxpZnk=",
        "usage": {
          "input_tokens": 123,
          "output_tokens": 123,
          "total_tokens": 123
        }
      },
      "transcription_output": {
        "duration": 123,
        "language": "<string>",
        "text": "<string>",
        "words": [
          {
            "word": "<string>",
            "start": 123,
            "end": 123
          }
        ],
        "segments": [
          {
            "id": 123,
            "seek": 123,
            "start": 123,
            "end": 123,
            "text": "<string>",
            "tokens": [
              123
            ],
            "temperature": 123,
            "avg_logprob": 123,
            "compression_ratio": 123,
            "no_speech_prob": 123
          }
        ]
      },
      "cache_debug": {
        "cache_hit": true,
        "cache_id": "<string>",
        "hit_type": "<string>",
        "provider_used": "<string>",
        "model_used": "<string>",
        "input_tokens": 123,
        "threshold": 123,
        "similarity": 123
      }
    }
  ],
  "pagination": {
    "limit": 123,
    "offset": 123,
    "sort_by": "<string>",
    "order": "<string>"
  },
  "stats": {
    "total_requests": 123,
    "success_rate": 123,
    "average_latency": 123,
    "total_tokens": 123,
    "total_cost": 123
  }
}

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 objects to filter by

start_time
string<date-time>

Start time for the time range filter (RFC3339 format)

end_time
string<date-time>

End time for the time range filter (RFC3339 format)

min_latency
number
max_latency
number
min_tokens
integer
max_tokens
integer
min_cost
number
max_cost
number

Full-text search in request/response bodies

limit
integer
default:50

Number of logs to return

Required range: x <= 1000
offset
integer
default:0

Number of logs to skip

sort_by
enum<string>
default:timestamp

Field to sort by

Available options:
timestamp,
latency,
tokens,
cost
order
enum<string>
default:desc

Sort order

Available options:
asc,
desc

Response

200 - application/json

A paginated list of logs matching the criteria.

logs
object[]
pagination
object
stats
object