Expand description
HTTP API server for the Recursive agent.
Provides a lightweight axum-based HTTP server that exposes the agent’s tool registry as a read-only JSON endpoint, a health check, a POST /run endpoint that executes the agent with a given goal, session management endpoints for multi-turn conversations, and SSE streaming of agent events.
Structs§
- AppState
- Shared application state for the HTTP server.
- Auth
Config - API key authentication for the HTTP server.
- Create
Session Request - Request body for
POST /sessions. - Create
Session Response - Response body for
POST /sessions. - Error
Response - Error response body.
- Goal
Response - Response body for goal mutation endpoints.
- JwtConfig
- JWT bearer token verification config.
- List
Sessions Query - Query parameters for
GET /sessions. - Metrics
- Prometheus-compatible metrics collector using lock-free atomic counters.
- Rate
Limiter - Token-bucket rate limiter keyed by client identifier (API key or remote IP).
- RunRequest
- Request body for
POST /run. - RunResponse
- Successful response from
POST /run. - Session
Detail Response - Detail response for
GET /sessions/:id. - Session
Info - Serialized session info for list/detail endpoints.
- Session
Message Request - Request body for
POST /sessions/:id/messages. - Session
Message Response - Response body for
POST /sessions/:id/messages. - Session
State - Internal session state (not directly serialized to clients).
- SetGoal
Request - Request body for
POST /sessions/:id/goal. - Slash
Command Info - One slash command entry in
GET /slash-commands. - Tool
Info - Serializable tool info for the
/toolsendpoint. - Usage
Info - Token/step usage information.
Enums§
- SseContent
Block - A single block of message content (mirrors Claude Agent SDK’s
TextBlock/ToolUseBlock). Emitted as part ofSseEvent::Messageso SDK clients can iteratefor block in msg.contentwithout doing a second round-trip to the session detail endpoint. - SseEvent
- Server-Sent Event payload emitted during an agent session run.
Functions§
- build_
openapi_ spec - Build a static OpenAPI 3.0.3 specification describing all API endpoints.
- build_
router - Build the axum
Routerwith all API routes. - build_
router_ with_ auth - Build the HTTP router with an explicit
AuthConfig. - build_
router_ with_ auth_ and_ rate_ limit - Build the HTTP router with an explicit
AuthConfigAND an explicitRateLimiter. - map_
agent_ event - Map an
AgentEventto anSseEventfor broadcasting to SSE clients.