---
title: "Create Session"
method: POST
path: "/api/v1/chat"
tags: ["Chat"]
---

# Create Session

`POST /api/v1/chat`

Create a chat session, optionally bound to indexes (locked after the first message).

## Query parameters

- `project_id` string, uuid, nullable
- `organization_id` string, uuid, nullable

## Cookies

- `session` string, nullable

## Request body

- SessionCreate — Request body for creating a chat session.
  - `index_ids` string[], nullable — Indexes this session will retrieve from. Once set and the first message has been sent, the source set is locked for the session's lifetime. Leave null to create an unbound session.

## Response `201`

Successful Response

- ChatSessionSummary — Summary of a chat session, including its title and last run metadata.
  - `session_id` string, required — Unique session identifier.
  - `generated_title` string, nullable — Auto-generated title derived from the first user message.
  - `last_updated_at` string, required — ISO-format timestamp showing when the session was last updated.
  - `job_metadata` JobMetadata
    - `total_input_tokens` integer, nullable
    - `total_output_tokens` integer, nullable
    - `turns` integer
    - `duration_ms` number
    - `is_error` boolean
    - `error` string, nullable
    - `export_config_ids` string[], nullable
  - `index_ids` string[], nullable — Indexes this session is bound to. Null on unbound sessions.

## Other responses

- `422` — Validation Error

## Changes

- **2026-06-09** `b17341164de9` — 2 info
  - added the optional property `detail/items/ctx` to the response with the `422` status
  - added the optional property `detail/items/input` to the response with the `422` status
- **2026-05-23** `34da5826db1c` — 1 info
  - endpoint added
- **2026-05-21** `fb63fb8d662c` — 1 breaking
  - api path removed without deprecation
- **2026-05-19** `64b8ab5b0a0a` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/run-llama/apis/llama-platform/changes/api/v1/chat/post.md)

---

[API](https://skmtc.dev/run-llama/apis/llama-platform.md) · [All operations](https://skmtc.dev/run-llama/apis/llama-platform/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/run-llama/llama-platform/revisions/b17341164de9/schema)
