BMA /Developers

One API, two SDKs

REST plus a resumable SSE event stream you can curl directly. bma-sdk calls the platform; bma-executor-sdk connects your own computer or agent. Go, TypeScript, Python.

One API for sessions, events, files and computers

REST and a resumable SSE stream. Call it with curl or the SDKs below.

curl · text/event-streamLast-Event-ID
H=(-H "x-api-key: $BMA_API_KEY" -H "bma-workspace-id: $BMA_PROJECT_ID" -H "content-type: application/json")

SESSION_ID=$(curl -s "$BMA_BASE_URL/v1/sessions" "${H[@]}" \
  -d "{\"agent\":\"$AGENT_ID\",\"environment_id\":\"$ENVIRONMENT_ID\"}" | jq -r .id)

# Open the stream first, then send: reconnect with -H "Last-Event-ID: <last id>".
curl -N "$BMA_BASE_URL/v1/sessions/$SESSION_ID/events/stream" "${H[@]}" &
curl -s "$BMA_BASE_URL/v1/sessions/$SESSION_ID/events" "${H[@]}" \
  -d '{"events":[{"type":"user.message","content":[{"type":"text","text":"Plan my week."}]}]}'
wait
/v1
  • /agents
  • /environments
  • /sessions
  • /sessions/{id}/events
  • /sessions/{id}/events/stream
  • SSE resume
  • Context compaction
  • MCP
  • Skills
  • Memory
  • Approvals & questions
  • Backup & restore
  • sha256 artifacts

Two SDKs in Go, TypeScript and Python

2.1 · generated from the platform contract · Apache-2.0

bma-sdk

GitHub ↗

For: Apps that call the platform API.

  • Agents, sessions, SSE event stream
  • Files, artifacts, computers, desktop, terminal
  • Resumable SSE · idempotency keys · typed errors
$npm install @beeos-ai/bma-sdk
import { BmaClient } from "@beeos-ai/bma-sdk";

const client = new BmaClient({ apiKey: process.env.BMA_API_KEY!, baseURL: process.env.BMA_BASE_URL! });

const session = await client.beta.sessions.create({ agent: agentId, environment_id: environmentId });

// Open the stream first, then send: an interrupted stream resumes with Last-Event-ID.
const stream = await client.beta.sessions.events.stream(session.id);
await client.beta.sessions.events.send(session.id, {
  events: [{ type: "user.message", content: [{ type: "text", text: "Plan my week." }] }],
});

for await (const ev of stream) {
  if (ev.type === "agent.message") console.log(ev.content);
  if (ev.type === "session.status_idle") break;
}

bma-executor-sdk

GitHub ↗

For: Connect your own computer (hands) or your own agent (brain) to BMA.

  • Protocol bma.executor.v1.1
  • WebSocket · Unix socket · named pipe
  • Go executor core: bash, files, MCP
$npm install @beeos-ai/bma-executor-sdk
import { ExecutorClient } from "@beeos-ai/bma-executor-sdk";

const client = new ExecutorClient({
  environmentKey: process.env.BMA_ENVIRONMENT_KEY,
  environmentId: process.env.BMA_ENVIRONMENT_ID!,
  executor: { name: "my-hand", os: process.platform, arch: process.arch, version: "0.1.0" },
});

client.tools.bash.handle(async ({ command, cwd }, { signal, progress }) => {
  progress("running");
  const r = await run(command, { cwd, signal });
  return { stdout: r.stdout, stderr: r.stderr, exitCode: r.code };
});

await client.start();