Skip to main content

Module server

Module server 

Source
Expand description

HTTP server wrapper for exposing an agent as a REST API.

Provides POST /prompt, POST /prompt/stream (SSE), and GET /health endpoints. Optionally requires API key authentication via Authorization: Bearer <key> or X-API-Key: <key> headers.

use daimon::server::AgentServer;

let server = AgentServer::new(agent)
    .bind("0.0.0.0:8080")
    .api_key("my-secret-key");
server.serve().await?;

Structs§

AgentServer
HTTP server wrapper around an Agent.
PromptRequest
Request body for POST /prompt.
PromptResponse
Response body from POST /prompt.