AI features for your app
You can add AI capabilities like chatbots, image generation, and audio tools to your app simply by asking in the chat. Lovable handles the backend code and connections automatically, so you do not need your own provider accounts or keys.
Anyone who wants to build AI-powered features into their app without managing third-party accounts or secret keys.
Do this, in order
- 1
Describe the AI feature you want in the project chat, naming a specific model if desired or letting Lovable choose one.
Lovable automatically writes the code and sets up the right model for your use case.
- 2
Let Lovable generate the backend function and attach the built-in project key.
Running requests through a backend function keeps your app secure and avoids exposing credentials.
- 3
Publish your application.
Your live users will not be able to use the new AI features until your latest changes are deployed.
- 4
Open More, then select AI to review your usage dashboard.
This shows how many credits your AI features use, average response times, and failure logs.
Paste this into your project
Add an AI assistant chat feature to this app using the built-in AI connector. Allow users to send questions and see streaming responses powered by GPT-6 Astra, handling all calls securely through a backend function.
Words decoded
- Backend function
- Code that runs on Lovable's secure servers instead of inside your user's web browser, keeping private setup details safe.
- Streaming
- Delivering text piece by piece as it is being written, rather than waiting for the entire response to finish.
- AI Gateway
- The central pipeline Lovable uses to route model calls from your app to AI providers and track credit costs.
Where people get stuck
- AI calls made inside your deployed app consume workspace credits; running out of credits will cause AI features to fail with a 402 error.
- Canceling an active AI request may still consume credits because providers report usage before closing the connection.
- Disabling the built-in AI connector in workspace admin settings immediately breaks AI calls across all apps in that workspace, including published ones.
- Enterprise plans and EU inference settings restrict which models can be used until specific workspace permissions are granted.
The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.