Create Chat Completion
client.chat.completions.create(params)/v1/chat/completionsCreate an OpenAI-compatible chat completion with any supported SandBase chat model.
Request body
ChatCompletionCreateParamsModel identifier from the Models API.
Conversation messages in system, user, assistant, or tool order.
Sampling temperature from 0 to 2.
Default: 1
Nucleus sampling threshold.
Default: 1
Maximum number of output tokens.
Return incremental Server-Sent Events.
Default: false
Sequence or sequences that stop generation.
Function definitions available to the model.
Controls whether and which tool is selected.
Default: auto
JSON object or JSON Schema output configuration.
Number of completion choices to generate.
Default: 1
Presence penalty from -2 to 2.
Default: 0
Frequency penalty from -2 to 2.
Default: 0
Stable end-user identifier for abuse monitoring.
Streaming options such as include_usage.
Streaming and tools
Set stream to true for SSE. Tool calls and multimodal content follow the OpenAI-compatible schema; detailed workflows live in the Chat Completions guide.
Model support
Optional capabilities depend on the selected model. Inspect model metadata before using tools, vision, or strict structured output.
Errors
Invalid request body or unsupported parameter.
Missing or invalid API key.
Model not found or unavailable.
Rate limit exceeded.

