Skip to content

API Access

min-agent serve starts a local HTTP server so other apps can call min-agent programmatically. With no provider configured, the built-in OpenRouter model is used — no need to run min-agent setup first.

bash
min-agent serve
min-agent serve --host 0.0.0.0 --port 3000

Environment variables

VariableDescription
MIN_AGENT_SERVE_HOSTBind address (default 127.0.0.1)
MIN_AGENT_SERVE_PORTPort (default 8787)
MIN_AGENT_SERVE_TOKENBearer token auth
MIN_AGENT_SERVE_CORSSet to 1 to enable CORS

Common endpoints

MethodPathDescription
GET/healthHealth check
GET/v1/modelsModel list
POST/v1/chatChat (project-aware)
GET/v1/sessionsList sessions
GET/v1/diffUncommitted workspace changes

See the full API reference for every endpoint and request/response format.

Security notes

  • When the bind address is not loopback, MIN_AGENT_SERVE_TOKEN is required or the server refuses to start
  • /v1/chat and friends accept up to 8 concurrent requests; beyond that returns 429
  • Session IDs accept only [A-Za-z0-9_-]+ to prevent path traversal

MIT Licensed