Base44 app with OpenAI: AI launch checklist
Base44 apps call OpenAI models through Base44's built-in AI (InvokeLLM): no OpenAI account or key, and usage is billed through Base44's built-in AI (InvokeLLM). Of the 20 checks before you charge users, Base44 handles 1, partly handles 6, and leaves 13 to you.
Checked 12 Nov 2026 against each platform's docs; every fact links to its source.
How AI calls work in Base44
- Built-in AI
- Yes, two paths: the InvokeLLM core integration (base44.integrations.Core.InvokeLLM with a prompt and optional structured-output schema) and base44.aiGateway, an OpenAI-compatible endpoint for chat, images, video and speech with an 'automatic' default chat model, plus a 'typesafe' provider for the jev model.
- How calls run
- The gateway is 'Backend function only'; never send its token to the browser. base44.aiGateway uses the signed-in user's token (only on privately shared apps); base44.asServiceRole.aiGateway works with no user, e.g. scheduled automations.
- Your own keys
- AI integration catalog (OpenAI, Claude, Groq, Mistral): paste the key when prompted and save it in Dashboard → Secrets; cost controls then live in the provider's account. Calling an external service with your own key, even inside a backend function, doesn't use integration credits.
- Who pays
- The app owner's integration credits. InvokeLLM 'Automatic' about 1 credit per call; other models from about 3 credits; in-app agents from about 3 per message; backend functions about 1 credit per 100 runs. Gateway calls are 'metered against your app's credit quota'; 'If the app is out of credits, calls are rejected before the model runs.' dry_run: true returns a cost estimate. Requires Builder plan or above for AI integrations and backend functions.
Keys and secrets
- Where secrets live
- Dashboard → Secrets, an encrypted vault; secrets 'are only accessible from your app's backend and are never exposed to the people using your app'. Read them via the runtime secrets getter, not process.env or a VITE_ variable (build-time, client-visible).
- Server-side by default?
- Yes for InvokeLLM and the gateway (backend functions).
- How keys end up in the browser
- Putting a key in a VITE_ variable or visible component, or passing the gateway token to the browser; Base44 warns 'Never paste API keys into public code, visible components, or prompts.' The security scan checks for exposed secrets automatically.
The 20 checks, in Base44
What Base44 does for you, and what to ask it (or your coding agent) to add. Tick them off in the interactive checklist.
Cost and abuse
- Partly
A spending cap per user
Base44's credit limits apply to workspace members, not your users, so ask Base44: 'Create an AIUsage entity (user_id, day, credits) and, in the backend function that calls InvokeLLM, check base44.auth.me() and today's credits and return a daily-limit error before calling.'
- Partly
Rate limits on every AI endpoint
Base44 rate-limits public endpoints by default but publishes no numbers, so ask Base44 to add a per-user limit in each AI backend function using a RateLimit entity keyed by user id.
- Handled
AI keys only on the server
InvokeLLM and the gateway need no key and Secrets are backend-only; just never put a key in a VITE_ variable or send the gateway token to the browser, and run the security scan before publishing.
- You add it
Retries capped, with a timeout
Base44 says to set maxRetries: 0 on image, video, speech and evaluation gateway calls because 'Client retries replay billed requests'; ask Base44 to add a timeout and at most one retry on 5xx for text calls only.
- Partly
A budget alert at each AI provider
For built-in AI the integration-credit balance is the hard stop (end users then see a generic error), so watch the App usage page; for keys you bring, set limits at the provider.
Charging for AI use
- You add it
Every AI call charged or deliberately free
Ask Base44 to list every flow, automation, in-app agent and backend function that calls InvokeLLM or the gateway, mark each as charged or free on purpose, and use dry_run: true to estimate each one's credits.
- You add it
Credits deducted on the server, after success
Ask Base44: 'Create a UserCredits entity with RLS so users can read but not update their own record, and deduct in the backend function via asServiceRole after the AI result is saved.'
- You add it
Failed AI calls refunded
Ask Base44 to refund reserved credits with a logged reason when InvokeLLM or the gateway errors, is rejected for lack of credits, or returns empty or invalid output.
- You add it
One charge per request, even on a double click
Ask Base44 to pass a request_id from the page to the backend function, store it on an AIResult entity, return the saved result on repeats, and disable the button while running.
A record of every AI result
- You add it
Each AI result stored with its feature, model, prompt version and settings
Ask Base44 to create an AIResult entity (feature, model, prompt_version, params, input, user_id, credits from usage.base44_credits) written by the backend function for every call.
- You add it
Retries and corrections saved next to the original, never over it
Ask Base44 to save retries and edits as new AIResult records with parent_id and version, never updating the original.
- You add it
What users do next with each AI result, recorded on the server
Ask Base44 to add an AIEvent entity and a backend function logAiEvent called from the Retry, Edit, Copy and Export buttons.
What worked, for whom, at what cost
- You add it
Worked first time, per feature, model and prompt version
Ask Base44 for an admin-only page showing worked-first-time by feature, model and prompt version for 7 and 30 days.
- Partly
A cost record for every AI step
Gateway responses report credits and the App usage page shows integration credits by source, so save the reported credits per call on an AICost entity, retries included.
- You add it
Wasted AI spend and real cost per result, per feature
Ask Base44 for an admin page joining AICost and AIEvent: total credits, credits on results that didn't work, credits per result that worked, per feature and model.
- You add it
Who the AI fails for
Ask Base44 to save language, length band, input kind, plan and new-user flag on each AIResult and show worked-first-time per trait.
Switching safely
- You add it
Prompts in version control, with version labels
Ask Base44 to move prompts into one backend-function module with version labels saved on each AIResult.
- Partly
Model and prompt switchable by a flag
Changing the InvokeLLM model switches every flow and agent that uses it at once; for a gradual switch, ask Base44 to read model and prompt version per feature from a Settings entity with a user-id split.
- You add it
Real past requests to replay before a change
Ask Base44 for an admin backend function that replays 50 anonymised past AIResults through a chosen model (dry_run first for cost) and saves new results next to the originals.
- Partly
A plan for model shutdowns
The 'automatic' model is chosen by Base44; for any model you pin explicitly (e.g. a named video or image model), keep the ids in one config and write MODELS.md.
Spending limits in Base44
- Spending caps
- Integration credits are a hard ceiling for built-in AI; owners and admins can 'Set credit limit' per workspace member (not per app end user); email when integration credits run out. Auto top-up: not found.
- Rate limiting
- 'All public endpoints are rate-limited by default.' No numbers published; per-user limits not documented.
- Cost per user
- Credit usage by member, app and Superagent for owners/admins; App usage page shows integration credits by source with per-action details for builders. Nothing per end user. Users have requested more detailed integration-credit breakdowns and alerts on Base44's feedback board.
- Logs of AI calls
- Gateway responses include credit usage (usage.base44_credits; x-base44-credits header for speech). Audit logs are Enterprise-only. AI request/response logs: not found.
- Server functions
- Backend functions (public endpoints: 'anyone can call them, with any input'), flows/automations, scheduled automations via service role.
- Database
- Base44 entities with row-level and field-level security; the security scan reports rls_recommendations for entities whose RLS is too open.
If you switch to your own OpenAI key later, these are the limits to set at OpenAI:
- Organisation limit
- https://platform.openai.com/settings/organization/limits → Spend → Edit spend limit → Monthly spend limit → turn on 'Enforce a hard limit' → Save.
- Project limit
- https://platform.openai.com/settings/ → (project) Limits → Spend → Edit spend limit → same steps.
- What happens at the limit
- A spend alert only notifies; traffic continues. A hard limit makes requests return 429 with project_spend_limit_exceeded or organization_spend_limit_exceeded. Enforcement isn't instantaneous, so spend can slightly exceed the limit. Separate codes: organization_usage_limit_exceeded (OpenAI-assigned tier limit) and credit_balance_exhausted (prepaid credits gone).
- Note
- Community threads in 2025–2026 report hard caps disappearing and returning; the current official guide documents them.
- Key scoping
- Keys belong to projects; project service-account keys are unique to their project. Key permissions: All, Restricted or Read Only. Per project, owners can choose allowed models and set a rate limit per model under Limits. (From OpenAI help-center snippets; the page returned 403 to the fetcher.)
- Rate limits
- Set at organization and project level, not per user. Tiers: Free ($100/month usage limit, allowed geography), Build ($5 total credit purchases, $500/month), Launch ($100, $5,000/month), Grow ($500, $200,000/month); upgrades automatically. View at Settings → Organization → Limits (platform.openai.com/settings/organization/limits). The current page no longer uses 'Tier 1–5' names.
- Where usage shows
- Usage at https://platform.openai.com/settings/organization/usage, grouped by project and model. Per-API-key grouping is reported by a third-party summary of OpenAI's changelog, but community threads say some accounts only see project/model; not confirmed in official docs.
developers.openai.com ↗developers.openai.com ↗help.openai.com ↗help.openai.com ↗
Mistakes Base44 apps make at launch
AI backend functions callable by anyone, spending the owner's credits.
Base44 docs: server functions and routes 'are public endpoints: anyone can call them, with any input', and every gateway call spends the owner's credits, so guard user-triggered functions with base44.auth.me().
Trusting the platform's access controls without checking data rules.
July 2025: Wiz found undocumented register/verify-otp endpoints that let anyone with an app_id create verified accounts on private Base44 apps (patched within 24 hours). Base44's scan now reports rls_recommendations for entities whose RLS is too open.
Running out of integration credits with no warning to users.
When integration credits run out, credit-using actions fail, backend functions stop, and end users see a generic error that doesn't mention credits; owners get one email. Users on Base44's feedback board ask for per-function usage breakdowns and alerts.
Questions
How do AI calls work in a Base44 app with OpenAI?
Base44 apps call OpenAI models through Base44's built-in AI (InvokeLLM): no OpenAI account or key, and usage is billed through Base44's built-in AI (InvokeLLM).
Can Base44 cap AI spending per user?
Partly. Base44's credit limits apply to workspace members, not your users, so ask Base44: 'Create an AIUsage entity (user_id, day, credits) and, in the backend function that calls InvokeLLM, check base44.auth.me() and today's credits and return a daily-limit error before calling.'
Where should the OpenAI key live in Base44?
Handled. InvokeLLM and the gateway need no key and Secrets are backend-only; just never put a key in a VITE_ variable or send the gateway token to the browser, and run the security scan before publishing.