open-agents-ai 0.184.30 → 0.184.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +92 -0
  2. package/dist/index.js +1267 -337
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -239,6 +239,98 @@ Pipe to `jq`, ingest into monitoring systems, or feed to other agents.
239
239
 
240
240
  Shows per-process RAM and CPU usage before killing. Detects: cloudflared tunnels, nexus daemons, headless Chrome, TTS servers, Python REPLs, stale OA instances.
241
241
 
242
+ ### REST API Service (Port 11435)
243
+
244
+ Open Agents runs a persistent REST API — like Ollama's `/api/` surface but with agentic task execution, OpenAI compatibility, and full TUI command access.
245
+
246
+ ```bash
247
+ oa serve # Start on default port 11435
248
+ oa serve --port 9999 # Custom port
249
+ OA_API_KEY=secret oa serve # Enable Bearer token auth
250
+ ```
251
+
252
+ **Health & Observability:**
253
+
254
+ ```bash
255
+ curl http://localhost:11435/health # → {"status":"ok","uptime_s":123}
256
+ curl http://localhost:11435/health/ready # → {"status":"ready","ollama":"reachable"} or 503
257
+ curl http://localhost:11435/version # → {"version":"0.184.31","node":"v24.14.0","platform":"linux"}
258
+ curl http://localhost:11435/metrics # → Prometheus text format (request counts, tokens, errors)
259
+ ```
260
+
261
+ **OpenAI-Compatible Inference** (drop-in for any OpenAI client library):
262
+
263
+ ```bash
264
+ # List models (52 models in OpenAI format)
265
+ curl http://localhost:11435/v1/models
266
+
267
+ # Chat completions (non-streaming)
268
+ curl -X POST http://localhost:11435/v1/chat/completions \
269
+ -H "Content-Type: application/json" \
270
+ -d '{"model":"qwen3.5:9b","messages":[{"role":"user","content":"Hello"}]}'
271
+ # → {"id":"chatcmpl-...","choices":[{"message":{"role":"assistant","content":"Hi there!"}}],"usage":{"prompt_tokens":25,"completion_tokens":5}}
272
+
273
+ # Chat completions (SSE streaming)
274
+ curl -N -X POST http://localhost:11435/v1/chat/completions \
275
+ -H "Content-Type: application/json" \
276
+ -d '{"model":"qwen3.5:9b","messages":[{"role":"user","content":"Hello"}],"stream":true}'
277
+ # → data: {"choices":[{"delta":{"content":"Hi"}}]}\n\ndata: {"choices":[{"delta":{"content":" there"}}]}\n\n...data: [DONE]
278
+ ```
279
+
280
+ **Agentic Task Execution** (the unique OA capability):
281
+
282
+ ```bash
283
+ # Submit an agentic task
284
+ curl -X POST http://localhost:11435/v1/run \
285
+ -H "Content-Type: application/json" \
286
+ -d '{"prompt":"fix the null check in auth.ts","model":"qwen3.5:9b","stream":true}'
287
+
288
+ # List runs
289
+ curl http://localhost:11435/v1/runs
290
+
291
+ # Abort a run
292
+ curl -X DELETE http://localhost:11435/v1/runs/run-abc123
293
+ ```
294
+
295
+ **Configuration:**
296
+
297
+ ```bash
298
+ curl http://localhost:11435/v1/config # Get all settings
299
+ curl http://localhost:11435/v1/config/model # → {"model":"qwen3.5:122b"}
300
+ curl -X PUT http://localhost:11435/v1/config/model \
301
+ -H "Content-Type: application/json" -d '{"model":"qwen3.5:27b"}'
302
+ curl http://localhost:11435/v1/config/endpoint # → {"url":"...","backendType":"..."}
303
+ ```
304
+
305
+ **Slash Commands via REST:**
306
+
307
+ ```bash
308
+ curl http://localhost:11435/v1/commands # List all 100+ commands
309
+ curl -X POST http://localhost:11435/v1/commands/stats # Execute /stats
310
+ curl -X POST http://localhost:11435/v1/commands/nexus # Execute /nexus status
311
+ ```
312
+
313
+ | Method | Endpoint | Description |
314
+ |--------|----------|-------------|
315
+ | GET | `/health` | Liveness check |
316
+ | GET | `/health/ready` | Readiness (probes Ollama) |
317
+ | GET | `/health/startup` | Startup complete |
318
+ | GET | `/version` | OA + Node version |
319
+ | GET | `/metrics` | Prometheus metrics |
320
+ | GET | `/v1/models` | List models (OpenAI format) |
321
+ | POST | `/v1/chat/completions` | Chat inference (OpenAI compatible, streaming + non-streaming) |
322
+ | POST | `/v1/embeddings` | Generate embeddings |
323
+ | POST | `/v1/run` | Submit agentic task |
324
+ | GET | `/v1/runs` | List runs |
325
+ | GET | `/v1/runs/:id` | Run status |
326
+ | DELETE | `/v1/runs/:id` | Abort run |
327
+ | GET | `/v1/config` | All settings |
328
+ | PATCH | `/v1/config` | Update settings |
329
+ | GET/PUT | `/v1/config/model` | Current/switch model |
330
+ | GET/PUT | `/v1/config/endpoint` | Current/switch endpoint |
331
+ | GET | `/v1/commands` | List slash commands |
332
+ | POST | `/v1/commands/:cmd` | Execute command |
333
+
242
334
  ### Enterprise Licensing
243
335
 
244
336
  Free for non-commercial use under CC-BY-NC-4.0. For enterprise/commercial licensing, contact [zoomerconsulting.com](https://zoomerconsulting.com).