POST /api/v1/call/stream
Preview. Ships with the next server release.
the same call, answered as NDJSON while it runs. Lines:
{"chunk": {"stream", "data", "dropped"?}, "seq": n} (or {"sealed_chunk": "...", "seq": n})
for each piece of output, then one last line, as /api/v1/call answers. The status is 200
once the call is sent; how it ended is in the last line.
Request body
| Field | Type | Always | Meaning |
|---|---|---|---|
args | any | no | |
machine | string | no | Machine id or unique name; optional when exactly one machine is online. |
sealed | string | no | The arguments sealed for the machine, instead of args. |
tool | string | yes |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | NDJSON stream of tool chunks and final result | application/x-ndjson string |
400 | Invalid call | application/json |
401 | Unauthorized | application/json |
Example
curl -sS -X POST "https://<contour>.cmdop.ai/api/v1/call/stream" \
-H "Authorization: Bearer $CMDOP_TOKEN" \
-H "Content-Type: application/json" \
-d '{"machine":"<machine>","tool":"sys_info","args":{}}'