Skip to content

HTTP API Overview

Recursive includes an axum-based HTTP server (recursive http) that exposes a REST API with sessions and SSE streaming.

Starting the server

bash
recursive http --addr 127.0.0.1:3000

Base URL

http://localhost:3000

Authentication

By default the API is open. To require an API key:

bash
recursive http --auth-keys key1,key2,key3

Then pass X-API-Key: key1 in request headers.

Endpoints summary

MethodPathDescription
GET/healthHealth check
GET/toolsList registered tools
POST/runStateless single-shot run
POST/sessionsCreate a new session
GET/sessionsList sessions
GET/sessions/:idGet session details
DELETE/sessions/:idDelete a session
POST/sessions/:id/runSend a message (SSE streaming)
GET/openapi.jsonOpenAPI 3.0 spec

Quick start

bash
# Start server
recursive http &

# Health check
curl http://localhost:3000/health
# → "ok"

# Create session
SESSION=$(curl -sX POST http://localhost:3000/sessions \
  -H 'Content-Type: application/json' \
  -d '{"system_prompt":"You are a helpful Rust assistant."}' \
  | jq -r .session_id)

# Run (streaming)
curl -N -X POST http://localhost:3000/sessions/$SESSION/run \
  -H 'Content-Type: application/json' \
  -d '{"message":"List the files in /workspace"}'

See the sub-pages for detailed documentation on each endpoint group.

Released under the MIT License.