Skip to content

SDKs

Bee SDKs

Two first-party clients targeting the Bee OpenAI-compatible /chat/completions surface. Pick the one that matches your runtime — the wire format is the same on either side.

TypeScript / JavaScript

Pure ESM, zero runtime dependencies, native fetch. Works in Node 18+, Deno, Bun, and every modern browser.

Live on npm
npm install @cuilabs/bee
# or pnpm add @cuilabs/bee
# or yarn add @cuilabs/bee

Quickstart

import { BeeClient } from "@cuilabs/bee";

const bee = new BeeClient({ apiKey: process.env.BEE_API_KEY! });

const out = await bee.chat.completions.create({
  model: "bee-cell",
  messages: [
    { role: "user", content: "Summarise the SOLID principles in 2 lines." },
  ],
});

console.log(out.choices[0].message.content);

Streaming

const stream = await bee.chat.completions.create({
  model: "bee-cell",
  messages: [{ role: "user", content: "Write a haiku about bees." }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

Python

Stdlib-only sync client. Optional httpx-backed async client behind bee-sdk[async].

PyPI org approval pending

The package code is in the public Bee repo today, but the PyPI cuilabs organisation is still pending approval — meaning pip install bee-sdk will only resolve once that lands. Until then, install directly from GitHub:

# Install from GitHub (recommended while PyPI org approval is pending)
pip install "git+https://github.com/cuilabs/bee.git#subdirectory=sdks/python"

# With async client
pip install "git+https://github.com/cuilabs/bee.git#subdirectory=sdks/python" httpx

Once PyPI org approval lands, the canonical install will be:

pip install bee-sdk          # sync, zero deps
pip install bee-sdk[async]   # adds httpx for the async client

Quickstart

from bee_sdk import Bee

bee = Bee()  # reads BEE_API_URL + BEE_API_KEY from env

print(bee.chat(
    "Explain Shor's algorithm at NISQ depth",
    domain="quantum",
))

Streaming

for chunk in bee.chat_stream(
    "Write a fibonacci function",
    domain="programming",
):
    print(chunk, end="", flush=True)

Async

import asyncio
from bee_sdk import Bee

async def main():
    client = Bee.async_client()  # requires bee-sdk[async]
    result = await client.chat(
        "Audit this code for SQL injection",
        domain="cybersecurity",
    )
    print(result)

asyncio.run(main())

Already using the OpenAI SDK? Just point it at Bee.

Because Bee speaks the OpenAI Chat Completions wire format, the official openai packages work against Bee with a base-URL change — useful for migration trials before adopting @cuilabs/bee or bee-sdk properly.

import OpenAI from "openai";

const bee = new OpenAI({
  apiKey: process.env.BEE_API_KEY,
  baseURL: "https://bee.cuilabs.io/bee",
});

Looking for the MCP integration with Claude Desktop / Cursor / VS Code? See /docs/mcp. Need an API key? Issue one in the workspace. SDK source mirrored at cuilabs/bee-community.