CC ccdash

Claude Code + Codex · Documentation

API contracts, cost and Task Trace

Use shared client, user-task and Codex diagnostic APIs with exact identities, bounded time windows and explicit signal semantics.

Updated November 14, 2026 · Describes source behavior; verify your installed revision.

Task Trace APIs · Diagnostic Trace API

Authentication

In OIDC mode, telemetry APIs use session cookies. Unauthenticated API requests return JSON 401 with authentication_required and a login URL. Unsafe session requests require the configured Origin and permission.

Basic mode requires both configured credentials. Unauthenticated local development is an explicit opt-in; an empty password configuration is not a production login mode. Device ingestion uses its own bearer-token gate.

GET /api/session reports role, permissions and the short expiresAt; optional refreshExpiresAt is the absolute login deadline. It never returns raw IdP tokens.

Time and filters

ParameterContract
from, toUse ISO 8601 with timezone and from < to. Default range is two days; default cap is 90 days. Deployment settings can change them.
clientShared overview: all, claude or codex; disabled sources are rejected.
backendClient views: all, bedrock-mantle, bedrock-runtime, anthropic or unknown.
user, modelExisting partial filters. Model normalization and identity expressions depend on the endpoint.
userExact, modelExactShared overview: exact row identities for drilldowns; verify returned applied_filters. Task routes require userExact. Codex insights accepts userExact only with profile=tools and always rejects modelExact.
intervalHoursWrapped routes require a finite value in (0,744]. Shared overview supports bounded subhour resolution; read actual bucket_hours and effective_range.
groupClaude inferred session channel, not the emitting client or an SSO authorization group.
projectEndpoint-specific, not a universal filter. Consult the complete API reference before applying it.

Cost/Trends expose ten- and thirty-minute options only through 24 hours. Older windows use hourly rollups; arbitrary finer requests can fall back to a supported native bucket.

The browser picker accepts exact local dates and times with second precision. It serializes ISO from/to bounds and a UI-only rangeMode=time marker for shared links. The marker is not an API filter. Effective bounds still follow each endpoint’s quantization, ingestion grace and rollup rules.

Shared client and cost endpoints

EndpointUse
GET /api/clients/overviewTotals, client/model/user breakdowns, timeseries and coverage. Optional modelTime=1 returns model timeseries.
GET /api/clients/overview?view=costSame cost, token coverage, population and bounds; skips unused project/tool/operational diagnostics. Omitted fields are not zero.
GET /api/clients/token-economicsCost equation, driver decomposition, unit trend, model economics, outcome cost and exemplar users for the effective window and the preceding window. Values stay unavailable until operators set SESSION_TURNS_READ_FROM after the migration 010 backfill.
GET /api/codex/insightsCodex completion efficiency plus log, metric and trace diagnostics.
GET /api/codex/insights?profile=effortLog-only detail for cost/effort views. Metric and trace coverage is not_requested.
GET /api/cost/summary, /by-model, /by-user-modelExisting Claude-specific cost routes. Do not treat them as combined-client totals.

Model user shares divide known user costs by the selected model's known cost subtotal. Unknown prices are disclosed; an unknown or zero denominator yields no percentage.

Codex recorded-completion efficiency

completion_usage describes deduplicated usage-bearing completion logs, with basis="recorded_completions". It does not claim every HTTP attempt or session in the selected window has complete telemetry.

FieldDenominator and boundary
cache_hit_rate, cache_write_shareValidated cache-read/cache-write subsets divided by canonical input tokens within recorded completions.
reasoning_shareValidated reasoning subset divided by canonical output tokens in that cohort.
tokens_per_completionCanonical tokens divided by recorded completion count; observed token subtotals cannot replace missing canonical components.
cost_per_completionKnown completion costs divided by all recorded completions, retaining partial-price disclosure.
cost_per_identified_sessionOnly completions with a conversation ID contribute to both the cost numerator and distinct-session denominator.
unidentified_completionsCounted separately and excluded from the identified-session cost unit.
completenessReports missing usage/session evidence, limited aggregate families, incomplete tokens and available whole-window request/session counts.

Missing components, impossible subsets, zero denominators, all-unknown prices or limited usage can still produce null. Existing whole-window HTTP request/session ratios keep their stricter guards. The UI exposes them in an expandable section.

Full completion, coverage and aggregate-limit semantics

Collector and device APIs

EndpointContract
GET /api/collectorFeature state, configured public ingestion endpoint, version, platforms, token lifetime and installScriptUrl.
GET /api/collector/devicesOwner-scoped devices, at most 50 per page; use returned cursor unchanged.
POST /api/collector/devicesRegister with name and platform (darwin or linux). Returns the token once.
DELETE /api/collector/devices/:idRevoke an owned device.
GET /api/collector/package/:platformAuthenticated download, no embedded credentials.
GET /api/ingest/install.shPublic installer script when device ingestion is configured. Prompts on the terminal for attribution and token; it carries no credentials.
GET /api/ingest/package/:platformDevice-bearer-authenticated archive for darwin or linux; ten downloads per device per hour. No browser session or embedded token.
POST /api/ingest/v1/{logs,metrics,traces}Device bearer token only. OTLP JSON/protobuf, maximum 2 MiB, no content compression.

Management and manual /api/collector/package/:platform downloads require OIDC collector:manage (analyst/admin). Viewer/demo access cannot manage devices. The installer script and device-token package route use the separate ingestion path. Device endpoints do not use usage-range filters; their responses and downloads are no-store.

Health and errors

/healthz is liveness; /readyz gates readiness. Protected /api/health/data reports ingestion freshness. A live process does not establish fresh telemetry.

Malformed filters fail before querying. Refresh service failures can return 503 with Retry-After: 5; expired or invalid credentials require login. Bounded query admission can reject overload instead of creating unbounded database work.

Complete route list, response fields and errors

User task and Trace APIs

User detail loads the overview’s effective period by default. A chart drag updates the page and task list; a point click selects one bucket. Pending or failed overview requests do not show an old task list as current.

Use session-authenticated telemetry access. userExact selects the task's telemetry owner within the requested time range; it does not restrict dashboard readers to their own telemetry.

EndpointRequest and response
GET /api/users/tasksRequired userExact, with the selected range’s from/to. Optional client, backend, Claude-only group, and sort=tokens|cost|subagents|duration. Returns at most 20 tasks, unattached_codex, per-client coverage and partial=true. Claude-only workflowRunId or workflowName narrows the list to one workflow run.
GET /api/users/tasks/detailRequired list-row id, userExact and the same range bounds. Returns task, lanes, spans, truncated, span_total and why. Both a nonexistent task and an owner/range mismatch return 404. Claude tasks also return environment: the session's MCP servers and loaded plugins.

UI walkthrough · Complete task fields, identity validation and linking rules

Codex diagnostic Trace preview

The default GET /api/codex/insights profile includes traces, span latency aggregates and coverage.traces. It returns the latest 50 traces with up to the latest 200 spans each. These bounds differ from Task Trace detail's 5,000-span bound.

Statistics describe the displayed spans. A model filter applies only to spans carrying model attributes. Truncation or conflicting span identities can withhold trace-level duration/error statistics and detail. No metric or trace token observation is added to completion-log usage or cost.

The effort, tools and performance profiles do not query traces: not_requested coverage is not evidence of absent collection. profile=tools alone accepts userExact; every Codex insights profile rejects modelExact.

Open the Trace tab · Preview limits and coverage