Every request proxied through MonoRelay is written to a local SQLite database with full token counts, latency metrics, and optional request/response body previews. The logs API lets you page through recent requests, retrieve a specific log entry with its full body, stream new entries in real time via SSE, filter by provider or model, and clear the log store when needed.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Excurs1ons/MonoRelay/llms.txt
Use this file to discover all available pages before exploring further.
Authentication
All log endpoints require a valid JWT token:Endpoints
GET /api/logs
Return a paginated list of recent log entries, newest first. Heavy fields (request_full, response_full) are stripped from the list view; fetch them individually via /api/logs/{id}.
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number (1-indexed) |
page_size | integer | 20 | Items per page |
limit | integer | 50 | Maximum total entries to load before pagination |
GET /api/logs/
Retrieve a single log entry by ID, including the full request and response bodies. Log IDs are integers. Pending (in-flight streaming) requests use negative temporary IDs until finalized.404 if the ID is not found in the database or in the in-memory pending store.
GET /api/logs/stream
An SSE (Server-Sent Events) endpoint that pushes new and updated log entries in real time. The dashboard uses this to display live request activity without polling.| Event type | When emitted |
|---|---|
log_new | A new request starts (immediately, before completion) |
log_update | A pending entry is updated (first token received, stream finalized) |
: heartbeat) is sent every 20 seconds to keep the connection alive through proxies.
Example SSE output:
GET /api/logs/filtered
Return logs filtered by provider, model, status, or date range. Applies in-memory filtering after loading a larger window of recent entries. Query parameters:| Parameter | Type | Description |
|---|---|---|
provider | string | Exact provider name match (e.g. anthropic) |
model | string | Case-insensitive substring match on model name |
status | string | "success" (status < 400) or "error" (status ≥ 400) |
date_from | string | ISO date string, e.g. 2026-05-01 |
date_to | string | ISO date string, e.g. 2026-05-17 |
limit | integer | Max entries to scan (default 100) |
page | integer | Page number |
page_size | integer | Items per page (default 20) |
POST /api/logs/clear
Delete all log entries from the database and clear any in-memory pending entries.Log record fields
Each log entry returned by the API contains these fields:Database row ID. Negative values indicate pending (in-flight) entries not yet written to disk.
Unix timestamp (float) of when the request was received.
The resolved model name as used for the upstream request.
The provider that handled the request.
Label of the API key used, as configured in
providers.<name>.keys[].label.HTTP status code returned by the upstream provider (e.g.
200, 429, 500).Total request latency in milliseconds from receipt to final byte.
Time to first token in milliseconds. Populated for streaming requests.
Number of prompt tokens consumed.
Number of completion tokens generated.
Estimated USD cost calculated from configured
cost_per_m_input / cost_per_m_output rates.Tokens served from the upstream prompt cache (Anthropic cache read).
Tokens written to the upstream prompt cache (Anthropic cache creation).
true if the request used streaming mode.Error description if the request failed, otherwise
null.Error category string, e.g.
"rate_limit_error", "proxy_error".Truncated preview of the request body (length controlled by
logging.content_preview_length). Stripped from list endpoints; available in detail view.Truncated preview of the response content. Updated in real time for streaming requests.
Full JSON request body. Only included in single-entry detail responses (
GET /api/logs/{id}).Full JSON response body. Only included in single-entry detail responses.
Originating client IP address, resolved from
x-real-ip, x-forwarded-for, or the direct connection.The
User-Agent header sent by the calling client.Logging configuration reference
Logging is configured inconfig.yml under the logging key:
| Field | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable or disable request logging entirely |
db_path | string | ./data/requests.db | Path to the SQLite database file |
max_age_days | integer | 30 | Automatically delete log entries older than this many days |
content_preview_length | integer | 200 | Maximum characters to store in request/response preview fields |