---
title: "Genai Traces Chat"
method: POST
path: "/agents/traces/chat"
tags: ["Agents"]
---

# Genai Traces Chat

`POST /agents/traces/chat`

## Request

- Base URL: `https://trace.wandb.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://trace.wandb.ai/agents/traces/chat`
- Auth: none declared

## Request body

- AgentTraceChatReq: Request to get the structured chat / trajectory view for a trace.
  - `project_id` string, required
  - `trace_id` string, required
  - `include_feedback` boolean
  - `include_model_tool_calls` boolean: Include tool calls requested in model outputs, even when no execution span was recorded, and place each execution span after the model span that requested it. Requests without execution evidence have no status, duration, or result. Defaults to false.

## Response `200`

Successful Response

- AgentTraceChatRes: Structured chat view: a linear sequence of messages representing the agent trajectory for a single trace.
  - `trace_id` string, required
  - `root_span_name` string, nullable, required
  - `agent_name` string, nullable, required
  - `agent_version` string, nullable, required
  - `status_code` 'UNSET' | 'OK' | 'ERROR', nullable, required
  - `provider` string, nullable, required
  - `started_at` string, date-time, nullable, required
  - `ended_at` string, date-time, nullable, required
  - `wb_user_id` string, nullable, required
  - `total_duration_ms` integer, nullable, required: Wall-clock duration of the trace root span in milliseconds. This is not a sum of child span durations.
  - `total_cost_usd` number, nullable, required
  - `total_input_tokens` integer, required
  - `total_output_tokens` integer, required
  - `total_reasoning_tokens` integer, required
  - `total_cache_creation_input_tokens` integer, required
  - `total_cache_read_input_tokens` integer, required
  - `messages` AgentChatMessage[], required
    - `type` 'user_message' | 'assistant_message' | 'tool_call' | 'agent_handoff' | 'agent_start' | 'context_compacted', required
    - `span_id` string, nullable, required
    - `agent_name` string, nullable, required
    - `agent_version` string, nullable, required
    - `status_code` 'UNSET' | 'OK' | 'ERROR', nullable, required
    - `error_type` string, nullable, required
    - `status_message` string, nullable, required
    - `started_at` string, date-time, nullable, required
    - `user_message` AgentChatUserMessage, required: Payload for a user prompt in the chat timeline.
      - `text` string, required
      - `content_refs` string[], required
    - `assistant_message` AgentChatAssistantMessage, required: Payload for assistant text emitted by an agent or LLM span.
      - `text` string, required
      - `model` string, nullable, required
      - `reasoning_content` string, nullable, required
      - `reasoning_tokens` integer, nullable, required
      - `input_tokens` integer, nullable, required
      - `output_tokens` integer, nullable, required
      - `input_cost_usd` number, nullable, required
      - `output_cost_usd` number, nullable, required
      - `total_cost_usd` number, nullable, required
      - `duration_ms` integer, nullable, required
      - `status` 'UNSET' | 'OK' | 'ERROR', nullable, required
      - `content_refs` string[], required
    - `tool_call` AgentChatToolCall, required: Payload for a tool call timeline event.
      - `tool_name` string, nullable, required
      - `tool_arguments` string, nullable, required
      - `tool_result` string, nullable, required
      - `duration_ms` integer, nullable, required
      - `status` 'UNSET' | 'OK' | 'ERROR', nullable, required
      - `content_refs` string[], required
    - `agent_start` AgentChatAgentStart, required: Payload for an agent lifecycle boundary.
      - `model` string, nullable, required
      - `system_instructions` string, nullable, required
      - `tool_definitions` string, nullable, required
      - `status` 'UNSET' | 'OK' | 'ERROR', nullable, required
    - `agent_handoff` AgentChatAgentHandoff, required: Payload for a future agent-to-agent handoff event.
    - `context_compacted` AgentChatContextCompacted, required: Payload for a context-window compaction event.
      - `compaction_summary` string, nullable, required
      - `compaction_items_before` integer, nullable, required
      - `compaction_items_after` integer, nullable, required
    - `feedback` AgentChatFeedback[], nullable, required
      - `id` string, required
      - `feedback_type` string, required
      - `weave_ref` string, required
      - `payload` object, required
      - `creator` string, nullable, required
      - `created_at` string, date-time, nullable, required
      - `wb_user_id` string, nullable, required
      - `runnable_ref` string, nullable, required
      - `call_ref` string, nullable, required
      - `trigger_ref` string, nullable, required
      - `annotation_ref` string, nullable, required
      - `scorer_tags` string[], required
      - `scorer_tag_reasons` object, required
      - `scorer_tag_confidences` object, required
      - `scorer_ratings` object, required
      - `scorer_rating_reasons` object, required
      - `scorer_rating_confidences` object, required
  - `feedback` AgentChatFeedback[], nullable, required
    - `id` string, required
    - `feedback_type` string, required
    - `weave_ref` string, required
    - `payload` object, required
    - `creator` string, nullable, required
    - `created_at` string, date-time, nullable, required
    - `wb_user_id` string, nullable, required
    - `runnable_ref` string, nullable, required
    - `call_ref` string, nullable, required
    - `trigger_ref` string, nullable, required
    - `annotation_ref` string, nullable, required
    - `scorer_tags` string[], required
    - `scorer_tag_reasons` object, required
    - `scorer_tag_confidences` object, required
    - `scorer_ratings` object, required
    - `scorer_rating_reasons` object, required
    - `scorer_rating_confidences` object, required

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-16** `dd89fadfe4e4`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/wandb/apis/fastapi/changes/agents/traces/chat/post.md)

---

[API](https://skmtc.dev/wandb/apis/fastapi.md) - [All operations](https://skmtc.dev/wandb/apis/fastapi/llms.txt) - [OpenAPI document](https://skmtc.dev/wandb/apis/fastapi/revisions/f7643c49bf2e?raw)
