Skip to content

Docs

Build with Bee.

Bee exposes an OpenAI-compatible Chat Completions API. Drop-in compatible with any client that already speaks OpenAI; switch the base URL and key, and you're shipping.

Quickstart

Three steps. Sign up, mint a key, send your first request.

  1. 1. Open a workspace — free tier, no card required.
  2. 2. Generate an API key under Settings → API keys.
  3. 3. Send your first request:
curl
curl https://api.bee.heossi.com/bee/chat/completions \
  -H "Authorization: Bearer $BEE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bee-comb",
    "messages": [
      { "role": "user", "content": "Explain post-quantum cryptography in one paragraph." }
    ]
  }'

OpenAPI contract

The machine-readable contract is the source for supported public gateway paths, authentication, and request fields. It is versioned with the API deployment.

OpenAPI 3.1
GET https://api.bee.heossi.com/openapi.json

Use the OpenAPI 3.1 contract for generated clients and validation, or import the Postman collection. This page is the human-readable reference for the same supported surface.

Authentication

Bearer tokens. Pass your API key in the Authorization header.

HTTP
Authorization: Bearer bee_sk_live_...

Public-tier requests run over standard TLS 1.3. Bee Enclave Sovereign customer transport runs over the post-quantum stack (FIPS 203 ML-KEM + FIPS 204 ML-DSA); see TrustHub security centre for the rollout posture.

Chat completions

Same shape as OpenAI's /chat/completions — see the request schema below. Tool calling and structured output are available on the models that list those capabilities in the live model catalog.

POST /chat/completions
{
  "model": "bee-hive",
  "messages": [
    { "role": "system", "content": "You are a senior security engineer." },
    { "role": "user",   "content": "Audit this Kyber key exchange." }
  ],
  "temperature": 0.7,
  "max_tokens": 1024,
  "stream": false,
  "tools": [/* function-calling spec */],
  "response_format": { "type": "json_object" }
}
200 response
{
  "id": "cmpl_01HZ...",
  "object": "chat.completion",
  "model": "bee-hive",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "..." },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 42,
    "completion_tokens": 287,
    "total_tokens": 329
  }
}

Models

Six production tiers. The adaptive router picks the right size automatically when you specify model: "bee"; pin a tier explicitly to control cost and latency.

  • bee-cell131K context · $0.30 / 1M / $1.20 / 1M
  • bee-brood262K context · $0.60 / 1M / $2.40 / 1M
  • bee-comb262K context · $1.25 / 1M / $5.00 / 1M
  • bee-buzz262K context · $2.50 / 1M / $10.00 / 1M
  • bee-hive262K context · $5.00 / 1M / $20.00 / 1M
  • bee-swarm1M context · $10.00 / 1M / $40.00 / 1M

Prices are USD per 1M tokens (input / output). Full lineup on the models page.

RAG (retrieval)

Add documents to your account, then retrieve the most relevant chunks via the documents API. Both are tenant-scoped to your key. Chunking, embedding, and approximate-nearest-neighbour retrieval are managed for you. Requires a plan that includes RAG.

POST /bee/documents/*
# Add a document (source + text content)
curl https://api.bee.heossi.com/bee/documents/upload \
  -H "Authorization: Bearer $BEE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "source": "whitepaper.txt", "content": "Bee is a tiered LLM…" }'

# Retrieve the top-k matching chunks for a query:
curl https://api.bee.heossi.com/bee/documents/retrieve \
  -H "Authorization: Bearer $BEE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "what is post-quantum cryptography?", "k": 3 }'

Quantum Reasoning Lab

Create a durable, encrypted product job. Customer-local simulation and BYOPA Direct run outside Bee. Simulation Cloud, Managed QPU, and BYOPA Managed require a purchased entitlement; hosted execution also requires an independent platform budget.

POST /bee/quantum-reasoning/jobs
curl https://api.bee.heossi.com/bee/quantum-reasoning/jobs \
  -H "Authorization: Bearer $BEE_API_KEY" \
  -H "Idempotency-Key: $UUID" \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "Compare the candidates", "model": "bee-hive", "product": "simulation_cloud" }'

# 202 → { "job": { "id": "…", "status": "queued", "product": "simulation_cloud" } }

Agent provenance

Send a stable session_id on your agent-loop requests and Bee seals every served turn into a per-session, post-quantum ML-DSA-65 (NIST FIPS 204) hash chain — a tamper-evident record of what the agent did. Only cryptographic digests are stored; your code never leaves in the record. Fetch a session to verify it (scoped to your own account); the response includes the SPKI public key so you can independently re-verify every link offline with any FIPS-204 verifier. SDKs expose bee.provenance.verify(sessionId) (TypeScript) and bee.provenance(session_id) (Python).

POST /bee/chat/completions (seal a turn)
curl https://api.bee.heossi.com/bee/chat/completions \
  -H "Authorization: Bearer $BEE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "model": "bee-cell", "surface": "agent",
        "session_id": "my-coding-session-1",
        "messages": [ ... ] }'
GET /bee/provenance/:session_id (verify)
curl https://api.bee.heossi.com/bee/provenance/my-coding-session-1 \
  -H "Authorization: Bearer $BEE_API_KEY"

# 200 → { "session_id": "my-coding-session-1", "verified": true, "turns": 3,
#         "signature_algorithm": "ML-DSA-65",
#         "public_key_pem": "-----BEGIN PUBLIC KEY-----\n…",
#         "chain": [ { "seq": 0, "action": { "tool": "agent.turn",
#           "argsDigest": "sha384:…", "resultDigest": "sha384:…" },
#           "signature": "…" }, … ] }

Streaming

Set stream: true. Responses arrive as Server-Sent Events with the same delta format OpenAI uses.

data: lines
data: {"choices":[{"delta":{"content":"Post-"}}]}
data: {"choices":[{"delta":{"content":"quantum"}}]}
data: {"choices":[{"delta":{"content":" cryptography"}}]}
data: [DONE]

Errors

Standard HTTP status codes. Body is { error: { code, message } }.

  • 400 — invalid request (schema)
  • 401 — missing or invalid API key
  • 402 — overage blocked: usage credits on, but the wallet is empty or the monthly cap is reached
  • 429 — token allowance exhausted (enable usage credits or upgrade), or rate limited; honour Retry-After
  • 500 — engine fault; safe to retry

Rate limits

Per-key, per-minute. Limits scale with plan tier; see pricing for the per-plan token allowance.

Every response includes:

response headers
X-Bee-RateLimit-Limit:     1000
X-Bee-RateLimit-Remaining: 873
X-Bee-RateLimit-Reset:     1714867200
X-Bee-Pool-Remaining:      9842917

More docs are on the way. SDK reference (Python, Node, Rust, Go), tool-use cookbook, and migration guides from OpenAI / Anthropic ship as we cut their APIs over.

Need something now? Ask support.