---
title: "Create a chat session"
method: POST
path: "/chat/sessions"
tags: ["Chat"]
---

# Create a chat session

`POST /chat/sessions`

## Request

- Base URL: `https://api-docs.jackhamr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api-docs.jackhamr.ai/chat/sessions`
- Auth: none declared

Create a new chat session in the caller's org.

The ``agent_id`` must belong to the caller's org; otherwise a 422
``agent_not_found`` is returned (so a bad agent id is distinguishable
from a not-found session). The session's ``token_max`` is resolved
from the agent's model context window via
:func:`resolve_agent_token_max`, matching the internal chat router.

## Request body

- ChatSessionCreate: Request body for ``POST /api/v1/chat/sessions``.
  - `agent_id` string, required
  - `title` string, nullable

## Response `201`

Successful Response

- ChatSessionOut: A chat session as returned by ``GET/POST /api/v1/chat/sessions``.
  - `id` string, required
  - `agent_id` string, required
  - `user_id` string, required
  - `title` string, required
  - `token_used` integer
  - `token_max` integer
  - `tool_call_count` integer
  - `is_favorite` boolean
  - `active_orchestrator_skill_id` string, nullable
  - `preferred_model_id` string, nullable
  - `runtime_id` string, nullable
  - `runtime_model` string, nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

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