All docs

API reference

One host, one key, three request formats. Everything a client needs to know about the 6bee.ai API is on this page.

Base URL and authentication

API host
https://api.6bee.ai
OpenAI format
Base URL https://api.6bee.ai/v1. Used by Chat Completions and Responses.
Anthropic format
Base URL https://api.6bee.ai. The client adds /v1/messages itself.
Authentication
Authorization: Bearer <your key>. The Anthropic format also accepts x-api-key: <your key>.
API key
Created in the console under API keys. One key works for all three formats.

Most connection problems are a base URL with one /v1 too many or too few. Three rules cover every tool:

  1. A tool that asks for an OpenAI base URL gets https://api.6bee.ai/v1.
  2. A tool that asks for an Anthropic base URL gets https://api.6bee.ai, without /v1.
  3. A tool that adds /v1 on its own, such as Cherry Studio, gets the host only. The setup guides say which rule applies to each tool.

Send your key only to https://api.6bee.ai. Keep it on a server or in your own tools, never in client-side code or a public repository.

Your first request

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.

shell
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"}]}'
app.py
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)

The SDK guide has Node.js and the Anthropic SDK. The setup guides cover coding agents and chat apps.

GET /v1/models

Returns the models your key can use, in the OpenAI list format. Use the id values as the model field of a request.

shell
curl https://api.6bee.ai/v1/models \
  -H "Authorization: Bearer $SIXBEE_API_KEY"
response
{
  "object": "list",
  "data": [
    { "id": "<model id>", "object": "model", "owned_by": "..." }
  ]
}

Prices and context sizes are shown per model in the console.

POST /v1/chat/completions

The OpenAI Chat Completions format. This is what most SDKs, chat apps and editor agents send.

FieldNotes
modelRequired. An ID from GET /v1/models.
messagesRequired. The conversation so far, with system, user, assistant and tool roles.
max_tokensmax_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.
streamtrue streams the answer over server-sent events.
temperature, top_p, stopPassed to the model.
tools, tool_choicePassed to the model. Tool calling works on models that implement it; behaviour differs between models.
nMust be 1 or left out. Other values return 400 n_not_supported.
response
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "model": "<model id>",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "..." },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 21, "completion_tokens": 142, "total_tokens": 163 }
}

The usage block is what you are billed for. The same numbers appear in the console’s usage log.

Streaming

All three formats stream over server-sent events (SSE). Set stream: true and read the events as they arrive.

  • Chat Completions sends chat.completion.chunk objects and ends with data: [DONE].
  • Messages and Responses send the typed events of their own formats, so the Anthropic SDK, Claude Code and Codex read them as usual.
  • WebSocket mode is not available.
  • A streamed request counts as one request in progress until the stream ends. Close streams you no longer need.

POST /v1/messages

The Anthropic Messages format, for Claude Code and the Anthropic SDK. The base URL has no /v1.

shell
curl https://api.6bee.ai/v1/messages \
  -H "x-api-key: $SIXBEE_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "<model id>",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello"}]
  }'
  • Authenticate with x-api-key or with a Bearer token.
  • Errors come back in Anthropic’s format, so Anthropic clients handle them as usual.
  • When max_tokens is lowered to the model’s cap, a thinking budget is lowered with it.

Setup for Claude Code is in the Claude Code guide.

POST /v1/responses

The OpenAI Responses format, for Codex.

shell
curl https://api.6bee.ai/v1/responses \
  -H "Authorization: Bearer $SIXBEE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<model id>",
    "input": "Hello",
    "max_output_tokens": 1024
  }'

No conversation state is kept on the server, in line with not storing conversations. Send the full input on every turn:

  • store and previous_response_id are not supported.
  • WebSocket mode is not supported. Streaming uses server-sent events.

Setup for Codex is in the Codex guide.

Billing and the balance reserve

Your balance is charged per token at each model’s price. Each request first reserves its input plus max_tokens of output; when it finishes you pay for what was used, and the rest goes back to your balance.

  1. Reserve. Before a request is sent to the model, its input plus max_tokens of output is reserved from your balance.
  2. Settle. When the request finishes, you are charged for the tokens actually used.
  3. Release. The rest of the reserve goes back to your balance.

A request the balance cannot cover is rejected before it reaches the model. Top up, or lower max_tokens so the reserve is smaller.

Prices are in US dollars, per token, per model. They are listed in the console.

Rate limits

Beta limits apply per account, across all of its keys. Creating more keys does not raise them.

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.

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.

Errors

Errors use standard HTTP status codes. Where a code is listed it is stable, so your client can branch on it.

StatusCodeMeaning and what to do
400context_budget_exceededInput plus maximum output does not fit the model’s context window. Shorten the input, compact the conversation or lower max_tokens.
400n_not_supportedn is greater than 1. Send separate requests instead.
401The key is missing or wrong.
413The request body is larger than 8 MiB.
429account_concurrency_limitThe account already has 2 requests in progress. Retry when one finishes.
429account_input_tpm_limitThe account used its input tokens for this minute. Retry-After gives the number of seconds to wait.
429More than 60 requests in a minute. Slow down and retry.
5xxThe model’s provider failed or timed out. Retry with a short backoff.

The body follows the OpenAI error format on the OpenAI endpoints:

response
{
  "error": {
    "message": "This account already has 2 requests in progress (limit 2). Retry when one finishes.",
    "type": "new_api_error",
    "code": "account_concurrency_limit"
  }
}

Error messages usually end with a request ID. Quote it when you contact support.

Response headers

HeaderWhenValue
X-6bee-Output-CapYour max_tokens was above the model’s cap and was lowered.The cap that was applied, in tokens.
Retry-AfterOn HTTP 429.Seconds to wait before retrying.
X-Oneapi-Request-IdOn API responses.The request ID, for support.

Uncensored models and the rules

Every model listed is an open-weight model tuned to remove refusals. That describes the model, not the rules: the Acceptable Use rules in the Terms of Service apply whatever a model will generate.

See what uncensored means here and what is and is not stored.