Authorizations
SambaNova API Key
Body
Chat prompt and parameters
chat completions request object
A list of messages comprising the conversation so far.
1
- System Message
- User Message
- Assistant Message
- Tool Message
[
{
"role": "user",
"content": "create a poem using palindromes"
}
]
The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length.
2048
The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length.
2048
What sampling temperature to use, determines the degree of randomness in the response. between 0 and 2, Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. Is recommended altering this, top_p or top_k but not more than one of these.
0 <= x <= 1
0.7
Cumulative probability for token choices. An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. Is recommended altering this, top_k or temperature but not more than one of these.
0 <= x <= 1
1
Amount limit of token choices. An alternative to sampling with temperature, the model considers the results of the first K tokens with higher probability. So 10 means only the first 10 tokens with higher probability are considered. Is recommended altering this, top_p or temperature but not more than one of these.
1 <= x <= 100
5
Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
-2 <= x <= 2
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
-2 <= x <= 2
If true, sampling is enabled during output generation. If false, deterministic decoding is used.
Sequences where the API will stop generating tokens. The returned text will not contain the stop sequence.
"\n"
If set, partial message deltas will be sent. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE]
message.
Options for streaming response. Only set this when setting stream as true
An object specifying the format that the model must output. Setting to { "type": "json_object"}
enables JSON mode, which will check the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Setting to { "type": "json_schema", "json_schema": {<your_schema>}"}
enables JSON schema mode, which will check the message the model generates is valid object of type <your_schema>.
Specifies that the model should produce output as plain text.
- ResponseFormatText
- ResponseFormatJSONObject
- ResponseFormatJSONSchema
Value specifying the amount of reasoning the model is allowed to do, increasing it will increase the number of output reasoning tokens generated by the model, but will improve quality of the responses. allowed values are 'low', 'medium', 'high'
low
, medium
, high
Controls which (if any) tool is called by the model. none
means the model will not call any tool and instead generates a message. auto
means the model can pick between generating a message or calling one or more tools. required
means the model must call one or more tools. Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}}
forces the model to call that tool.
none
, auto
, required
Whether to enable parallel function calling during tool use.
A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.
128
This is not yet supported by our models. Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content
of message
.
This is not yet supported by our models. An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs
must be set to true
if this parameter is used.
0 <= x <= 20
This is not yet supported by our models. How many chat completion choices to generate for each input message.
1 <= x <= 1
1
This is not yet supported by our models. Modify the likelihood of specified tokens appearing in the completion.
This is not yet supported by our models.
Response
Successful Response, or model output error (when unsuccessful tool calling or structured response generation)
- Chat Completion Response
- Chat Completion Stream Response
- ModelOutputError
- GeneralError
chat completion response returned by the model
1
The Unix timestamp (in seconds) of when the chat completion was created.
A unique identifier for the chat completion.
The model used for the chat completion.
The object type, always chat.completion
.
Title | Const |
---|---|
Object | chat.completion |
Backend configuration that the model runs with.
Usage metrics for the completion, embeddings,transcription or translation request
{
"acceptance_rate": 4.058139324188232,
"completion_tokens": 350,
"completion_tokens_after_first_per_sec": 248.09314856382406,
"completion_tokens_after_first_per_sec_first_ten": 249.67922929952655,
"completion_tokens_after_first_per_sec_graph": 452.5030493415834,
"completion_tokens_per_sec": 238.91966176995348,
"end_time": 1737583289.7345645,
"is_last_response": true,
"prompt_tokens_details": { "cached_tokens": 0 },
"prompt_tokens": 43,
"start_time": 1737583288.264706,
"time_to_first_token": 0.06312894821166992,
"total_latency": 1.4649275719174653,
"total_tokens": 393,
"total_tokens_per_sec": 268.27264878740493
}
{ "prompt_tokens": 43, "total_tokens": 393 }