Inspect sessions and usage
Use sessions, users and spending to assess your embed, then inspect an individual conversation. This page is for service agents already receiving traffic from a host application.
Prepare the records
With an authorized organization account, open Service agents → Select agent in the Dashboard; the tabs used below are Overview (概览), Sessions (会话), Customers (客户) and Usage (用量). Labels below describe the current Chinese Dashboard. Have the time, end-user ID and integration type ready.
Send a recognizable test message from your host website and receive a reply before checking operations data. Dashboard Playground records are excluded from customer operations statistics. They cannot prove customer traffic or spending was recorded.
Inspect the overview
Open Overview (概览) and choose 24 hours, 7 days or 30 days. Aggregate overview statistics are currently Dashboard-only; there is no corresponding public API.
| Information | Question it answers |
|---|---|
| Sessions, active end users, cost, cost per session | Has traffic or the cost of serving a conversation changed? |
| Positive feedback rate | What proportion of rated responses received positive feedback? |
| P50 first-token latency, error rate | Has the initial response slowed, or have runs failed? |
| Source and version distribution | Does traffic come from Kit, iframe, Hosted, API or automation? Is the new version in use? |
| Attention counters and top 5 tools | Are origins blocked, budgets reached or tool calls unusual? |
Expected: Session trends and version distribution cover the selected period. A metric without samples displays “—”, not zero. The 24-hour trend uses hourly buckets; other periods use daily buckets. Run errors, origin blocks and tool counts aggregate the intersecting UTC calendar days, including whole boundary days.
Find and replay sessions
- Open Sessions (会话), enter the full end-user ID, and click Filter (筛选). Choose a Source (来源) if needed.
- Open the session and check its user, source, version and creation time in the replay header.
- Inspect messages and tool calls, locate your test message and reply, then use Close replay (关闭回放).
Expected: Replay is read-only; you cannot send messages. To prevent further messages, click Archive (归档) and confirm. Records remain readable after archiving, but the session cannot receive more messages.
On your server, set PRAXIS_API_BASE (API origin), PRAXIS_API_KEY (organization API Key), and PRAXIS_AGENT (public agent_… ID). Use Node.js with native fetch. Save this as inspect-sessions.mjs. Run node inspect-sessions.mjs customer_42, replacing the test user ID.
import assert from 'node:assert/strict';
const { PRAXIS_API_BASE, PRAXIS_API_KEY, PRAXIS_AGENT } = process.env;const [user, sessionId] = process.argv.slice(2);assert(PRAXIS_API_BASE && PRAXIS_API_KEY && PRAXIS_AGENT && user, 'Set environment variables and a user ID');assert(PRAXIS_AGENT.startsWith('agent_'), 'Use the public agent ID');const base = `${PRAXIS_API_BASE.replace(/\/$/, '')}/agent/v1`;async function readPages(path, filters) { const rows = []; let page; do { const query = new URLSearchParams(filters); if (page) query.set('page', page); const response = await fetch(`${base}${path}?${query}`, { headers: { Authorization: `Bearer ${PRAXIS_API_KEY}` }, }); if (!response.ok) throw new Error(`Read failed: HTTP ${response.status}`); const result = await response.json(); rows.push(...result.data); page = result.next_page; } while (page); return rows;}const sessions = await readPages('/sessions', { agent_id: PRAXIS_AGENT, external_user_id: user });console.log(sessions.map(({ id, title, source, status }) => ({ id, title, source, status })));if (sessionId) { assert(sessions.some(row => row.id === sessionId), 'Choose a session from this user listing'); const events = await readPages(`/sessions/${encodeURIComponent(sessionId)}/events`, { order: 'asc' }); console.log(events);}The first run lists sessions. Copy the target session’s id and run again with it as the second argument to read all events. The script uses GET /agent/v1/sessions and GET /agent/v1/sessions/{session_id}/events. Both requests are read-only; the API Key stays out of the browser.
Expected: The listing includes your user’s test session. Events include the test message and reply in chronological order. Following next_page prevents an incomplete replay. Output can contain conversation content; handle it under your data-access rules.
Use response identifiers
Pass identifiers returned by the preceding response. Do not copy sample placeholders or construct identifiers from prefixes.
| Next action | Source value |
|---|---|
| Fork a session | message_id from a completed agent.message, not the event’s id; send it as message_id to POST /agent/v1/sessions/{session_id}/fork |
| Read an attachment | Use the actual path in the attachment creation or file listing response; computer attachments are under /attachments/, not the working directory |
| Pin a skill version | Upload response latest_version_id; see Skills for deletion order and references |
| Retrieve a thread or run | Its creation response id; session, event and message identifiers are not interchangeable |
Native API errors have the shape {type, error: {type, message, code, retryable}, request_id}. Keep request_id and the X-Request-Id response header; they can differ. Never include credentials. Back off only when retryable: true and repeating the operation is safe. After a write times out, inspect existing resources before sending another message or creating a session.
Inspect spending and budgets
Open Usage (用量) to see monthly spending, the monthly cap and its action. Choose 7, 30 or 90 days for daily spending. Below are budget and rate settings, monthly source breakdown and the top 20 end users by spending. Monthly totals use the UTC calendar month; displayed amounts are US dollars.
These aggregate reports and budget settings are currently Dashboard-only. Edit the budget settings directly in the Budget & limits (预算与限额) card on the Usage (用量) tab. Save and return to verify. Stop new sessions rejects session creation when the cap is reached; Alert only does not block it. Cost composition (花费构成) is not available yet; its placeholder is not a breakdown.
Verify and act
Match the host message, replay and source using the same user, session and period. For an unexpected version, check the version used at token issuance. Pinning or rolling back does not alter existing tokens. For missing data, check the environment, organization and period before creating more test sessions.
For origin or budget failures, record the response’s X-Request-Id, time, HTTP status and error code. Exclude API Keys and tokens. See Manage customers for user-level actions.
Next: Embed limits and errors · Agent API · Cookbook