v2
latestOpenAPI 3.1.02026-08-05267431678.1 KBText Completions
OpenAI-compatible text completions endpoint.
Thin shell over :func:services.inference.adapters.openai_text.run_text_completion. The adapter handles project routing, dispatch (LLM passthrough vs Pioneer-task), SSE rendering, persistence, and error mapping. The router keeps only HTTP-shaped concerns: route declaration, auth, rate limiting.
Args: body: Validated :class:TextCompletionRequest. request: FastAPI request (forwarded so the adapter can read API-key billing context out of request.state for streaming responses). auth: Authenticated request context.
Returns: :class:TextCompletionResponse for non-streaming, or a :class:StreamingResponse of text_completion SSE events terminated by data: [DONE] when body.stream is true.
Request body
Response
Text completion. Returns application/json (TextCompletionResponse) by default, or text/event-stream of TextCompletionStreamChunk events terminated by data: [DONE] when stream=true.