Create a message
Anthropic Messages API compatible endpoint. Generates a model response for the supplied conversation. Authentication accepts either the bearer Authorization: Bearer <key> header (SambaNova SDK default) or the x-api-key header (Anthropic SDK default); the same API key is used in both cases. When stream: true is set, the response is a sequence of Server-Sent Events whose payloads conform to MessageStreamEvent; otherwise the response is a single Message object.
Authorizations
SambaNova API key, sent as a bearer token in the Authorization header (Authorization: Bearer <key>). Default authentication scheme used by the SambaNova SDK across every OpenAI compatible endpoint.
Headers
Anthropic API version header sent by the official anthropic SDK. Accepted (any value) but currently has no effect on response shape — included for drop-in SDK compatibility.
"2023-06-01"
Body
Message creation parameters.
Request body for POST /messages. Wire-compatible with the official Anthropic Messages API. Required fields: model, max_tokens, messages.
Maximum number of tokens to generate. The combined input + output token count is bounded by the model's context window.
x >= 11024
Conversation turns.
1System prompt for the conversation. Accepts either a single string (most common) or an array of text blocks (used when individual segments need cache_control markers). Multiple text blocks are joined with newlines and prepended to the conversation as a role: system message.
Sampling temperature in [0.0, 2.0]. Higher values produce more random output, lower values more deterministic. Adjust only one of temperature, top_p, top_k.
0 <= x <= 21
Nucleus sampling. Considers tokens with cumulative probability mass up to top_p.
0 <= x <= 1Top-k sampling. Considers only the K most likely tokens at each step. Set to 0 to disable.
x >= 0Custom strings that, when generated, cause the model to stop.
If true, the response is a sequence of Server-Sent Events whose payloads conform to MessageStreamEvent.
Free-form metadata attached to the request. Currently only user_id Additional fields are accepted but ignored.
Disables Anthropic-style extended thinking. In v1: silently accepted as a no-op
- Message Thinking Disabled
- Message Thinking Enabled
- Message Thinking Adaptive
Tool definitions the model may call.
Controls how the model selects from tools.
- Message Tool Choice (Auto)
- Message Tool Choice (Any)
- Message Tool Choice (None)
- Message Tool Choice (Tool)
Service-tier preference. In v1: silently dropped
auto, standard_only Existing code-execution container ID to reuse. In v1: silently dropped
Response
Successful response. Returns a Message object (non-streaming), or a stream of Server-Sent Events whose payloads conform to MessageStreamEvent ending with a message_stop event (when stream: true).
- Message
- Message Start Event
- Content Block Start Event
- Content Block Delta Event
- Content Block Stop Event
- Message Delta Event
- Message Stop Event
- Message Ping Event
- Message Stream Error Event
Non-streaming response from POST /messages. Wire-compatible with the official Anthropic Messages API.
Unique identifier for this message.
message "message"assistant "assistant"Plain-text segment of the model's response.
- Message Output Text Block
- Message Output Tool Use Block
- Message Output Thinking Block
- Message Output Redacted Thinking Block
- Message Output Server Tool Use Block
- Message Output Web Search Tool Result Block
- Message Output Web Fetch Tool Result Block
- Message Output Code Execution Tool Result Block
- Message Output Bash Code Execution Tool Result Block
- Message Output Text Editor Code Execution Tool Result Block
- Message Output Tool Search Tool Result Block
- Message Output Container Upload Block
Model that produced the response.
Reason the model stopped generating. SambaNova emits end_turn, max_tokens, tool_use, and stop_sequence. The remaining values are defined for Anthropic SDK type-parity but never returned: pause_turn (server-tool loop limit, not produced); refusal (content filter, not exposed); model_context_window_exceeded (folded to max_tokens).
end_turn, max_tokens, tool_use, pause_turn, refusal, stop_sequence, model_context_window_exceeded Token accounting for the request.
The matched stop sequence that triggered termination. Present when stop_reason is stop_sequence; null otherwise.
Refusal stop details. Anthropic compatibility only — refusal is never emitted as a stop_reason by SambaNova (content filtering is not exposed at the API layer).
Code-execution container reference. Anthropic compatibility only — SambaNova does not run server-side code execution, so this field is never emitted on responses.

