Skip to main content

bma-sdk

PyPI

Python client for the BMA REST API, generated from contracts/bma/rest.openapi.yaml, plus the BMA extensions to the Anthropic Managed Agents API.

Version 0.4.0 (tag python/v0.4.0), see CHANGELOG
Contract BMA REST snapshot recorded in contracts/bma/lock.json
Python 3.10 or newer
pip install bma-sdk==0.4.0
from bma_sdk import BmaClient, unwrap
from bma_sdk.rest.api.agents import create_agent_input, create_agent_session
from bma_sdk.rest.models import CreateAgentInputRequest, CreateAgentSessionRequest, TextContentBlock

with BmaClient(token, "https://host/api/v1") as bma:
    session = unwrap(create_agent_session.sync_detailed(
        org, project, agent, client=bma.rest,
        body=CreateAgentSessionRequest(idempotency_key="task-1"),
    )).session
    unwrap(create_agent_input.sync_detailed(
        org, project, agent, client=bma.rest, session_id=session.id,
        body=CreateAgentInputRequest(content_blocks=[TextContentBlock(type_="text", text="Start.")]),
    ))
    for frame in bma.stream_events(org, project, agent, session_id=session.id):
        print(frame.event, frame.sequence)

bma_sdk.rest contains one module per contract operation with sync/sync_detailed/asyncio/asyncio_detailed functions. BmaClient adds bearer authentication, stream_events, and download_artifact (size and sha256 verified).

BMA extensions to the Anthropic facade

Use the official Anthropic SDK for /v1/agents, /v1/environments, /v1/sessions and events. The routes BMA adds:

from bma_sdk.facade_extensions import FacadeExtensionsClient, bma_sequence

with FacadeExtensionsClient(api_key, "https://host", project_id="proj_...") as ext:
    ticket = ext.get_session_desktop_stream(session_id, desktop_session_id=desktop_id)
    ext.upload_session_file(session_id, "report.pdf", data)
    page = ext.list_session_files(session_id, limit=100)

The module also exports ModelConfigOverride, MCPServerBMAAuth, IDEMPOTENCY_KEY_HEADER, and bma_sequence(event).

The executor protocol (executor, harness and agent ends) is the separate package bma-executor-sdk.

Metadata

Release files for bma-sdk 0.4.1

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

Source distribution (sdist)

Source distribution for bma-sdk 0.4.1
File Size Uploaded Provenance Actions
bma_sdk-0.4.1.tar.gz 360.6 kB With provenance Details for bma_sdk-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bma-sdk 0.4.1
File Interpreter ABI Platform Actions
bma_sdk-0.4.1-py3-none-any.whl Python 3 none any Details for bma_sdk-0.4.1-py3-none-any.whl

Total release size: 1.7 MB

Release files / bma_sdk-0.4.1.tar.gz

Download URL bma_sdk-0.4.1.tar.gz
Size 360.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9ae10e4783c28c43d004bf925a4f25bf1bcfe5d893a4c472b4ee4f38d0acab98
BLAKE2b-256 checksum
How to use checksums
f13529edf5b122bf93bd7e0bd7ce63ca7f66d8da8c9af62f92203a384e76f368
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 Nov 1, 2026.

Transparency log

Release files / bma_sdk-0.4.1-py3-none-any.whl

Download URL bma_sdk-0.4.1-py3-none-any.whl
Size 1.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
2b337dc690c83c7ff6554fcddb090ded289e15221354b15d65fb28e597cc62af
BLAKE2b-256 checksum
How to use checksums
fe671984bf9f3d82a5431a0979c29ceac1068e8b11461eeadaee95f14f2a6c13
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 Nov 1, 2026.

Transparency log

Security for bma-sdk 0.4.1

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 bma_sdk-0.4.1.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 Nov 1, 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.

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