sambanova
The official Python library for the SambaNova API
What it is and what it does
The SambaNova Python library is an official client for the SambaNova REST API, generated with Stainless. It wraps HTTP communication with httpx and provides both synchronous (SambaNova) and asynchronous (AsyncSambaNova) interfaces. All request parameters and response fields are type-checked using Pydantic models and TypedDicts, enabling IDE autocomplete and catching type errors early.
You use it to call SambaNova's language models and other services—chat completions, text generation, audio transcription—from Python applications. It handles authentication via API key, supports streaming responses over Server-Sent Events, manages automatic retries for transient failures, and provides structured error handling with specific exception types for different HTTP status codes. The library requires Python 3.9 or later and depends on common async utilities (anyio, sniffio) and HTTP infrastructure (httpx, pydantic).
Use it for:
- Build a chatbot or conversational AI application that calls SambaNova's language models via the chat completions endpoint.
- Integrate SambaNova's text generation or audio transcription into an existing Python backend service with full type safety.
- Stream long-form model outputs (poems, code, essays) to a frontend or user interface in real time using SSE.
- Prototype or deploy async-first applications that need concurrent API calls to SambaNova without blocking.
- Validate API request shapes and response structures at development time using Pydantic's type checking and IDE support.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a Python client library for accessing the SambaNova REST API with synchronous and asynchronous support, type-safe request and response handling, and streaming capabilities.
Yes. The library is actively maintained, has no known vulnerabilities, uses a permissive license, and offers low install friction. It is the official client for SambaNova's API and provides both sync and async interfaces with full type safety. Install it if you are building a Python application that needs to call SambaNova models or services.
Install
sambanova on PyPI
pip
pip install sambanovauv
uv add sambanovapoetry
poetry add sambanovaInstalling sambanova
Before you install
Low install friction with a pure-Python wheel and six common dependencies (anyio, distro, httpx, pydantic, sniffio, typing-extensions). Actively maintained with a recent release and no known vulnerabilities.
License in practice
Apache-2.0 is a permissive license; you can use this library freely in commercial and private projects with minimal restrictions, provided you include a copy of the license.
Quickstart
pip install sambanova
import os
from sambanova import SambaNova
client = SambaNova(api_key=os.environ.get("SAMBANOVA_API_KEY"))
completion = client.chat.completions.create(
messages=[{"content": "hello", "role": "user"}],
model="gpt-oss-120b"
)
Requires a valid SAMBANOVA_API_KEY environment variable or explicit api_key parameter to authenticate with the SambaNova API.
Verify before relying
- Whether the library's automatic retry logic (2 times by default) is configurable or suitable for production rate-limiting scenarios.
- Performance characteristics and connection pooling behavior when handling concurrent requests at scale.
- Compatibility with the optional aiohttp backend and whether it provides measurable concurrency improvements over httpx.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — anyio, distro, httpx, pydantic, sniffio, typing-extensions |
| Maintenance | actively maintained — 25 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 162,682/month — #10,592 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sambanova-1.12.1-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
groqProvides a Python client library for accessing…
permissive · top 1,000 on PyPI
arcadepyProvides a typed Python client library for the…
permissive · top 15,000 on PyPI
llama-api-clientProvides a typed Python client for the Llama…
permissive · top 15,000 on PyPI
togetherA Python client library for the Together REST…
permissive · top 5,000 on PyPI
fireworks-aiPython SDK for the Fireworks REST API,…
permissive · top 5,000 on PyPI
writer-sdkPython client library for the Writer REST API,…
permissive · top 15,000 on PyPI
cerebras-cloud-sdkProvides a Python client library for accessing…
permissive · top 5,000 on PyPI
cloudflareProvides a Python client library for the…
permissive · top 5,000 on PyPI
reka-apiProvides a Python client library for accessing…
permissive · top 15,000 on PyPI
letta-clientProvides a Python client library for the Letta…
permissive · top 15,000 on PyPI