---
title: "Create a session"
method: POST
path: "/session"
tags: ["Sessions"]
---

# Create a session

`POST /session`

## Request body

- CreateSessionRequest
  - `title` string
  - `agent` string — Agent ID or configured harness ID. For local DB agents, use `agent_id` or `agent`.
  - `agent_id` string
  - `harness` string
  - `runtime` string — Built-in runtime ID or runtime harness alias. When present, creates a runtime-backed session.
  - `prompt` string — Optional initial prompt. If present, the runtime session starts immediately.
  - `environment` object — Runtime-specific environment settings
    - `repository` string
    - `ref` string
    - `auto_create_pr` boolean
  - `timezone` string
  - `tz` string

## Response `200`

Session created

- Session
  - `id` string
  - `title` string
  - `agent` string
  - `agent_id` string
  - `harness` string
  - `runtime` string
  - `runtime_agent_ref_id` string, nullable
  - `provider_session_id` string, nullable
  - `provider_run_id` string, nullable
  - `status` 'pending' | 'running' | 'idle' | 'error'
  - `environment` object
  - `time` object
    - `created` integer
    - `updated` integer, nullable

## Other responses

- `401` — Unauthorized

---

[API](https://skmtc.net/litellm-agent-platform/apis/litellm-agent-platform-api.md) · [All operations](https://skmtc.net/litellm-agent-platform/apis/litellm-agent-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/litellm-agent-platform/litellm-agent-platform-api/versions/92039c29a228/schema)
