Skip to main content

Chat page

The Chat page is a separate chat workspace for people who use the gateway rather than administer it. You pick a model, chat with it, and attach MCP servers you have connected as tools. Side pages show your MCP connections, your keys, your request logs and your usage. Open it at /ui/chat. When it is enabled it sits under AI Gateway in the left nav as Chat, and it is also listed in the view switcher in the top bar.

The page is off by default. A proxy admin turns it on with [BETA] Enable Chat page (page will refresh) on the UI Settings tab of the Admin Settings page, which sets the enable_chat_ui UI setting. While it is off, the nav item is hidden, the view switcher shows Chat greyed out with "Admins can enable in Settings", and opening any /ui/chat URL sends you back to the Admin UI home page. When it is on, the nav item is shown to the roles that can make model calls, which are Admin, Org Admin and Internal User. View-only roles (Admin Viewer and Internal Viewer) do not see it, because every chat is a paid model call, and opening a /ui/chat URL with a view-only role sends you back to the Admin UI home page. When enabled_ui_pages_internal_users is set in UI settings, non-admin users see the item only if chat is in that list. No license feature is needed to open the page. Rotating a key on the API Keys page needs a Spanway Enterprise license, see below.

Every message is a real request. It runs through the gateway's Responses API with your UI session key, so it is authorized, costed against your budget, checked by guardrails and logged like any other call.

A banner across the top reads "This is a pre-v0 feature. Do not use in production, it may change unexpectedly." with a feedback link.

A real-world scenario​

An analyst wants to ask questions about tickets in the company's issue tracker. The admin has registered the tracker's MCP server, so the analyst connects it once on Integrations, turns it on with the + button in a new chat, and asks for last week's open bugs. The model calls the tracker's tools with the analyst's own credentials.

Steps​

  1. Open Chat under AI Gateway in the left nav, or go to /ui/chat. If the item is missing, a proxy admin turns the page on first, see Chat UI.

  2. Open Integrations and connect the MCP server that needs your sign in.

  3. Back in a new chat, pick a model in the model picker, click + and turn on the MCP server.

  4. Type the question and press Enter. The page sends a Responses API request such as:

    curl http://localhost:4000/v1/responses \
    -H "Authorization: Bearer $SPANWAY_API_KEY" -H "Content-Type: application/json" \
    -d '{"model": "gpt-5.5", "input": "List the open bugs from last week"}'
  5. Open Logs in the Chat sidebar to see the request and its cost.

Expected result​

The answer streams in with each MCP tool call shown with its arguments and result, and the request appears on the Logs page with its tokens and cost.

The left sidebar is shared by every Chat page.

ControlWhat it does
New ChatOpens an empty conversation.
ChatsThe conversation view, /ui/chat.
IntegrationsBrowse and connect MCP servers, /ui/chat/integrations.
CredentialsYour stored OAuth connections, /ui/chat/credentials.
API KeysYour virtual keys, /ui/chat/api-keys.
LogsYour request logs, /ui/chat/logs.
UsageYour spend and request activity, /ui/chat/usage.
Conversation listYour saved conversations, grouped under Recents (today), Yesterday, Last 7 Days and Older. Clicking a conversation opens it and puts its ID in the id query parameter. With none it reads "No conversations yet" and "Start a new chat above".
Search (Cmd+K or Ctrl+K)Opens a search dialog (placeholder Search conversations…) that filters conversations by title and shows "No conversations found" when nothing matches.
Rename (pencil icon)Edits a conversation title in place. Enter saves and Escape cancels.
Delete (trash icon)Asks "Delete this conversation?" with "This action cannot be undone" and Cancel or Delete. Deleting removes the conversation from this browser. It does not remove request logs from the gateway.

Conversations are stored in the browser's local storage under your user ID, up to 100 conversations (the least recently updated are dropped beyond that). The title is the first message, cut to 40 characters. Signing out removes them from the browser, so the next person on it does not see them. They are not synced to other browsers or devices. If the browser cannot store them, a banner reads "Chat history won't be saved in this browser session" and can be dismissed.

Chats​

An empty conversation shows a greeting with your name (from your email address), a line about chatting with models and MCP tools after you authenticate once, with an Open Integrations link, the message box (placeholder How can I help you today?) and four starter buttons, Write, Learn, Code and Brainstorm, which put that word into the box.

Message box​

ControlWhat it does
Text boxYour message. Enter sends and Shift+Enter adds a new line. In a conversation the placeholder is Send a message....
Model pickerLists the model groups your key can use, with provider logos, and a search field (placeholder Search models...). The selected model is shown first and is remembered in local storage. On first use the first model in the list is selected.
+ (MCP servers)Opens a list of the MCP servers your key can reach, each with a switch. Turning a switch on first checks that the server's tools load. If they do not, it shows a warning that the server will be excluded and leaves it off. The button shows how many servers are on, and in a conversation the box also shows that count as tools connected. If there are no servers it reads "No MCP servers configured".
SendSends the message. It is disabled when the box is empty, while models load, or when no model is selected.
Stop (square button)Replaces Send while the answer streams and stops it. The partial answer is kept with [stopped] at the end.

The first message of a new conversation creates the conversation. Later turns reuse the server side response session, so only the new message is sent. Switching conversations starts a fresh session.

Messages​

Control or elementWhat it does
Edit (pencil on your message)Opens the message for editing with Cancel and Save & Send. Saving removes that message and everything after it from the conversation, then sends the edited text as a new turn. The removed messages cannot be restored.
CopyCopies a message and shows Copied!.
Thinking...Shown while a reasoning model has not produced output yet. Reasoning content is shown in a collapsible block.
Tool callsEach MCP tool call shows the tool name, its Arguments and its Result. Argument values whose names look like a token, key, secret, password or auth value are shown as [redacted]. Tool calls are saved only when the answer finished normally.
MetricsTime to first token, total latency and token usage, the same as on the Playground page.

Images in answers are not rendered and show their alt text instead.

Integrations​

The Integrations page lists the MCP servers your key can reach under MCP Servers, with "Browse tools, authenticate once, use in chat" and the total number of tools available. A search field (placeholder Search servers...) filters by name and description, and the All and Connected tabs switch between every server and the ones you have turned on, with a count.

Each server row shows its status. A green check means the server is ready, either because it uses machine to machine OAuth or because you have already authorized it. Servers that need your own OAuth authorization show a Connect button that starts the OAuth flow in the provider's consent screen. A dot means the server is turned on for chat.

Clicking a server opens its details with a Back button, an Information block (Server ID, Transport, Status of Connected or Not connected), Available Tools (or "No tools available") and an action button.

Server typeAction
No per user OAuthConnect turns the server on for chat after its tools load, and Disconnect turns it off.
Machine to machine OAuthReads Authorized. Nothing to do.
Per user OAuth, not yet authorizedConnect starts the OAuth flow.
Per user OAuth, authorizedDisconnect deletes your stored OAuth credential for that server and turns it off.

When there are no servers it reads "No MCP servers configured. Add servers in Tools, MCP Servers." (the UI shows the path with an arrow).

Connecting an external client​

When an external MCP client sends you to this page to authorize it, the URL carries a connect_flow handle and a banner at the top explains what is being asked.

BannerMeaning and buttons
"Connect your MCP servers to" the clientThe client asked for no specific server. Authorize the servers you want in the list below, then click Finish connecting to return to the client.
"Allow" the client "to use" a server, before authorizationAuthorize that server with its Connect button, or Cancel to refuse.
"Allow" the client "to use" a server, after authorizationFinish connecting gives the client access to that server as you. Cancel refuses.
The connection cannot continueThe gateway could not validate the request, for example because it expired. Only Cancel is offered.

Finish connecting and Cancel are sent as a form post to the gateway, never as a plain link, so another site cannot complete a connection for you. When the client runs on your own machine (a loopback address), the checkbox My client is on a remote or SSH machine switches to manual delivery of the result. In this mode some servers show Not supported on this connection, and the empty state reads "No MCP servers are available to this connection yet. Ask an admin to grant your user or team access."

Credentials​

The Credentials page, App Credentials, lists your stored OAuth connections and personal API keys for MCP servers, which chat uses automatically. Personal API keys are entered from the Connect dialog on Integrations.

ColumnMeaning
AppThe MCP server.
ConnectedHow long ago you connected it.
StatusDoes not expire, Expires in a number of days, hours or minutes, or Expired.
ActionsThe trash icon, Revoke connection.

Revoking asks "Revoke connection?" and explains that it removes the stored OAuth credential or API key for that server and that you will need to reconnect to use it in chat again. Cancel keeps it. The revoke cannot be undone. If it fails, "Failed to revoke connection. Please try again." is shown and the row stays. With no connections the page reads "No connections yet" and points you to Integrations and Connect.

API Keys​

The API Keys page, Your API Keys, lists up to 100 of the virtual keys that belong to your user, with "View your virtual keys and spend".

ColumnMeaning
KeyThe masked key name (the first 7 and last 4 characters) and its alias.
SpendSpend so far in USD, and the key's max budget when one is set.
ExpiresNever, Expired, or the expiry time in UTC.
CreatedHow long ago the key was created.
RotateShown only with a Spanway Enterprise license. Opens Rotate Key.

With no keys the page reads "No keys found".

Rotate Key dialog​

Rotating issues a new secret for the key and invalidates the old one, either at once or after a grace period.

FieldWhat it does
Key AliasThe key's alias, shown read only.
Max Budget (USD)Optional new max budget. Starts with the current value.
TPM LimitOptional new tokens per minute limit.
RPM LimitOptional new requests per minute limit.
Expire KeyOptional new duration (placeholder e.g. 30s, 30h, 30d). It must look like 30s, 30m, 24h, 2d, 1w or 1mo. It is required when the key has already expired. The dialog shows the Current expiry and the New expiry the duration would give.
Grace PeriodOptional time the old key keeps working (placeholder e.g. 24h, 2d), in the same duration format. Leave it empty to invalidate the old key immediately.

Rotate sends the change and Cancel closes the dialog. On success the dialog warns you to save the key now because you will not see it again, and shows the New Key, a Copy Key button and Close. The new key is not shown again after you close the dialog. A failure shows "Failed to rotate key". The backend also refuses rotation of a virtual key without the license.

Logs​

The Logs page, Your Logs, shows "Request logs for your account only" for the last 24h (the default), 7d or 30d, 50 per page, newest first.

ColumnMeaning
TimeWhen the request started.
ModelThe model used.
StatusSuccess or Failure.
TokensTotal tokens.
DurationHow long the request took.
CostThe request's cost.

Previous and Next page through results when there is more than one page, with a count of requests and the page number. Clicking a row opens Request details with the model, cost, tokens and duration and the stored Request and Response bodies, or "Not available" when they were not stored. Bodies are stored only when store_prompts_in_spend_logs is on and the request is not under zero data retention, and that setting is off by default. See What Spanway stores. With no data it reads "No logs for this period". If loading fails it reads "Failed to load your logs" with Retry.

Usage​

The Usage page, Your Usage, shows "Spend and request activity" for the last 7d, 30d (the default) or 90d.

CardMeaning
Total SpendYour spend in USD for the period.
API RequestsThe number of requests.
Tokens UsedTotal tokens, with input and output tokens below.
Success RateThe share of successful requests, with the number of failed requests below when there are any.

When the period has more than one day of data, Daily Spend and Daily Requests bar charts follow. With no requests in the period it reads "No usage data for this period".

Empty, error and disabled states​

If the model list cannot load, "Could not load models" is shown and Send stays disabled. If a request fails, the answer is replaced with "[Something went wrong. The partial response has been saved.]". Opening a conversation link whose ID is not in this browser takes you back to a new chat. While the UI settings load the page shows nothing, and when the Chat page is disabled any Chat URL sends you to the Admin UI home page.

The Rotate button is missing without a Spanway Enterprise license, and the API Keys intro then leaves out the rotation sentence.

Differences by role and license​

Who or whatWhat changes
Admin, Org Admin and Internal UserSee the page when it is enabled, unless enabled_ui_pages_internal_users leaves it out for a non-admin user. Models, MCP servers, logs, usage and keys are those of your own user and UI session key.
View-only rolesThe Chat nav item is hidden, and a /ui/chat URL sends them back to the Admin UI home page.
Spanway Enterprise licenseAdds the Rotate column and dialog on API Keys. Without it the backend also refuses key rotation.

Gateway log lines​

Every chat turn is an ordinary /v1/responses request made with your key, so admins see it on the Admin UI Logs page as well as you on Your Logs. Connecting or removing a personal MCP key, or revoking an OAuth connection, writes an audit row without the secret. The Chat page writes no gateway log lines of its own, and the request lines are in the log reference.

Errors​

What you seeWhat it meansFix
A Chat URL sends you to the home pageThe Chat page is off, or your role is view-only.Ask a proxy admin to turn it on, or use a role that can make model calls.
"Could not load models"The model list request failed, for example because the gateway could not be reached or your session expired.Reload the page or sign in again. A key with no models shows an empty model picker and no message, so ask an admin to give your key or team a model.
A warning that a server will be excludedIts tools did not load with your credentials.Connect it again on Integrations.
"[Something went wrong. The partial response has been saved.]"The request failed, for example a guardrail block or a spent budget.Check the request on Logs for the error.