agentuse serve. Integrate with external services, CI/CD pipelines, or any system that can make HTTP requests.
Quick Start
- Start the daemon:
- Trigger an agent via HTTP:
Serving Multiple Projects
AgentUse runs one serve daemon at a time. Repeat-C on that daemon to serve multiple project roots:
project, multi-project requests return 400 PROJECT_REQUIRED unless a default is set:
project fields override the default.
Global config
You can put serve defaults in~/.agentuse/config.json. See Configuration Files for the schema and CLI override behavior.
Environment isolation
Each project loads its own.env / .env.local in its worker process; env vars never mix across projects.
API Reference
All JSON endpoints live under the/api/* prefix. The root paths (/agents,
/sessions, /schedules, /stores, /approvals) serve the HTML dashboard
pages instead. The per-session page /sessions/:id and its action subroutes
carry their own capability auth (session token / API key / local); see
Approval Gates.
POST /run, POST /resume/:id, and the POST /approvals/:id/... action
endpoints are also still reachable at their original (un-prefixed) paths for
backward compatibility. GET /approvals/:id now redirects to /sessions/:id.
Prefer the /api/* and /sessions paths; the legacy aliases will be removed in
a future release.GET /api
Returns version, default project, and served projects. (GET / serves the HTML
dashboard built from the same data.)
POST /api/run
Execute an agent and receive the result. (Legacy alias:POST /run.)
Request:
| Field | Type | Required | Description |
|---|---|---|---|
agent | string | Yes | Path to agent file (relative to that project’s root) |
project | string | Conditional | Required in multi-project mode unless --default is set |
prompt | string | No | Additional prompt appended to agent instructions |
model | string | No | Override model in agent file |
timeout | number | No | Max execution time in seconds (default: 300) |
maxSteps | number | No | Max tool call steps |
| Error Code | HTTP Status | Description |
|---|---|---|
AGENT_NOT_FOUND | 404 | Agent file doesn’t exist |
PROJECT_NOT_FOUND | 404 | Unknown project id in multi-project mode |
PROJECT_REQUIRED | 400 | Multi-project request without project or --default |
INVALID_PATH | 400 | Path outside project root |
INVALID_REQUEST | 400 | Invalid JSON body |
MISSING_FIELD | 400 | Required field missing |
TIMEOUT | 504 | Execution timed out |
EXECUTION_ERROR | 500 | Runtime error |
GET /api/agents
Lists the agents the daemon loaded as JSON.path matches what POST /api/run
expects. (The browsable HTML page is at /agents.)
For one agent’s capability summary and raw source, use
GET /api/agents/detail?project=<id>&path=<agent-path>. The path must match an
agent already loaded by that project; the browsable detail hub is at
/agents/<project>/<agent-path>.
GET /api/schedules
Lists scheduled agents as JSON, soonest next run first. (The browsable HTML page is at/schedules.)
agentuse serve agents and agentuse serve schedules render these as tables. See CLI Commands.
GET /api/sessions
Lists every run (top-level sessions; subagent sessions are excluded) as JSON, newest first. Filter with?agent=<id>, ?trigger=scheduled|manual|slack|api,
and ?days=<n|all> (default ~7 days). The browsable HTML page is at /sessions.
trigger records how the run started: scheduled (the built-in scheduler),
api (POST /api/run), slack, or manual (CLI runs and the default).
GET /api/sessions/:id
Returns one session including its run-log entries. API-key gated.Streaming Response
For real-time output, request NDJSON streaming:Authentication
When exposing the server externally, authentication is required:Exposing Your Local Server
- Tailscale (Private)
- Cloudflare Tunnel (Public)
Access from your devices or team only:Connect via
http://<machine-name>:12233 from any device on your tailnet.Integration Examples
GitHub Webhook
Create an agent to handle GitHub events:Slack Integration
Slack slash commands require a response within 3 seconds and signature verification. Use a workflow tool as middleware: With n8n or Make:- Add Slack trigger node (receives slash commands)
- Add HTTP Request node → POST to
http://server:12233/api/run - Return agent response to Slack
- Trigger: Slack → New Slash Command
- Action: Webhooks → POST to AgentUse
/run - Action: Slack → Send Channel Message with result
Direct Slack integration requires handling the 3-second timeout, form-urlencoded parsing, and request signature verification. Workflow tools handle this automatically.
n8n / Make / Zapier
Use HTTP request nodes to trigger agents:- Set URL to
http://your-server:12233/api/run - Method: POST
- Headers:
Content-Type: application/json - Body:
Cron Job (External)
Trigger from system cron instead of built-in scheduler:Server Configuration
See CLI Commands - agentuse serve for all server options including port, host, debug mode, and authentication configuration.Production Deployment
For deployingagentuse serve in production with reverse proxies (nginx), process management (PM2), and Docker, see Self-Hosting.
Next Steps
Scheduled Agents
Run agents on a cron schedule
Self-Hosting
Deploy in production