Budibase/budibase · error · HTTPError
Unsupported BBAI model: ${model}
Error message
Unsupported BBAI model: ${model} What it means
Budibase AI v2 chat completions only accept model identifiers namespaced with the 'budibase/' prefix. If the request body's model field is set to anything else (OpenAI-style names, custom strings, empty-ish variants), the endpoint rejects it with HTTP 400 to prevent routing to unknown providers.
Source
Thrown at packages/server/src/api/controllers/ai/budibaseai-v2.ts:80
}
}
export async function chatCompletionV2(ctx: Ctx<ChatCompletionRequestV2>) {
const { messages, model, stream } = ctx.request.body
if (!messages?.length) {
ctx.throw(400, "Missing required field: messages")
}
if (env.SELF_HOSTED && !env.isDev()) {
ctx.throw(500, "Budibase AI endpoints are not available in self-host")
}
if (!model) {
ctx.throw(400, "Missing required field: model")
}
if (!model?.startsWith("budibase/")) {
throw new HTTPError(`Unsupported BBAI model: ${model}`, 400)
}
const bbaiKey = bbai.getBBAIKey()
await quotas.throwIfBudibaseAICreditsExceeded()
const requestBody = {
...ctx.request.body,
metadata: {
...ctx.request.body.metadata,
tags: getBBAITags(),
},
}
const upstreamResponse = await fetch(
`${environment.LITELLM_URL.replace(/\/$/, "")}/chat/completions`,
{
method: "POST",View on GitHub (pinned to a81a902e9a)
Solutions
- Prefix the model with 'budibase/', e.g. model: 'budibase/gpt-4o-mini'
- Check the deployed Budibase version for the exact list of supported budibase/ model ids
- If you need a non-budibase provider, call that provider's API directly instead of the BBAI endpoint
Example fix
// before
{ "model": "gpt-4o-mini", "messages": [...] }
// after
{ "model": "budibase/gpt-4o-mini", "messages": [...] } Defensive patterns
Strategy: validation
Validate before calling
if (!model?.startsWith("budibase/")) {
throw new Error(`Model must start with "budibase/", got: ${model}`)
} Type guard
const isBbaiModel = (m: unknown): m is `budibase/${string}` =>
typeof m === "string" && m.startsWith("budibase/") Try / catch
try {
await bbaiChat({ model, messages })
} catch (e) {
if (e.status === 400 && String(e.message).includes("Unsupported BBAI model")) {
// correct the model id and retry once
}
} Prevention
- Keep a single BBAI_MODEL constant with the budibase/ prefix
- Validate model names against a supported list before sending
- Never reuse OpenAI/Anthropic model ids against the BBAI endpoint
When it happens
Trigger: POST to the BBAI v2 chat completion endpoint with body.model such as 'gpt-4o', 'claude-3', or a typo'd id that does not start with 'budibase/'.
Common situations: Clients configured for the generic OpenAI-compatible API reused against Budibase AI; model lists copied from other providers; older SDK versions pre-dating the budibase/ prefix convention.
Related errors
- AI message content must be a string
- Tool name must be under 64 characters long
- Cannot create a query tool without a query ID
- Invalid bookmark query
- Invalid limit query
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/9b1741b11b844cee.
Report an issue: GitHub.