Create chat completion (OpenAI-compatible)
Create a chat completion. Compatible with the OpenAI Chat Completions API. Not end-to-end encrypted — use /rvenc/chat/completions for that.
Zero Data Retention
This is the standard inference route. Prem sends the request to a trusted partner. Prem does not keep your prompts or completions, and the partner does not keep them. Your content is plaintext at the Prem API Gateway and at the partner. Use/rvenc/chat/completions for a confidential path with client-side encryption and attestation. See ZDR vs Confidential.
Base URL
Set the base URL of an OpenAI client tohttps://gateway.prem.io/openai. Do not add a /v1 segment.
Streaming
Set"stream": true to get a stream of server-sent events in the OpenAI format:
Model availability
Send a model thatGET /openai/models returns for your API key. A confidential-only model returns a 400 status with this message: Model {model} is available for encrypted inference only. See Models & Pricing for the mode errors.Authorizations
Send your access token as header Authorization: Bearer {accessToken}
Your API key that starts with sk_live or sk_test. You can create yours at go.prem.io/api-keys.
Body
Chat completion request in the OpenAI Chat Completions format.
Model name, as listed by GET /models.
Conversation messages.
If true, the response is a server-sent events stream.
Optional. Pin the request to one of the model's configured backends. Omit to let the platform choose.
64^[a-z0-9][a-z0-9-]*$Response
A chat completion, or a server-sent events stream when stream is true.
The response is of type object.