Budibase/budibase · error · HTTPError
No license key found
Error message
No license key found
What it means
When creating an AI config that routes through Budibase Cloud, the server uses the workspace license key as the API key (api_key) against the BUDICLOUD_URL ai endpoint. If licensing.keys.getLicenseKey() returns nothing, it throws a 422 HTTPError because the cloud provider config cannot authenticate without a license.
Source
Thrown at packages/server/src/sdk/workspace/ai/configs/index.ts:195
| "reasoningEffort"
| "webSearchConfig"
| "name"
| "isDefault"
>
): Promise<CustomAIProviderConfig> {
const db = context.getWorkspaceDB()
const isBBAI = config.provider === BUDIBASE_AI_PROVIDER_ID
const isSelfhost = env.SELF_HOSTED
if (isBBAI && isSelfhost) {
const baseUrl = env.BUDICLOUD_URL.endsWith("/")
? env.BUDICLOUD_URL
: `${env.BUDICLOUD_URL}/`
config.credentialsFields.api_base = new URL("api/ai", baseUrl).toString()
const licenseKey = await licensing.keys.getLicenseKey()
if (!licenseKey) {
throw new HTTPError("No license key found", 422)
}
config.credentialsFields.api_key = licenseKey
}
const configId =
config.provider === BUDIBASE_AI_PROVIDER_ID
? docIds.generateAIConfigID("bbai")
: docIds.generateAIConfigID()
let modelId
if (!isBBAI || isSelfhost) {
const resolvedCredentialFields = await resolveCredentialFields(
config.credentialsFields
)
await liteLLM.validateConfig({
provider: config.provider,
name: config.model,View on GitHub (pinned to a81a902e9a)
Solutions
- Upload/activate a valid license key so licensing.keys.getLicenseKey() returns a value (env LICENSE_KEY or license activation flow).
- Use a non-cloud AI provider (e.g. OpenAI API key) instead of the Budibase cloud provider if no license is available.
- Verify BUDICLOUD_URL and license sync with Budibase Cloud if a license should exist but is not resolving.
Example fix
// before
# .env (self-host, no license)
await sdk.ai.configs.create({ provider: BUDIBASE_AI_PROVIDER_ID, ... }) // 422
// after
# .env
LICENSE_KEY=<valid-license>
# or configure an alternative provider with its own api_key Defensive patterns
Strategy: validation
Validate before calling
const licenseKey = await licensing.keys.getLicenseKey()
if (!licenseKey && config.provider === BUDIBASE_AI_PROVIDER_ID) {
throw new HTTPError("A license key is required for the Budibase cloud AI provider", 422)
} Type guard
const canUseBudibaseCloudProvider = async (): Promise<boolean> => !!(await licensing.keys.getLicenseKey())
Try / catch
try {
await sdk.ai.configs.create({ provider: BUDIBASE_AI_PROVIDER_ID, ...config })
} catch (err) {
if (err instanceof HTTPError && err.status === 422 && err.message === "No license key found") {
// instruct admin to activate a license or choose another provider
}
} Prevention
- Set/activate LICENSE_KEY before offering the Budibase cloud AI provider on self-hosted installs.
- Feature-gate the cloud provider option in the UI when no license is present.
- Monitor license expiry and alert before cloud AI configs stop working.
When it happens
Trigger: Creating/saving an AI config for the Budibase cloud provider on a self-hosted installation without an uploaded license key, or where the license is absent/expired so getLicenseKey() resolves null.
Common situations: Self-hosted Budibase (Docker/K8s) with no LICENSE_KEY set in the environment or license never activated; expired license removed by the worker; trying Budibase-hosted models without a paid plan.
Related errors
- LLM not available
- Quotas do not exist for planType=${planType} and hosting=${h
- Agent is not properly configured: missing AI config
- No license key found
- Workspace DB not found - self-host users using cloud don't h
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/1d01c7bbd4cb483b.
Report an issue: GitHub.