BotHub exposes an OpenAI-compatible HTTP API. The balance in your BotHub account can be spent directly from your own programs and scripts — or by an AI assistant you hand the credentials to.
Because the API is OpenAI-compatible, anything that accepts a custom base URL and API key works out of the box: the official OpenAI SDKs, LangChain, most desktop clients, and coding assistants like Claude or Codex.
https://bothub-api.bookab.info/v1
Send your API key with every request:
Authorization: Bearer bhk_live_xxxxxxxx
With an OpenAI SDK, only two parameters change:
from openai import OpenAI
client = OpenAI(
base_url="https://bothub-api.bookab.info/v1",
api_key="bhk_live_xxxxxxxx",
)
resp = client.chat.completions.create(
model="gpt-5.4",
messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
import OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'https://bothub-api.bookab.info/v1',
apiKey: 'bhk_live_xxxxxxxx',
})
const resp = await client.chat.completions.create({
model: 'gpt-5.4',
messages: [{ role: 'user', content: 'Hello' }],
})
console.log(resp.choices[0].message.content)
curl https://bothub-api.bookab.info/v1/chat/completions \
-H "Authorization: Bearer bhk_live_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.4",
"messages": [{"role": "user", "content": "Hello"}]
}'
Don't guess model names. One call tells you which models your key can use and what each one is:
curl https://bothub-api.bookab.info/v1/models \
-H "Authorization: Bearer bhk_live_xxxxxxxx"
{
"object": "list",
"data": [
{
"id": "gpt-5.4",
"object": "model",
"owned_by": "bothub",
"kind": "chat",
"endpoints": ["/v1/chat/completions", "/v1/responses"]
},
{
"id": "gpt-image-2.5",
"object": "model",
"owned_by": "bothub",
"kind": "image_generation",
"endpoints": ["/v1/images/generations"]
}
]
}
kind and endpoints are BotHub extensions (OpenAI SDKs ignore unknown fields): kind tells you
whether it is a chat, image, video or embedding model, and endpoints tells you exactly where to
send the request.
| Capability | Endpoint | Notes |
|---|---|---|
| Chat | POST /v1/chat/completions | OpenAI Chat Completions — streaming, tool calls, vision |
| Chat (new protocol) | POST /v1/responses | OpenAI Responses API |
| Embeddings | POST /v1/embeddings | Text embeddings |
| Images | POST /v1/images/generations | Returns the image synchronously |
| Video | POST /v1/videos | Asynchronous task |
| Image edit / video extend | POST /v1/tasks | Native async task API |
Not available yet: speech synthesis (/v1/audio/speech returns not_implemented); reranking
has no public endpoint.
If you want an AI assistant (Claude, Codex, some agent client) to call the API for you, this is all it needs:
The BotHub API is OpenAI-compatible.
Base URL: https://bothub-api.bookab.info/v1
API Key: bhk_live_xxxxxxxx
Start with GET /v1/models to see what is available — each entry's `kind` and
`endpoints` tell you what it is and where to send requests. For images use
POST /v1/images/generations; it returns data[0].b64_json synchronously.
Full docs: https://bothub.bookab.info/en/api/overview
detail field spelling out what to
do next (which scope is missing, which task to poll, which parameter is wrong). An AI that reads
it can usually correct itself.Create one yourself inside the BotHub app — all three platforms have it:
| Platform | Path |
|---|---|
| Desktop | Settings → Model Services → BotHub Built-in AI → External Access |
| Android | Settings → Model Services → BotHub Built-in AI → External Access |
| iOS | Settings → BotHub Built-in AI → External Access |
That screen copies the base URL, creates and revokes keys, and shows each key's request count and spend over the last 7 days.
bhk_live_xxxxxxxx_yyyyyyyy and are shown only once, right after creation —
close the dialog and it is gone for good, so copy it there and then. A key spends your account
balance: never commit one to a repository or ship one in frontend code. If one leaks, revoke it
from the same screen.New keys carry every scope by default (chat, images, video, embeddings), so they work right away.