Skip to main content

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.

MonoRelay records every API request to a SQLite database, giving you a complete audit trail of relay traffic. Each entry captures timing, token usage, the full request and response content, and detailed error information when a call fails. Logs are viewable in real time through the Request Logs page in the admin dashboard, which uses Server-Sent Events to stream new entries as they arrive.

What gets logged

Each log entry stores the following fields:
FieldDescription
timestampUnix timestamp of when the request was received
modelModel name as resolved by MonoRelay’s routing engine
providerUpstream provider that handled the request
key_labelLabel of the API key used for the upstream call
client_ipIP address of the downstream client
user_agentUser-Agent header sent by the client
latency_msTotal round-trip time in milliseconds
first_token_msTime to first token for streaming requests
input_tokensPrompt token count
output_tokensCompletion token count
cache_hit_tokensNumber of tokens served from prompt cache
status_codeHTTP status code returned to the client
request_previewTruncated preview of the upstream request body
response_previewTruncated preview of the upstream response body
request_fullFull upstream request body (loaded on demand)
response_fullFull upstream response body (loaded on demand)
error_messageHuman-readable error description if the request failed
error_typeError category (e.g. rate limit, timeout, auth failure)
error_codeProvider error code
error_detailsRaw error payload from the upstream provider

Viewing logs in the dashboard

Open the Request Logs page from the sidebar. New requests appear at the top of the table in real time without needing a manual refresh. Click any row to expand it and view the full request and response content side by side. Error entries are automatically expanded so failures are immediately visible. The expanded view has two tabs — Relay shows the upstream request sent to the provider, and Client shows the downstream request received from your application. Each content block can be toggled between a readable conversational view and raw JSON. Admins see logs for all users; regular users see only their own requests.

Log retention

Entries older than max_age_days days are automatically deleted on startup. Set this to 0 to disable automatic cleanup and retain all logs indefinitely.

Logging configuration

Add a logging block to config.yml to control where logs are stored and how much content is captured:
config.yml
logging:
  enabled: true
  db_path: "./data/requests.db"
  max_age_days: 30
  content_preview_length: 200
OptionDefaultDescription
enabledtrueEnable or disable request logging entirely
db_path./data/requests.dbPath to the SQLite database file
max_age_days30Delete entries older than this many days; 0 keeps all
content_preview_length200Character limit for inline previews in the table view
Full request and response bodies are always stored regardless of content_preview_length. The preview length only affects the truncated summary shown in the table. Full content is fetched on demand when you expand a log entry.
Use the limit selector in the top-right of the logs page to choose how many recent entries to load (20, 50, 100, or 200). Admins can clear all logs for all users using the Clear logs button. The table is sorted by timestamp descending, with in-flight requests shown at the top while they are still processing.

Build docs developers (and LLMs) love