Request
Send aPOST request with your enterprise API key as a Bearer token.
curl
Body
json
Body Attributes
The body follows the OpenAI Chat Completions format. The server sends every field to the model without changes, exceptmodel, models, route, and preset.
The conversation, as a list of
{ "role", "content" } objects. Roles are system, user, assistant, and tool. content can be a string or a list of content parts, such as text parts with cache_control or image parts if the model accepts images.Set to
true to get the reply as Server-Sent Events while the model generates it. Use streaming for long outputs: a request that is not streamed must finish in about 110 seconds.Nucleus sampling: the model picks the next token only from tokens whose total probability is
top_p.Functions the model can call, in the OpenAI
tools format. Use tool_choice to control when the model calls them.Ask for JSON output, for example
{ "type": "json_object" } or a json_schema, if the model supports it.Response
json
Streaming
With"stream": true, the response is text/event-stream. Each event is a data: line that holds one chunk, and the stream ends with data: [DONE].
Prompt caching
If the model supports prompt caching, mark a long, repeated part of the prompt withcache_control. The next requests that start with the same prefix read it from the cache. usage.prompt_tokens_details.cached_tokens shows how many tokens came from the cache.
json

