v1

latestSwagger 2.02026-07-175445133.1 KB
claude

Create Claude messages using CLI

Creates a completion using the claude CLI tool as a subprocess, supporting both streaming and non-streaming responses, with resume functionality

post/v1/claude/messages

Request body

disable_toolsboolean

Whether to disable all tools (Claude will only use context, no tool calls)

forkboolean

Whether to fork the session instead of resuming (doesn't pollute original session history) Defaults to true when resuming unless explicitly set to false

max_turnsinteger

Maximum number of turns in the conversation

modelstring

Optional model override

promptstring

The prompt/message to send to claude

resumeboolean

Whether to resume the most recent session for this working directory

streamboolean

Whether to stream the response

suppress_eventsboolean

Whether to suppress stop events for this automated operation

system_promptstring

Optional system prompt override

working_directorystring

Working directory for the claude command

Example request

{
  "disable_tools": true,
  "fork": true,
  "max_turns": 10,
  "model": "claude-3-5-sonnet-20241022",
  "prompt": "Help me debug this error",
  "resume": true,
  "stream": true,
  "suppress_events": true,
  "system_prompt": "You are a helpful coding assistant",
  "working_directory": "/workspace/my-project"
}

Response

OK

errorstring

Any error that occurred

is_chunkboolean

Whether this is a streaming chunk or complete response

is_lastboolean

Whether this is the last chunk in a stream

responsestring

The generated response text

Example response

{
  "is_last": true,
  "response": "I can help you debug that error..."
}