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.

API contract

The public OpenAPI contract is versioned with the gateway and describes the supported Bee developer surface. Use it to generate internal clients or validate integrations.

HTTP quickstart

curl https://api.bee.heossi.com/bee/chat/completions \
  -H "Authorization: Bearer $BEE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bee-cell",
    "messages": [{"role": "user", "content": "Hello, Bee."}],
    "stream": false
  }'

TypeScript / JavaScript

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

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

Quickstart

import { BeeClient } from "@heossihq/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].

Live on PyPI

Install from PyPI (canonical). Full SDK docs: bee.heossi.com/docs.

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 @heossihq/bee or bee-sdk properly.

import OpenAI from "openai";

const bee = new OpenAI({
  apiKey: process.env.BEE_API_KEY,
  baseURL: "https://api.bee.heossi.com/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 heossihq/bee-public.