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 3000Environment variables
| Variable | Description |
|---|---|
MIN_AGENT_SERVE_HOST | Bind address (default 127.0.0.1) |
MIN_AGENT_SERVE_PORT | Port (default 8787) |
MIN_AGENT_SERVE_TOKEN | Bearer token auth |
MIN_AGENT_SERVE_CORS | Set to 1 to enable CORS |
Common endpoints
| Method | Path | Description |
|---|---|---|
| GET | /health | Health check |
| GET | /v1/models | Model list |
| POST | /v1/chat | Chat (project-aware) |
| GET | /v1/sessions | List sessions |
| GET | /v1/diff | Uncommitted 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_TOKENis required or the server refuses to start /v1/chatand friends accept up to 8 concurrent requests; beyond that returns429- Session IDs accept only
[A-Za-z0-9_-]+to prevent path traversal