---
title: "Fork chat"
method: POST
path: "/v1/replica/{id}/chats/{chat_id}/fork"
tags: ["Chats"]
---

# Fork chat

`POST /v1/replica/{id}/chats/{chat_id}/fork`

## Request

- Base URL: `https://api.replicas.dev`
- URL: `https://api.replicas.dev/v1/replica/{id}/chats/{chat_id}/fork`
- Auth: HTTP bearer

Starts a new chat that continues from this chat's history, optionally on another coding agent and with a first message. The replica must be active.

## Path parameters

- `id` string, uuid, required
- `chat_id` string, required

## Headers

- `X-Replicas-Api-Version` '2026-10-07'

## Request body

- ForkChatRequest: Request body for continuing an existing chat on another coding agent harness
  - `provider` 'claude' | 'codex' | 'cursor' | 'opencode' | 'pi', required: Harness to continue the chat on. It must have credentials connected in the workspace.
  - `model` string: Model for the forked chat. Defaults to the harness default.
  - `thinking_level` 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | 'ultracode': Reasoning effort for the forked chat
  - `title` string: Title for the forked chat. Defaults to a title derived from the source chat.
  - `message` string: Optional first instruction for the new harness, sent alongside the inherited context. Empty or whitespace-only values preserve the default continuation behavior.
  - `id` string, uuid: Optional client-generated chat ID.
  - `client_request_id` string: Opaque client-chosen id echoed back in the `chat.created` event
  - `enable_interactive_tools` boolean: Allow the forked chat's first turn to use interactive tools

## Response `201`

Created

- ForkWorkspaceChatResponse
  - `chat` WorkspaceChat, required
    - `id` string, uuid, required
    - `provider` 'claude' | 'codex' | 'cursor' | 'muse' | 'opencode' | 'pi', required
    - `model` string: Selected model retained for future messages in this chat.
    - `title` string, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `processing` boolean, required
    - `parent_chat_id` string, uuid, nullable, required
    - `last_message_text` string, nullable
    - `fork` ChatFork: Set on a chat that was forked from another chat in the same workspace
      - `source` object, required: The chat this one was forked from
        - `chat_id` string, uuid, required
        - `provider` 'claude' | 'codex' | 'cursor' | 'opencode' | 'pi', required
        - `title` string, required
      - `trigger` 'manual' | 'auto', required: `manual` for a requested fork, `auto` when the source harness hit its usage limit and the owner opted into automatic fallback
      - `reason` 'rate_limit' | 'out_of_credits': Why an automatic fork happened
      - `state` 'preparing' | 'ready' | 'failed', required: `preparing` while the transcript handoff is assembled; `processing` stays true until it leaves this state
      - `error` string: Failure reason when `state` is `failed`
      - `started_at` string, date-time, required
      - `completed_at` string, date-time

## Other responses

- `400`: Bad request - Missing or invalid parameters
- `401`: Unauthorized - Invalid or missing API key
- `404`: Resource not found
- `409`: Conflict - Resource already exists or operation conflicts with current state
- `500`: Internal server error

---

[API](https://skmtc.dev/replicas/apis/replicas-api.md) - [All operations](https://skmtc.dev/replicas/apis/replicas-api/llms.txt) - [OpenAPI document](https://skmtc.dev/replicas/apis/replicas-api/revisions/2703ac1c9cb7?raw)
