---
title: "Launch a new session"
method: POST
path: "/sessions"
tags: ["Sessions"]
---

# Launch a new session

`POST /sessions`

Create and start a new Claude Code session

## Request body

- CreateSessionRequest
  - `query` string, required — Initial query for Claude
  - `title` string — Optional title for the session
  - `model` 'opus' | 'sonnet' | 'haiku' — Model to use for the session
  - `mcp_config` MCPConfig
    - `mcpServers` object — Map of server name to configuration
  - `permission_prompt_tool` string — MCP tool for permission prompts
  - `working_dir` string — Working directory for the session
  - `max_turns` integer — Maximum conversation turns
  - `system_prompt` string — Override system prompt
  - `append_system_prompt` string — Text to append to system prompt
  - `allowed_tools` string[] — Whitelist of allowed tools
  - `disallowed_tools` string[] — Blacklist of disallowed tools
  - `additional_directories` string[] — Additional directories Claude can access
  - `custom_instructions` string — Custom instructions for Claude
  - `auto_accept_edits` boolean — Enable auto-accept for edit tools
  - `dangerously_skip_permissions` boolean — Launch session with dangerously skip permissions enabled
  - `dangerously_skip_permissions_timeout` integer, nullable — Optional default timeout in milliseconds for dangerously skip permissions
  - `verbose` boolean — Enable verbose output
  - `proxy_enabled` boolean — Enable proxy routing for this session
  - `proxy_base_url` string — Base URL for proxy service
  - `proxy_model_override` string — Model identifier for proxy routing
  - `proxy_api_key` string — API key for proxy authentication
  - `draft` boolean — Create session in draft state without launching Claude
  - `createDirectoryIfNotExists` boolean — Create the working directory if it does not exist

## Response `201`

Session created successfully

- CreateSessionResponse
  - `data` object, required
    - `session_id` string, required — Created session ID
    - `run_id` string, required — Created run ID

## Other responses

- `400` — Bad request
- `422` — Directory does not exist and needs to be created
- `500` — Internal server error

---

[API](https://skmtc.net/humanlayer/apis/humanlayer-daemon-rest-api.md) · [All operations](https://skmtc.net/humanlayer/apis/humanlayer-daemon-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/humanlayer/humanlayer-daemon-rest-api/versions/02da8cb8aa12/schema)
