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

# Genai Conversation Chat

`POST /agents/conversations/chat`

## Request body

- AgentConversationChatReq — Request to get the multi-turn chat view for a conversation.
  - `project_id` string, required
  - `conversation_id` string, required
  - `limit` integer — Maximum number of conversation turns to return.
  - `offset` integer — Number of most-recent turns to skip. Results are returned in chronological order within the selected page.
  - `include_feedback` boolean

## Response `200`

Successful Response

- AgentConversationChatRes — Multi-turn chat view: an ordered list of per-turn chat responses. Each entry in `turns` corresponds to one trace_id, which Weave treats as one conversation turn. This is not necessarily one `invoke_agent` span: a turn can contain zero, one, or many agent invocations. The frontend can render turn-number dividers between entries and still reuse `AgentTraceChatRes` rendering for each individual turn.
  - `conversation_id` string, required
  - `turns` AgentTraceChatRes[]
    - `trace_id` string, required
    - `root_span_name` string, nullable
    - `agent_name` string, nullable
    - `agent_version` string, nullable
    - `status_code` 'UNSET' | 'OK' | 'ERROR', nullable
    - `provider` string, nullable
    - `total_duration_ms` integer, nullable — Wall-clock duration of the trace root span in milliseconds. This is not a sum of child span durations.
    - `total_cost_usd` number, nullable
    - `messages` AgentChatMessage[]
      - `type` 'user_message' | 'assistant_message' | 'tool_call' | 'agent_handoff' | 'agent_start' | 'context_compacted', required
      - `span_id` string, nullable
      - `agent_name` string, nullable
      - `agent_version` string, nullable
      - `status_code` 'UNSET' | 'OK' | 'ERROR', nullable
      - `started_at` string, date-time, nullable
      - `user_message` AgentChatUserMessage — Payload for a user prompt in the chat timeline.
        - `text` string, required
        - `content_refs` string[]
      - `assistant_message` AgentChatAssistantMessage — Payload for assistant text emitted by an agent or LLM span.
        - `text` string, required
        - `model` string, nullable
        - `reasoning_content` string, nullable
        - `reasoning_tokens` integer, nullable
        - `input_tokens` integer, nullable
        - `output_tokens` integer, nullable
        - `input_cost_usd` number, nullable
        - `output_cost_usd` number, nullable
        - `total_cost_usd` number, nullable
        - `duration_ms` integer, nullable
        - `status` 'UNSET' | 'OK' | 'ERROR', nullable
        - `content_refs` string[]
      - `tool_call` AgentChatToolCall — Payload for a tool call timeline event.
        - `tool_name` string, nullable
        - `tool_arguments` string, nullable
        - `tool_result` string, nullable
        - `duration_ms` integer, nullable
        - `status` 'UNSET' | 'OK' | 'ERROR', nullable
        - `content_refs` string[]
      - `agent_start` AgentChatAgentStart — Payload for an agent lifecycle boundary.
        - `model` string, nullable
        - `system_instructions` string, nullable
        - `tool_definitions` string, nullable
        - `status` 'UNSET' | 'OK' | 'ERROR', nullable
      - `agent_handoff` AgentChatAgentHandoff — Payload for a future agent-to-agent handoff event.
      - `context_compacted` AgentChatContextCompacted — Payload for a context-window compaction event.
        - `compaction_summary` string, nullable
        - `compaction_items_before` integer, nullable
        - `compaction_items_after` integer, nullable
      - `feedback` object[], nullable
    - `feedback` object[], nullable
  - `total_turns` integer
  - `has_more` boolean
  - `limit` integer
  - `offset` integer
  - `total_cost_usd` number, nullable
  - `feedback` object[], nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/wandb/apis/serverless-training.md) · [All operations](https://skmtc.net/wandb/apis/serverless-training/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/wandb/serverless-training/revisions/8d8d96fc0fd3/schema)
