SambaNova inference APIs are designed to be compliant with OpenAI client libraries to simplify the adoption of SambaNova inference technologies to enhance your AI applications.Documentation Index
Fetch the complete documentation index at: https://sambanova-systems.mintlify.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
Download the library
Run the command below to download the library.Use SambaNova APIs with OpenAI client libraries
Configure your OpenAI client libraries to use SambaNova inference APIs by setting two values: thebase_url and your api_key.
Don’t have a SambaNova API key? Get yours from the API keys and URLs page.
Non-streaming example
The following code demonstrates using the OpenAI Python client for non-streaming completions.Streaming example
The following code demonstrates using the OpenAI Python client for streaming completions.In streaming mode, the API returns chunks that contain multiple tokens. When calculating metrics like tokens per second or time per output token, count all tokens in each chunk.
Responses API
In addition to the Chat Completions endpoint, SambaNova exposes a Responses API endpointPOST /v1/responses that is compatible with the OpenAI Responses API standard. If you already use the OpenAI SDK with the Responses API, you can point it to SambaNova with the same configuration.
Currently unsupported OpenAI features
The following features are not yet supported and will be ignored:presence_penaltyfrequency_penaltylogit_bias
Feature differences
n: The SambaNova API supports values 1–8 (integer, default 1). OpenAI has no documented hard cap. Note that n greater than 1 is not supported when using function calling or tools — combining them returns a 400 error.
seed: Supported on both SambaStack and SambaCloud for text generation models. Passing the same seed with the same inputs produces deterministic outputs. Accepts any integer, including negative values.
Unlike OpenAI, the SambaNova API does not return a
system_fingerprint field in the response. The seed parameter is not supported for multi-modality models or continuous batching (CB) models.SambaNova API features not supported by OpenAI clients
The SambaNova API supports thetop_k parameter, which is not supported by the OpenAI client libraries.
