Skip to main content

bma-sdk

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

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.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 bma-sdk 0.4.0
File Size Uploaded Provenance Actions
bma_sdk-0.4.0.tar.gz 354.5 kB With provenance Details for bma_sdk-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.7 MB

Release files / bma_sdk-0.4.0.tar.gz

Download URL bma_sdk-0.4.0.tar.gz
Size 354.5 kB
Tags Source
SHA-256 checksum
How to use checksums
00e37d6ee22e012ce25c8d8f4af9859f96b96418961e149092d2a5a5e53ef84b
BLAKE2b-256 checksum
How to use checksums
1d09e84018a1c0fc09113ee1b10d10678e438fe98a1c9aa3c38cfb1fd03d1df6
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 31, 2026.

Transparency log

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

Download URL bma_sdk-0.4.0-py3-none-any.whl
Size 1.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b0aa74872235701971ee6021ca7d73994ba5df6a6373f9f04010164c968a0ab4
BLAKE2b-256 checksum
How to use checksums
8fee663bef3c941e712406a2aafae3c95b07279dd52f40d90565f19ffed01d2a
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 31, 2026.

Transparency log

Security for bma-sdk 0.4.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 bma_sdk-0.4.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 31, 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