Skip to main content

Logs page

The Logs page is where you look up individual requests. It lists every request the gateway served in a time window, opens any of them in a detail drawer with the request, the response, cost, routing and guardrail results, and groups the calls of one session together. It also holds the audit log of management changes and the lists of deleted keys and teams. Open it at /ui/logs. In the left nav it is Logs in the OBSERVABILITY group.

The nav item has no role list, so every signed in role sees it. When the admin has set enabled_ui_pages_internal_users, non-admin roles see it only if logs is listed. The page shows a spinner until the session has a token, a role and a user id. The gateway decides which requests each caller may read. Admins and admin viewers read every request. Every other caller, org admins and keys with extra routes included, is limited to the requests they own or may read through their teams, and a key with no user reads none. No license feature is needed for request logs. The Audit Logs tab needs Spanway Enterprise.

TabWho sees it
Request LogsEveryone (selected by default)
Audit LogsThe session roles Admin and Admin Viewer
Export LedgerThe session roles Admin and Admin Viewer, with Spanway Enterprise
Deleted KeysEveryone
Deleted TeamsThe session roles Admin and Admin Viewer, and anyone who is an org admin of at least one organization

A real-world scenario​

A developer reports that their script got a 429 at 10:42. The on-call admin opens Logs, sets the time range to Last Hour, opens Filters, picks Status = Failure and Error Code = 429, and clicks Apply Filters. One row matches. The drawer shows Request Failed with the message Crossed TPM / RPM / Max Parallel Request Limit, the key alias and the team, so the admin raises the key's limit on the Virtual Keys page and the next run succeeds.

Find a request​

  1. Open Logs at /ui/logs. The Request Logs tab lists the last 24 hours, newest first, and refreshes every 15 seconds while Live Tail is on.

  2. Paste a request id into the search box, or click Filters, narrow by Team ID, Key Alias, Model, Status or Error Code, and click Apply Filters.

  3. Click the row. The drawer opens with the model, provider, Request ID, the status badge, Metrics (tokens, cost, duration, time to first token) and, when prompt storage is on, Request & Response.

  4. Press J and K to step through neighbouring requests, or click Open run ledger in the trace sidebar to see everything a session or run did.

  5. The same row is available from the API by request id:

    curl "http://localhost:4000/spend/logs?request_id=chatcmpl-7f3a9c2e" \
    -H "Authorization: Bearer $SPANWAY_API_KEY"

    Expected result: one row with request_id, model, spend, total_tokens, startTime, endTime, the key hash and alias, the team and the user. messages and response are {} unless store_prompts_in_spend_logs is on and the request was not redacted.

Request Logs tab​

Toolbar​

ControlTypeWhat it does
SearchText, placeholder Search logs by ID…Looks up requests by id. The search runs a moment after you stop typing and resets to the first page.
RefreshIcon buttonFetches the current page again. It spins and is disabled while a fetch is running.
FiltersButtonOpens the filter drawer. A badge shows how many filters are active.
Active filter chipsChipsOne chip per active filter, each with a remove button. Clear all removes every filter.
Time rangeButton with a menuLast Minute, Last 15 Minutes, Last Hour, Last 4 Hours, Last 24 Hours (default) or Last 7 Days. Custom Range shows two date and time fields for a start and an end, and clicking it again goes back to the preset. A preset window always ends at the time of the latest fetch.
Live TailSwitch, on by defaultRefetches the table every 15 seconds while you are on the first page, and shows Refreshing every 15s next to it. The choice is kept for the browser tab.
Hide Health ChecksSwitch, off by defaultLeaves out the gateway's own internal health check requests. The choice is kept for the browser tab.
Reset FiltersButtonClears every filter and the search, and puts the time range back to the last 24 hours.

Filter drawer​

The drawer is titled Filters with the line Narrow down request logs. Changes take effect when you click Apply Filters, which also closes the drawer. Reset clears every filter at once, including the search text, and leaves the drawer open.

FilterTypeWhat it matches
Team IDSearchable list, placeholder Search or select a teamRequests made with a key of that team. The list holds the teams you can see.
Span TypeDropdownAll Types, LLM, Agent, MCP or Batch.
StatusDropdownAll Statuses, Success or Failure.
CacheDropdownAll Requests, Cache Hit or Cache Miss.
CredentialDropdownAll Credentials, Client OAuth token (the caller's own OAuth token was forwarded) or Configured key (the key configured on the gateway was used).
Key AliasSearchable list, placeholder Search a key aliasRequests made with keys of that alias. The list follows the team picked above.
User IDSearchable list, placeholder Search an internal userRequests by that internal user.
End UserSearchable list, placeholder Search an end userRequests that carried that end user (customer) id.
Error CodeSearchable list, placeholder Select or type an error codeFailed requests with that HTTP status. The list has common codes from 400 to 529, and Use custom code accepts any code you type.
Error MessageText, placeholder Enter error message…Failed requests whose error message contains the text.
Key HashText, placeholder Enter key hash…Requests made with the key of that hash.
Session IDText, placeholder Enter session ID…Calls of that session.
ModelSearchable list, placeholder Search a modelRequests served by that model deployment, by model id.
Public model / search toolText, placeholder Enter public model or search tool…Requests for that public model name or search tool.

Table​

The table is sorted by Time, newest first. Columns with a sort menu offer Ascending, Descending and Reset. Calls that share a session are folded into one row for the session. Click a row to open the detail drawer.

ColumnMeaning
TimeWhen the request started. Sortable.
TypeA badge for a single call, LLM, MCP, Agent or Batch. A session row shows the number of calls with small icons for agent and MCP calls, and a tooltip with the count of LLM, agent and MCP calls and cache hits.
StatusSuccess or Failure. A batch with some failed requests shows a warning badge such as 9/10 succeeded, with the failed count in a tooltip.
Session IDThe session id. Click it to open the session in the drawer.
Request IDThe request id, with a copy button. A tooltip shows the x-spanway-call-id when it differs. A batch row shows the batch id.
CostThe spend in dollars to six decimals. A session row shows the session total. When MCP tool calls added cost, a line says how much and from how many MCP calls. Sortable.
Duration (s)Request duration in seconds, with milliseconds in a tooltip. A session row shows the session total. Sortable.
TTFT (s)Time to first token in seconds, for streamed responses. Sortable.
Team NameThe alias of the key's team.
Key HashThe hashed key. Click it to open that key's details in place of the table, with a Back to Logs button to return.
Key AliasThe key's alias.
ModelThe model, with the provider logo. A session row lists the session's models. Sortable.
TokensTotal tokens with input and output in brackets. A session row shows session totals. Sortable.
Internal UserThe user's email when it is known, otherwise the user id.
End UserThe end user id sent with the request.
TagsThe first request tag and the number of others, with all tags in a tooltip.

The pagination bar under the table has Rows per page (25, 50 or 100, default 25), a Showing X-Y of N count, a page count and buttons for the first, previous, next and last page.

Request detail drawer​

The drawer opens from the right and covers most of the window. The URL gets log_id (and session_id for a session), so you can share a link to a request. When the request is not in the loaded page the drawer fetches it by id. Press J for the next request in the list, K for the previous one and Escape to close.

Trace sidebar​

The left column lists the calls of the trace or session. Its header shows Trace or Session with the id and a copy button, then the number of requests, how many were LLM, agent and MCP calls, the cost, and for a session the total duration and how many calls were cache hits. Open run ledger opens the run ledger for that id. A session that has more calls than were loaded says Showing most recent N of M. For a session, Duration and Start time sort the list. A link at the top says how many guardrails were evaluated and how many did not run, and scrolls to the guardrail section. Each entry shows an icon for the call type (a wrench for MCP tool calls, a bot for agent calls), a short model or tool name, a tag when the call came from the gateway itself, and the duration, cost and tokens. Click an entry to show it on the right. The collapse button hides the sidebar, and the same button in the header shows it again.

The header shows the model, the provider and the model group, then Request ID and, when present, x-spanway-call-id, each with a copy button. The arrow buttons step to the previous (K) and next (J) request, and the close button (tooltip ESC to close) closes the drawer. The status row shows a Success or Failure badge, an Env: badge with the environment, and the start time with how long ago it was.

Detail sections​

The sections below appear in this order when they have data.

SectionWhat it shows
Request FailedFor a failed request, the Error Code and Message.
TagsThe request tags.
Request DetailsModel, Provider, Call Type, User (when known), Model ID, API Base, IP Address (when recorded), Credential, Code traffic (what the gateway detected about code in the request, and which policy restricted it when one did) and Guardrail (the main guardrail and how many entities it masked).
Batch ResultsFor batch calls, Batch ID, Successful Requests, Failed Requests and Models.
RoutingFor auto-routed requests, the tier, Request type, Decided by, Classifier model, Confidence, Probabilities, Classifier cost, Score, Routed to, and the capability estimates the router used.
MetricsInput Tokens, Output Tokens or Tokens, Reasoning Tokens, Cost, Duration, Time to First Token, Response Cache and Cache Key (with tooltips and docs links), Prompt Cache Read Tokens, Prompt Cache Creation Tokens, Spanway Overhead, Retries (attempts of max, or None), Start Time and End Time.
Cost BreakdownInput Cost, Prompt Cache Read Cost, Prompt Cache Write Cost, Output Cost, Tool Usage Cost, Original LLM Cost, Discount Amount, Margin and Final Calculated Cost, each only when it applies, with the total in the header.
ToolsThe tools the request offered, as N provided, M called with the first names. Each tool row has a called or not called badge and opens to show the description, the Parameters table (Parameter, Type, Description) and what it was Called With, as Formatted or JSON.
Request & ResponsePretty shows the messages as cards (system, user and assistant, with tool calls) plus token counts and costs. JSON has Request and Response tabs with a Copy JSON button. The section collapses with its header. For a classifier call made by an auto-router, the section is replaced by Classifier input, Originating request, credentials masked and Classifier response.
Guardrails & Policy ComplianceSee below.
LLM Judge ResultsFor requests scored by an LLM judge, PASSED or FAILED, the score out of 100 with the threshold, the judge model, the iteration, and a table of Criterion, Weight, Score and Comment. A judge error is shown in its place.
Online scoresFor viewers who can read evals and requests an online scoring rule scored. Scorer, Verdict (Passed, Failed or Error), Score and Reason or error.
Vector Store RequestsFor requests that searched a vector store, Query, Vector Store ID, Provider, Start Time, End Time, Duration and the Search Results.
MetadataThe full request metadata as JSON, with Copy Metadata.

Hidden fields and reveal​

When your custom role denies logs.prompts, logs.responses or logs.tool_arguments, the drawer opens with a notice titled Your role hides the followed by the hidden fields, for example Your role hides the prompts, responses of this request. Those parts read [hidden by your role] in Request & Response, while cost, tokens, timing and metadata show as usual. When your role also grants logs.reveal, the notice has a Reveal button. It opens a short form: tick the fields to show (unticked ones stay hidden), type a Reason of at least 10 characters, which is stored in the audit log so a reviewer can see why you looked, and click Reveal and record. The content appears for this request only, and the audit log gets a revealed row with your reason, address and browser. Cancel closes the form. Without logs.reveal the notice tells you to ask an admin for it. See data access governance.

When the request and response bodies were not stored, the drawer shows Request/Response Data Not Available. It explains that you turn on prompt storage with store_prompts_in_spend_logs: true under general_settings in the proxy config, or with the switch in the Logging Settings of Admin Settings, and that the change affects only new requests. Prompt storage is off by default. Even with it on, the bodies are not kept for a request that falls under a zero data retention policy or has message logging turned off, so those requests show the same notice. What Spanway stores explains every rule.

Opening a request's stored prompt and answer is written to the audit log as viewed on Spanway_SpendLogs, see data access governance. Scripts that need one request use GET /spend/logs?request_id=<id> and scripts that need a session use GET /spend/logs/v2?session_id=<id>, because the routes the drawer calls (/spend/logs/ui/{request_id} and /spend/logs/session/ui) are internal to the Admin UI and may change.

MCP tool calls​

MCP tool calls (call types call_mcp_tool and list_mcp_tools) are logged as their own rows with the MCP type badge. In a session they show in the trace sidebar with a wrench icon and the tool name, without the mcp: prefix. Opening one shows the same sections as a model call. The Request & Response section holds the tool arguments and the tool result, and Cost shows the tool call cost. On the session row, the Cost column adds a line for the MCP share of the spend.

Guardrail results​

The Guardrails & Policy Compliance section appears when guardrails ran on the request. Its header says how many guardrails were evaluated, with badges for passed, flagged and not run, and the total time they added as Total: Nms overhead. Export Compliance Log downloads the guardrail results as a JSON file named guardrail-compliance-log-<date>.json.

Two compliance cards, EU AI Act and GDPR, check the request against those rules. Each shows COMPLIANT, NON-COMPLIANT or UNAVAILABLE (with the error in a tooltip), and opens to list the individual checks. They show Checking compliance... while the gateway answers.

Request Lifecycle puts the guardrails on a timeline, from Request received through each pre-call guardrail, the LLM call, each during-call and post-call guardrail, to Response returned, with time offsets.

Evaluation Details has one card per guardrail. The card header shows the name, the mode, and these badges.

BadgeMeaning
PASSEDThe guardrail ran and let the request through.
FLAGGEDThe guardrail found something and recorded it without blocking.
FAILEDAny other result, such as a blocked request or a guardrail error.
NOT RUNThe guardrail did not run, with the reason in the card.
N/M matched or N matchedHow many patterns or entities matched, green when none did.
N% confThe guardrail's confidence score.
Risk N/10The risk score, on passed guardrails that report one.
N text recordsHow many text records were checked.
CostThe guardrail's cost. The tooltip says when the cost is an estimate that is not counted against spend or budgets.

The right side shows the duration and the detection method. Open a card to see the classification (Category, Reference, Confidence, Reason), Masked Entities, a table of detections with Type, Method, Action and Detail, and the Raw Guardrail Response. PII masking results list each detected entity, AWS Bedrock guardrails show their assessments, and the built-in content filter shows what it matched.

Audit Logs tab​

The tab lists management changes such as created, updated, deleted and rotated keys, teams, users, organizations, models, agents and admin MCP tools. It also lists gateway settings changes, such as turning prompt storage on or off in Logging Settings (table Gateway settings), and reads of stored prompts and request log exports (table Request logs). Without an Enterprise license the tab shows an Enterprise feature notice that says a valid key is needed, and a preview image.

Proxy admins and admin viewers see a line above the table that says Recompute the audit log hash chain to detect edited or deleted rows., with a Verify chain button. It reads Verifying while it runs. The result is one of these.

ResultMeaning
No hashed audit rows yetThere is nothing to verify until new audit rows are written.
Audit chain verifiedEvery row's hash recomputes, with the number of rows checked. When retention purged older rows it names the anchor the check starts from.
Audit chain broken at row <id>A row was changed or removed. It shows when the row was written, why it fails (its contents no longer match its hash, or it does not point at the row written before it), how many rows are intact before it, and the expected and found hashes.
Could not verify the audit chainThe check failed, with the error.

The gateway allows the check only for proxy admins and admin viewers, and needs an Enterprise license for it.

ControlTypeWhat it does
SearchText, placeholder Search audit logs by ID…Searches by id. Resets to the first page.
RefreshIcon buttonFetches the page again.
FiltersButtonOpens a drawer titled Filters (Narrow down audit log entries) with Object ID, Changed By, Team ID and Key Hash text fields, an Action dropdown (All Actions, Created, Updated, Deleted, Rotated, Blocked, Unblocked, Exported, Viewed, Kill switch fired, Invoked (tool call, replay or dry run), Revealed) and a Table dropdown (All Tables, Keys, Teams, Users, Organizations, Organization memberships, Access groups, Models, Agents, Custom agents, Custom agent runs, Skills, Skills page plugins, Admin MCP tools, Access requests, Policy attachments, Routing presets, Team memberships, Red team runs, Custom roles, Projects, Budgets, Customers, Tags, Request logs, Usage and spend reports, Invoices, Gateway settings, Policies, Data subject requests, Cloud workspaces). Viewed and Revealed are the read audit events of the Request logs and Usage and spend reports tables. Invoked covers admin MCP tool calls, policy replays and inspector dry runs, so pick the table to see only one of them.
ColumnMeaning
TimestampWhen the change was made. Newest first.
ActionA badge, green for created, blue for updated, viewed and admin MCP tool calls, red for deleted and kill switch fired, amber for rotated, exported and revealed.
TableWhat kind of object changed.
Object IDThe id of the changed object. Click it to open the entry.
Changed ByThe user who made the change. The built in admin shows as Default Proxy Admin.
API Key (Hash)The hash of the key used to make the change.

The table shows 50 entries per page. The entry drawer shows the action badge, a Details block with Table, Object ID, Changed By and API Key (Hash) (each id with a copy button), and Before and After blocks. For updates and rotations only the fields that changed are shown. For keys the blocks show the token, spend and max budget. Other objects show JSON with a copy button. A missing value shows N/A.

Export Ledger tab​

The tab lists every export of usage, spend, invoice, run ledger or personal data, newest first, 50 per page, read from the exported rows of the audit log. A line above the table explains what it is for and links to the export ledger docs.

Control or columnWhat it does
Filter by user idShows only the exports of one user id. Resets to the first page.
WhenWhen the export ran.
WhoThe user id that ran it.
ExportWhat was exported, for example team_daily_activity, run_ledger, data_subject or billing_invoice.
Destinationdownload for a file the browser saved, or the destination of a cost export such as vantage.
RowsHow many rows went out, or - when the export did not record it.
FinishedYes, No, stopped early when the download was cut off, or Not recorded.
FiltersThe filters the export used, such as the team ids and the date range.
AddressThe caller's address.
Previous, NextPage through the ledger. The line between them shows the page and the number of exports.

The empty state is No exports recorded yet. When the ledger cannot load, "Couldn't load the export ledger" shows the reason with Retry.

Deleted Keys tab​

Lists keys that were deleted, newest first, 50 per page. The gateway returns the deleted keys the caller is allowed to list. Columns are Key ID, Key Alias, Team Alias, Spend (USD), Budget (USD), User Email, User ID (links to the user), Created At, Created By, Deleted At and Deleted By. Spend, created and deleted dates can be sorted. Deleted keys cannot be restored from here. Without an Enterprise license a notice says deleted key auditing is moving into the Enterprise audit and compliance suite. The empty state is No deleted keys found.

Deleted Teams tab​

Lists teams that were deleted, newest first, 25 per page by default. Columns are Team Name, Team ID, Created, Spend (USD), Budget (USD), Models, Organization, Deleted At and Deleted By. Created, spend and deleted dates can be sorted. Without an Enterprise license a notice says deleted team auditing is moving into the Enterprise audit and compliance suite.

Errors​

The page shows these states. The API statuses behind the tabs are listed after the table.

StateWhat you seeWhat to do
No requests in the windowNo requests yet and Requests proxied through Spanway will appear here.Send traffic, or widen the time range.
Filters match nothingNo matching requests and No requests match your filters for this time range.Remove a filter or widen the time range.
Request logs fail to load"Couldn't load request logs" followed by the reason and "This is not an empty list. Check your connection and permissions, then retry." Retry loads the list again.Press Retry.
Bodies not storedRequest/Response Data Not Available in the drawer.Turn on prompt storage. Only new requests are affected, and requests under zero data retention or with message logging off never keep their bodies.
Request bodies loadingLoading request & response data... in the drawer.Wait.
No audit rowsNo audit logs yet, or No matching audit logs with filters.Make a change, or clear the filters.
Audit logs fail to load"Couldn't load audit logs" followed by the reason and "This is not an empty list. Check your connection and permissions, then retry." Retry loads the list again.Press Retry.
Audit logs without a licenseThe Enterprise feature notice and preview.Add an Enterprise license.
Disabled controlsThe refresh button is disabled while a fetch runs. Verify chain is disabled while it runs.Wait for the request.
StatusRouteMeaningFix
403 Admin-only endpoint. Not allowed to access this.GET /audit, GET /audit/{id}, GET /audit/verifyThe caller is neither a proxy admin nor an admin viewer.Use an admin account.
403 naming a Spanway enterprise licenseThe same routesThe gateway has no valid license.Add a license.
400 since must not be later than untilGET /audit/verify, GET /audit/exportsThe window is inverted.Swap the dates.
403 Your role may not reveal hidden log fields. Ask an admin for the logs.reveal permissionReveal and recordYour role hides the field without granting logs.reveal.Ask a proxy admin for the permission.
409 Revealing a hidden field needs audit logging turned on, so the reveal can be recordedReveal and recordAudit logging is off, so the reveal could not be recorded.Ask a proxy admin to turn on audit logging.
403 Not allowed to view run ledgersOpen run ledgerThe key has no user, so it may not read ledgers.Sign in with a user account.
404 No run found for id '<id>'Open run ledgerNothing was recorded for that session, run or trace id.Check the id in the trace sidebar.
500 DB not connected. ...GET /spend/logs/ui, GET /spend/logs/session/ui, GET /spend/logsThe gateway runs without a database, so there are no logs to read.Set DATABASE_URL.
403 Cannot authorize spend log access without a database connection. Connect a database or use a proxy admin key.Request detail drawer (GET /spend/logs/ui/{request_id})A non-admin opened a request on a gateway with no database, so the gateway cannot check who owns it.Set DATABASE_URL, or use a proxy admin key.
403 A key with no user can read spend logs only as a proxy adminGET /spend/logsA key that belongs to no user and is not a proxy admin asked for rows.Use a key that belongs to a user, or a proxy admin key.
403 Not authorized to view team spend for team_id=<id>Team ID filterThe team does not let you read its logs.Pick a team you are an admin of, or ask a team admin to grant the /spend/logs permission.
403 Not authorized to view spend log for request_id=<id>Search, the drawer and ?request_id=The request belongs to someone else, or retention already removed it.Search for a request you made, or ask an admin.
400 Start date and end date are requiredGET /spend/logs/ui, GET /spend/logs/v2A script called the list without a time window.Send start_date and end_date.
400 Invalid date format: <date>. Expected: 'YYYY-MM-DD HH:MM:SS'Custom Range, GET /spend/logs/uiA start or end time is not in that form.Pick the range again, or send that format. GET /spend/logs/v2 also takes YYYY-MM-DD, and GET /spend/logs takes only YYYY-MM-DD.
400 Invalid sort_by: ..., Invalid sort_order: ..., Invalid cache_hit_filter: ... or Invalid span_type: ...GET /spend/logs/ui, GET /spend/logs/v2A script sent a value the list does not know.Use one of the values the message lists.

Differences by role and license​

RoleWhat changes
Admin (proxy admin)Every tab, every request in the deployment, and Verify chain.
Admin ViewerThe same tabs and requests as Admin, under the view-only banner. The page has no write actions.
Org adminRequest Logs, Deleted Keys and Deleted Teams. No Audit Logs tab. Requests are limited by the gateway to what they may read.
Internal User and Internal ViewerRequest Logs and Deleted Keys. Requests are limited by the gateway to their own requests and those of teams they may read.
enabled_ui_pages_internal_usersWhen set, non-admin roles see the nav item only if logs is listed.

The Audit Logs and Export Ledger tabs and the deleted key and team notices follow the Enterprise license. A custom role can hide prompts, responses and tool arguments in the drawer for any role, see data access governance. The audit chain check is enforced by the gateway as well.