SDKs and curl
If your code already uses the OpenAI or Anthropic SDK, change the base URL and the key. Nothing else needs a new library.
Before you start
Create an account with a verified email address, add prepaid balance, then create a key on the console's API keys page. Keep the key secret.
Model IDs are listed in the console and returned by GET https://api.6bee.ai/v1/models. Replace <model id> with one of them.
curl
curl https://api.6bee.ai/v1/chat/completions \
-H "Authorization: Bearer $SIXBEE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "<model id>", "stream": true, "max_tokens": 2048,
"messages": [{"role": "user", "content": "Write a unit test for fizzbuzz"}]}' Python (OpenAI SDK)
from openai import OpenAI # pip install openai
client = OpenAI(base_url="https://api.6bee.ai/v1", api_key="<your key>")
reply = client.chat.completions.create(
model="<model id>", max_tokens=2048,
messages=[{"role": "user", "content": "Explain this stack trace"}])
print(reply.choices[0].message.content) Node.js (OpenAI SDK)
import OpenAI from 'openai'; // npm install openai
const client = new OpenAI({ baseURL: 'https://api.6bee.ai/v1', apiKey: process.env.SIXBEE_API_KEY });
const stream = await client.chat.completions.create({
model: '<model id>', max_tokens: 2048, stream: true,
messages: [{ role: 'user', content: 'Explain this stack trace' }],
});
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? ''); Python (Anthropic SDK)
The Anthropic format lives on the same host, without /v1 in the base URL:
from anthropic import Anthropic # pip install anthropic
client = Anthropic(base_url="https://api.6bee.ai", api_key="<your key>")
reply = client.messages.create(
model="<model id>", max_tokens=2048,
messages=[{"role": "user", "content": "Explain this stack trace"}])
print(reply.content[0].text) List the models
curl https://api.6bee.ai/v1/models \
-H "Authorization: Bearer $SIXBEE_API_KEY" Errors and limits
Over a limit you get HTTP 429 with Retry-After, or 400 when a request can’t fit the context. A lowered output cap is reported in the X-6bee-Output-Cap response header; on /v1/messages a thinking budget is lowered with it.
- Context
- Input plus output up to the model’s window: 128K to 1M tokens, depending on the model.
- Output
- max_tokens up to the model’s output cap: 16,384 to 131,072, depending on the model. Larger values are lowered to the cap, not rejected. If omitted: 8,192 to 32,768.
- Input tokens
- 1,000,000 uncached tokens per rolling minute. Cache hits don’t count.
- Requests
- 60 per minute.
- Concurrency
- 2 requests at a time.
- Request body
- Up to 8 MiB. n must be 1.
- On 429, wait for the number of seconds in
Retry-After, then retry. - Send
n: 1. Other values are rejected. - Keep the key on a server. Do not ship it in client-side code or a public repository.