Skip to main content

Baseten Python SDK

PyPI

Python SDK for Baseten. See the API documentation and usage below.

⚠️ SDK may change in incompatible ways between releases until the SDK reaches 1.0.

Install

pip install baseten

Usage

Current SDK only has barebones client. Here is usage example of the barebones underlying client:

from baseten.client import ManagementClient

with ManagementClient(api_key="my-api-key") as client:
    for model in client.api.get_models().models:
        print(model.name)

Or for async:

from baseten.client import AsyncManagementClient

async with AsyncManagementClient(api_key="my-api-key") as client:
    for model in (await client.api.get_models()).models:
        print(model.name)

Sandboxes

baseten.sandbox creates and works with sandboxes. HTTP/2 is used when the h2 package is installed, which is strongly recommended:

pip install "baseten" "httpx[http2]"
from baseten.sandbox import SandboxClient

with SandboxClient(api_key="my-api-key") as client:
    sandbox = client.create()
    try:
        sandbox.fs.write(path="/tmp/hello.txt", content="hello")
        result = sandbox.process.exec(
            command="cat /tmp/hello.txt", wait_for_completion=True
        )
        print(result.stdout)
    finally:
        client.delete(name=sandbox.name)

AsyncSandboxClient is the same for async code. Operations the SDK does not wrap are available on the generated clients, through client.raw_api for the control plane and sandbox.raw_api for a sandbox. See the API documentation for the rest.

Upgrading from 0.8.2 and earlier

Version 0.9.0 is a rewrite and shares no API with the earlier baseten releases. Code written against 0.8.2 or earlier will not work. Pin baseten<0.9 to keep it.

Metadata

Release files for baseten 0.13.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for baseten 0.13.0
File Size Uploaded Provenance
baseten-0.13.0.tar.gz 518.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for baseten 0.13.0
File Interpreter ABI Platform
baseten-0.13.0-py3-none-any.whl Python 3 none any Details

Total release size: 735.6 kB

Release files / baseten-0.13.0.tar.gz

Download URL baseten-0.13.0.tar.gz
Size 518.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a1340982fcf631a081e49e4bdbcbf6a80cce38d34e43b7f8fe33525ef1908a77
BLAKE2b-256 checksum
How to use checksums
dd162cd71594b11d51c5ee2a7f9418492f526de9082c8eb662abff3a694c7e3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / baseten-0.13.0-py3-none-any.whl

Download URL baseten-0.13.0-py3-none-any.whl
Size 217.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3298e17edfe6e7608daee8c707da1d398eaa82537b8eeac0f76299ad6d380f73
BLAKE2b-256 checksum
How to use checksums
a917b77e1a4b9cdfee81a07a30c4070de6a9d31c2a2d1e8f1e66c7b644c829c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for baseten 0.13.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for baseten-0.13.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.13.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page