Appbricx
Docs
FeaturesPricingStart free

Get started

OverviewWhat Appbricx isQuickstart with a coding agentQuickstart with the builderCore concepts

Guides

Data and tablesAccess and rolesBusiness rulesSign-inCustom screensRealtime and topicsWorkflows, schedules and webhooksServer functionsAI in your appPaymentsFilesMessagesIntegrationsVerifyPublishing, domains and rollbackOperating your appExport and self-hostSelf-host install

Tutorials

Build a booking app with Claude CodeMulti-user todo listClient portalSlack on new sign-upTemplates

Reference

Reference homeFrontend SDKHTTP APIMCP toolsCLIIntegrations catalogContract formatAI key resolutionRun Appbricx locally

AI

Ask the app's AI for summaries, suggestions, drafts and classifications. Calls go through /__appbricx/ai/chat with the project's own key or plan credits; the provider key never reaches the browser.

2 membersSDK referenceGuide: Add AI to your app

On this page
  1. app.ai
  2. app.ai.ask
  3. app.ai.chat
  4. Types

AI is metered to the project, with per-app and per-user budgets. A call rejects when AI is off for the project, the budget is spent or there are no credits: catch it and show a fallback.

app.ai

app.ai.askmethod

One answer for one prompt.

app.ai.ask(prompt: string, opts?: AppAiOptions): Promise<string>

Parameters

NameTypeDescription
promptrequiredstringWhat to ask.
optsoptionalAppAiOptions{ system?, maxTokens? }: the assistant's role and rules, and an upper bound on the answer's length (the project's cap still applies).
Returns
The answer text.
Errors
  • "AI isn't available in this preview" without a runtime.
  • The server's message: AI_DISABLED_FOR_PROJECT, BUDGET_EXCEEDED ("Per-user token budget exceeded" or "Project token budget exceeded"), INSUFFICIENT_CREDITS, RATE_LIMITED, PROVIDER_ERROR.
Permissions
Any caller of the app may ask; spend is metered to the project and to the end user, and the model allow-list applies.
Example
try {
  const summary = await app.ai.ask(`Summarize in two sentences:\n${ticket.body}`, { maxTokens: 120 });
  setSummary(summary);
} catch {
  setSummary("Summary unavailable.");
}

Relatedapp.ai.chatPOST /__appbricx/ai/chatctx.ai.ask

Source: packages/appkit/src/kits/primitives/app-handle.ts:107

app.ai.chatmethod

The next assistant turn of a conversation.

app.ai.chat(messages: AppAiMessage[], opts?: AppAiOptions): Promise<string>

Parameters

NameTypeDescription
messagesrequiredAppAiMessage[]The conversation so far: [{ role: "user" | "assistant", content }]. Empty turns are dropped; at most 64 messages.
optsoptionalAppAiOptions{ system?, maxTokens? }.
Returns
The assistant's reply text.
Errors
  • "ask the AI something first" when no non-empty turn is left.
  • The same server errors as ask.
Permissions
As ask.
Example
const reply = await app.ai.chat(
  [...history, { role: "user", content: input }],
  { system: "You are the help desk for Tablefor. Be brief." },
);
setHistory((h) => [...h, { role: "user", content: input }, { role: "assistant", content: reply }]);

Relatedapp.ai.askPOST /__appbricx/ai/chat

Source: packages/appkit/src/kits/primitives/app-handle.ts:109

Types

type AppAiMessage = {
    role: "user" | "assistant";
    content: string;
}

Source: packages/appkit/src/kits/primitives/app-handle.ts:93

type AppAiOptions = {
    system?: string;
    maxTokens?: number;
}

Source: packages/appkit/src/kits/primitives/app-handle.ts:94

On this page

  1. app.ai
  2. app.ai.ask
  3. app.ai.chat
  4. Types
Appbricx

The backend, runtime and hosting for apps your coding agent builds. On our cloud, in yours, or on your own servers.

Features

Coding agents and MCPVerify testingBuilder consolePostgres databaseData APIRealtimeRow-level securitySign-in and authPaymentsWorkflows and jobsAI in your appIntegrationsBackups and rollbackHosting and domainsSelf-host and exportAll features

Product

ShowcasePricingFor coding agentsTemplatesPrivate cloudBring your own AI keyFAQ

Compare

Appbricx vs SupabaseLovable alternativeBolt alternativeFor freelancersFor agencies

Resources

DocumentationReferenceBlogSupportContact

© 2026 Appbricx. All rights reserved.

TermsPrivacyCookiesAcceptable Use