---
title: "Get Project Chat"
method: GET
path: "/api/v1/project/{project_id}/chats"
tags: ["project"]
---

# Get Project Chat

`GET /api/v1/project/{project_id}/chats`

Get the chat for a specific project.

Args:
    project_id: The ID of the project to get chat for (validated for read access).
    agent_service: The AgentService instance (dependency).
    user_repo: User repository for resolving sender display names.
    project_repo: Project repository for checking project visibility.
    user_profile: Current user's profile for internal status check.

Returns:
    The chat history for the project, or None if no chat exists.

Raises:
    HTTPException: 400 for validation errors.
    HTTPException: 404 if project not found or user doesn't have access.
    HTTPException: 500 for unexpected errors.

## Response `200`

Successful Response

- ChatHistoryResponseSchema — Schema for the chat history of a project.
  - `chat` ChatHistorySchema, required — Schema for a single chat with its full history.
    - `project_id` string, required
    - `chat_history` union[], required
      - union
        - ModelRequest — A request generated by Pydantic AI and sent to a model, e.g. a message from the Pydantic AI app to the model.
          - `parts` union[], required
            - union
              - …
          - `timestamp` string, date-time, nullable
          - `instructions` string, nullable
          - `kind` 'request'
          - `run_id` string, nullable
          - `conversation_id` string, nullable
          - `metadata` object, nullable
          - `state` 'complete' | 'interrupted'
        - ModelResponse — A response from a model, e.g. a message from the model to the Pydantic AI app.
          - `parts` union[], required
            - union
              - …
          - `usage` RequestUsage — LLM usage associated with a single request. This is an implementation of `genai_prices.types.AbstractUsage` so it can be used to calculate the price of the request using [genai-prices](https://github.com/pydantic/genai-prices).
            - `input_tokens` integer
            - `cache_write_tokens` integer
            - `cache_read_tokens` integer
            - `output_tokens` integer
            - `input_audio_tokens` integer
            - `cache_audio_read_tokens` integer
            - `output_audio_tokens` integer
            - `details` object
          - `model_name` string, nullable
          - `timestamp` string, date-time
          - `kind` 'response'
          - `provider_name` string, nullable
          - `provider_url` string, nullable
          - `provider_details` object, nullable
          - `provider_response_id` string, nullable
          - `finish_reason` 'stop' | 'length' | 'content_filter' | 'tool_call' | 'error', nullable
          - `run_id` string, nullable
          - `conversation_id` string, nullable
          - `metadata` object, nullable
          - `state` 'complete' | 'incomplete' | 'suspended' | 'interrupted'
    - `active_run_id` string, nullable — Workflow id of a currently-live chat run for this project, or None. Populated only when a run is genuinely in flight (DBOS ACTIVE) — the FE uses it to re-attach to the durable stream after a mid-run page refresh instead of showing static (pre-completion) history.
    - `last_turn_continuable` boolean — True when the most recent persisted turn failed terminally mid-way and left a continuable partial. The FE renders the Continue affordance on the last turn after a refresh, when the live partial_result terminal frame is no longer available.
    - `selected_model` string, nullable — The chat's persisted model-picker selection (a curated picker key), or None for the default chain. Seeds the composer dropdown.
  - `users` object — Map of user_id to display info for message attribution.

---

[API](https://skmtc.net/maia-analytics/apis/maia-api.md) · [All operations](https://skmtc.net/maia-analytics/apis/maia-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/maia-analytics/maia-api/versions/ba2b8d962161/schema)
