Streaming
stream: true is accepted and the finished answer is served as OpenAI chat.completion.chunk events (one content chunk, one finish chunk, [DONE]). Underneath is an async job, so the first byte arrives when the answer is complete; an SDK's streaming code path works unchanged.
POST https://api.kotoba.cloud/v1/chat/completions {"stream": true, ...}
content-type: text/event-stream
data: {"object":"chat.completion.chunk","choices":[{"delta":{"role":"assistant","content":"..."},"finish_reason":null}]}
data: {"object":"chat.completion.chunk","choices":[{"delta":{},"finish_reason":"stop"}],"billing":"free","receiptId":"receipt-..."}
data: [DONE]
Waiting as a job
Long answers (up to 32k output tokens) can take minutes. The synchronous call waits server-side for up to 14 minutes; past that it answers 504 inference-timeout while the job continues — resend the identical request and you re-attach to the same job (deterministic job id).
# the job API, when you want to poll yourself
curl -s -X POST https://api.kotoba.cloud/v1/research/jobs -H "idempotency-key: <uuid v4>" ...
curl -s "https://api.kotoba.cloud/v1/research/job?jobId=<uuid>" # 202 queued/running · 200 succeeded