---
title: "Create a new chat session with an initial message"
method: POST
path: "/chat/sessions"
tags: ["chat"]
---

# Create a new chat session with an initial message

`POST /chat/sessions`

## Request body

- CreateChatSessionRequest
  - `config` ChatSessionConfig — Configuration for chat session with system prompt and LLM key
    - `is_onboarding_session` boolean, required
    - `llm_key` 'vllm.gpt-5-mini-2025-08-07' | 'vllm.gpt-4.1-mini-2025-04-14' | 'vllm.gpt-5-nano-2025-08-07' | 'vllm.gpt-5-2025-08-07' | 'vllm.ft:gpt-4o-2024-08-06:structify::ADrF00Gq' | 'vllm.ft:gpt-4o-mini-2024-07-18:structify::ABCLHTsN' | 'vllm.action' | 'vllm.dora' | 'vllm.boring_dora' | 'vllm.claude-3-7-sonnet-20250219' | 'vllm.claude-sonnet-4-20250514' | 'vllm.qwen-3-coder-480b' | 'test_llm.test' | 'bedrock.claude-sonnet-4-bedrock' | 'bedrock.claude-sonnet-4-5-bedrock' | 'bedrock.claude-opus-4-5-bedrock' | 'bedrock.claude-haiku-4-5-bedrock' | 'gemini.gemini-2.5-pro' | 'gemini.gemini-2.5-flash' | 'gemini.gemini-3-pro-preview' | 'gemini.gemini-3-flash-preview' | 'vertex_anthropic.claude-sonnet-4-5-vertex' — LLM model keys available in the system. Format: <provider>.<model-name>
    - `max_steps` integer, nullable
    - `reminder_message` string, nullable
    - `system_prompt` string, nullable
  - `ephemeral` boolean, nullable
  - `initial_message` string, nullable
  - `project_id` string, uuid
  - `team_id` string, uuid, required

## Response `201`

Chat session created successfully

- CreateChatSessionResponse — Response for creating a chat session
  - `session` ChatSessionWithMessages, required
    - `commits` GitCommit[], required
      - `chat_session_id` string, uuid, required
      - `commit_hash` string, required
      - `created_at` string, date-time, required
      - `id` string, uuid, required
    - `created_at` string, date-time, required
    - `git_application_token` string, required
    - `id` string, uuid, required
    - `is_favorite` boolean, required
    - `latest_workflow_session_id` string, uuid
    - `messages` ChatMessage[], required
      - `chat_session_id` string, uuid, required
      - `content` string, required
      - `content_proto` string, binary, nullable
      - `created_at` string, date-time, required
      - `git_commit_id` string, uuid, nullable
      - `id` string, uuid, required
      - `role` string, required
      - `slack_channel_id` string, nullable
      - `slack_message_ts` string, nullable
      - `slack_thread_ts` string, nullable
      - `stream_chunks` StreamChunkEntry[], nullable
        - `chunk_type` string, required
        - `content` string, required
      - `teams_channel_id` string, nullable
      - `teams_conversation_id` string, nullable
      - `teams_message_id` string, nullable
      - `timestamp` string, date-time, required
    - `name` string, nullable
    - `project_id` string, uuid
    - `skip_confirmations` boolean, required
    - `slack_channel_id` string, nullable
    - `slack_team_id` string, nullable
    - `slack_thread_ts` string, nullable
    - `team_id` string, uuid, required
    - `updated_at` string, date-time, required
    - `user_message_needed` boolean, required
    - `user_role` 'viewer' | 'editor' | 'owner', required
    - `visibility` 'private' | 'shared_with_team' | 'public', required

## Other responses

- `400` — Bad request
- `403` — Forbidden - user does not have write access to team
- `404` — Project not found
- `500` — Internal server error

---

[API](https://skmtc.net/structifyai/apis/structify.md) · [All operations](https://skmtc.net/structifyai/apis/structify/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/structifyai/structify/versions/1364930b6980/schema)
