braintrust-api
The official Python library for the braintrust API
Decision gist · record as of 2026-08-14
Yes. The library is actively maintained, has low install friction, carries no known vulnerabilities, and is licensed permissively. It is well-suited for any Python project that needs to interact with the Braintrust API. The main prerequisite is a valid API key and network access to Braintrust's service.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a valid BRAINTRUST_API_KEY environment variable or passed as an argument to authenticate with the Braintrust service.
- Low install friction with a pure-wheel distribution and standard dependencies (httpx, pydantic, anyio).
- Actively maintained with recent commits and support for current Python versions (3.8–3.12).
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 is permissive; you can use, modify, and distribute this library freely in commercial and open-source projects with minimal restrictions.
last release 2024-11-28 (624 days) · last repo commit 2026-03-23 · 5 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 218,120 downloads/mo, #9,343 on PyPI
Alternatives
Verify before relying
pip install braintrust-api
import os
from braintrust_api import Braintrust
client = Braintrust(
api_key=os.environ.get("BRAINTRUST_API_KEY"),
)
project = client.projects.create(name="foobar")
print(project.id)- Whether the library's auto-retry behavior (2 times by default) and timeout handling (1 minute default) meet typical production requirements.
- Rate of API changes and backward compatibility guarantees between minor versions.
What it is and what it does
Braintrust-api is the official Python client for the Braintrust REST API, generated using Stainless. It wraps HTTP calls to Braintrust's service with full type annotations for request parameters and response objects, enabling IDE autocomplete and type checking. The library ships both synchronous and asynchronous clients powered by httpx, so you can choose the concurrency model that fits your application.
Typical usage involves instantiating a Braintrust client with an API key, then calling methods like client.projects.create() or client.projects.list(). Responses are Pydantic models with helper methods for JSON serialization and dictionary conversion. The library handles pagination automatically via iterators, retries transient errors up to 2 times by default, and raises specific exception types (APIConnectionError, RateLimitError, APIStatusError) so you can handle failures gracefully.
Use it for
- Build a Python application that creates and manages Braintrust projects programmatically with full type safety.
- Integrate Braintrust API calls into an async/await workflow for non-blocking I/O in concurrent applications.
- Iterate over paginated Braintrust API responses automatically without manually tracking cursors or page tokens.
- Catch and handle specific API errors (rate limits, authentication failures, timeouts) with dedicated exception types.
- Serialize Braintrust API responses to JSON or dictionaries for logging, caching, or downstream processing.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The library is actively maintained, has low install friction, carries no known vulnerabilities, and is licensed permissively. It is well-suited for any Python project that needs to interact with the Braintrust API. The main prerequisite is a valid API key and network access to Braintrust's service.
Install
braintrust-api on PyPI
Before you install
Low install friction with a pure-wheel distribution and standard dependencies (httpx, pydantic, anyio). Actively maintained with recent commits and support for current Python versions (3.8–3.12).
Requires a valid BRAINTRUST_API_KEY environment variable or passed as an argument to authenticate with the Braintrust service.
License in practice
Apache-2.0 is permissive; you can use, modify, and distribute this library freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install braintrust-api
import os
from braintrust_api import Braintrust
client = Braintrust(
api_key=os.environ.get("BRAINTRUST_API_KEY"),
)
project = client.projects.create(name="foobar")
print(project.id)
Verify before relying
- Whether the library's auto-retry behavior (2 times by default) and timeout handling (1 minute default) meet typical production requirements.
- Rate of API changes and backward compatibility guarantees between minor versions.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 6 packagesanyiodistrohttpxpydanticsniffiotyping-extensions |
| Maintenance | Actively maintained 624 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 218,120 / month, #9,343 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: POSIXOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: braintrust_api-0.6.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “braintrust api client”
- braintrust-apiProvides a Python client library for the Braintrust REST API with…
- braintrust-langchainProvides a LangChain callback handler to log LangChain executions to…
- braintrust-coreProvides shared core dependencies for packages in the Braintrust…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also braintrust · supermemory · braintrust-core · arcadepy · parallel-web · opencode-ai · composio-client · agentex-client · sambanova · pipedream