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.14.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.14.0
File Size Uploaded Provenance Actions
baseten-0.14.0.tar.gz 542.6 kB With provenance Details for baseten-0.14.0.tar.gz

Built distribution (wheel)

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

Total release size: 770.4 kB

Release files / baseten-0.14.0.tar.gz

Download URL baseten-0.14.0.tar.gz
Size 542.6 kB
Tags Source
SHA-256 checksum
How to use checksums
48adaad5ccc14fa36c80d0fffb314f3f9b9b2340c1ee6f664854c3c0797d80b4
BLAKE2b-256 checksum
How to use checksums
c57e3ed5019cab408872feb028ab224196c5ce846b966fea388b6d87a8ba49d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 30, 2026.

Transparency log

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

Download URL baseten-0.14.0-py3-none-any.whl
Size 227.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ef8cd291f64f0c1ee4545d30edb79ce07944fd606849b62d20d3b3e6af51513
BLAKE2b-256 checksum
How to use checksums
8d7b88f96d96a7ba54161a0e518e8cdad52a061ad9bb4398a09db0a108e6d886
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 30, 2026.

Transparency log

Security for baseten 0.14.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for baseten-0.14.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 30, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.14.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