Command reference
oko gateway send
The one model call as Oko. With --prompt, one chat completion — the prompt as the only user message — asked of the OpenAI-compatible service `oko model-service set` declared, with its model, or of Brama on Oko's declared route; Tama's model-judged guards ask through it. Without --prompt, one request to the gateway with the body from standard input. Bearer and signature are attached either way.
Invocation#
oko gateway send --prompt TEXT [--model NAME] [--router URL] | oko gateway send [--endpoint /v1/...] [--router URL] < body.jsonInputs and options#
- --prompt: the chat completion's text; --model names another route or model; --router another gateway, which also skips the declared service.
- --endpoint: a /v1/ path without query or fragment, /v1/chat/completions when omitted; only for a body on standard input.
Output and state effect#
- On success prints `{status, body, route}`: the service's status and answer as it wrote them, and for --prompt the route that answered (null for a body). A chat completion spends tokens.
- Asked of Brama for Oko's declared route (no --model, no --router), a refusal is followed by each chat model the gateway lists for Oko, in its order, so the guards are answered whenever a model that can chat is. The decision alias is never asked: Brama answers it only on POST /v1/decisions and refuses it for chat (HTTP 400). Each refused route is reported as the judge probe reports it, a 403 with the call:brama grant it lacks. A named model, a declared service and a router are asked once. It replaces `oko proxy-call`, which printed `HTTP <status>`, `---` and the body as text.
Refusals and safe exits#
- `oko gateway send takes a /v1/ endpoint; got <endpoint>` and `oko gateway send --prompt is a chat completion; --endpoint names the endpoint of a body read from standard input` (exit 2); `the request body on standard input is not readable: <error>`; `model call to <origin> failed: <detail>`; `<origin> answered no route asked: <route>: HTTP <status>: <answer>; …` when every route asked refused; the reach refusals of `check`.
- A body sent through the gateway whose service responds unsuccessfully refuses as `gateway <endpoint> answered HTTP <status>: <body>`, rather than reporting an accepted request as success. The goal classifier keeps its internal typed client; a separate signed request uses this general command rather than a lifecycle-specific CLI alias.
- Brama's signed requests use the refresh interval this machine's Stado resolver publishes as their request bound. If the measure is absent or invalid, Oko refuses before HTTP and names its state path. A failed request names its address, HTTP request/response phase and measured elapsed time; a failed body read names its own elapsed time after the HTTP phase. An already held adapter names its active host, bind, phase and wait against the same declared measure. A model refusal is never a blank success.
- The real `proxy-held` qualification has separate ignored journeys `real_gateway_stall` and `real_gateway_recovery`. Declare `OKO_TEST_SOURCE_REVISION` for the committed candidate and run the first only while the actual Brama route stands, then the second after it answers again. Both use the real `oko gateway send --prompt`, retain exact command, exit, streams and binary digest under `.build/proxy-gateway/<revision>`, and refuse a healthy first run or a recovery without the same candidate's outage report. The isolated resolver-declaration tests do not substitute for either real phase.