---
title: "Create interactive chat session"
method: POST
path: "/agent/v2/chat"
tags: ["Agents"]
---

# Create interactive chat session

`POST /agent/v2/chat`

Creates a persistent OpenCode chat session backed by a Daytona runtime. Session state is retained and can be resumed or recovered across requests.

## Request body

- object
  - `title` string — Optional human-readable session title
  - `model` string, nullable — Optional model override for the OpenCode session
  - `idleTimeoutMs` integer, nullable — Idle timeout before the runtime is eligible to stop. Defaults to 15 minutes.
  - `instructions` string, nullable — Optional hidden app instructions merged into the chat runtime bootstrap and never exposed as a user message. Only accepted for privileged C3 system keys.
  - `vaultIds` string[], nullable — Restrict the chat session to specific vault IDs

## Response `200`

Chat session created

- object
  - `id` string
  - `status` string
  - `provider` 'daytona'
  - `runtimeState` string
  - `idleTimeoutMs` integer
  - `createdAt` string, date-time

## Other responses

- `401` — Invalid API key
- `403` — No agent access or non-API-key auth

## Changes

- **2026-04-14** `732bdf45b540` — 1 info
  - added the new optional request property `instructions`
- **2026-03-27** `220d723a75ba` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/casemark/apis/case-dev-api/changes/agent/v2/chat/post.md)

---

[API](https://skmtc.dev/casemark/apis/case-dev-api.md) · [All operations](https://skmtc.dev/casemark/apis/case-dev-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/casemark/case-dev-api/revisions/2a016c5bb11e/schema)
