v1
latestOpenAPI 3.1.0Apache-2.02026-07-13153158.0 KBopenai-compat
OpenAI-compatible text completions (T41 wired)
Accepts the public OpenAI POST /v1/completions request shape and dispatches to the deployed function the gateway operator has aliased to the requested model (via TENSOR_WASM_API_OPENAI_MODEL_MAP). Returns the standard OpenAI text_completion envelope on success, or 404 model_not_found when the model alias is unknown.
When stream: true, returns text/event-stream with one data: { ... } SSE frame per emitted chunk and a terminal data: [DONE]\n\n line.
The X-TensorWasm-Tenant header is not honoured on this route, because OpenAI SDKs never send it. Tenant resolution comes from the bearer token's scope (see docs/OPENAI-COMPAT.md).
post/v1/completions
Request body
Response
Completion result (or SSE stream when stream:true).