> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lovable.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# AI features for your app

> Add AI features like chatbots, summaries, and image generation to your Lovable app with the built-in AI connector. No API keys or provider setup required.

Normally, adding AI to an app means choosing a provider, managing API keys, setting up billing, securing credentials, and wiring model calls into your backend. Lovable’s built-in AI connector handles that setup for you, so you can add AI features to your app by describing what you want to build.

These AI features run inside your app. They are separate from the Lovable agent that helps you build and edit your project.

Some examples include:

* **Summaries**: automatically condense long text into clear takeaways.
* **Chatbots and assistants**: build conversational helpers into your app.
* **Sentiment detection**: understand user feedback at scale.
* **Document Q\&A**: let users ask questions directly against your content.
* **Creative generation**: brainstorm ideas, draft copy, or expand concepts.
* **Translation**: serve users across languages.
* **Image and document analysis**: extract, summarize, and interpret key information from unstructured content.
* **Workflow automation**: handle repetitive or multi-step tasks inside your app.
* **Semantic search and retrieval-augmented generation (RAG)**: search documents, knowledge bases, and content by meaning instead of exact keywords.
* **Text-to-speech**: turn text into spoken audio for voice narration, read-aloud, and audio-first experiences.
* **Speech-to-text**: transcribe voice notes, recordings, and meetings, and add voice input or dictation.

## Enabling the built-in AI connector

<Note>
  For the best experience, use the built-in AI connector together with the [built-in backend (Cloud)](/features/cloud), so your app can make secure model calls.
</Note>

By default, the built-in AI connector is enabled for your workspace, and Lovable can add AI features to your app when requested. To manage the built-in AI connector for your projects, open **Connectors**, select **AI**, and adjust the settings under **Manage my agent's permissions**.

Workspace admins can also disable the built-in AI connector entirely for the workspace from **Connectors** → **Admin settings**.

### Permission preferences

The default setting is **Always allow**, meaning the built-in AI connector can be used automatically in your projects. You can change your preference anytime: open **Connectors**, select **AI**, and adjust the settings under **Manage my agent's permissions**.

Choose between:

* **Always allow**: Lovable automatically performs the action without asking for review or approval.
* **Ask each time**: Lovable asks for your approval whenever the action is needed. For example, if you want to add a chatbot, you can:
  * **Allow**: enable the integration for the current project.
  * **Deny**: decline the integration for this request. You may be asked again later.
  * **Adjust preferences**: change the default behavior for future projects. This does not affect the current project.
* **Never allow**: Lovable blocks the action, informs you that AI is required, and instructs you to enable the built-in AI connector.

## How it works

Lovable sets up the AI infrastructure for you:

* **API key**: Lovable automatically generates and manages a `LOVABLE_API_KEY` for each project. You never need to create or provide it yourself. When a project is remixed, a fresh key is generated for the new project automatically.
* **Backend calls**: AI calls run through a secure backend edge function that Lovable creates for you. Calls are never made directly from the browser, which keeps your credentials and prompts server-side.
* **Streaming**: the built-in AI connector supports streaming responses with server-sent events (SSE). Lovable uses streaming by default for chatbot and assistant features, so responses appear token by token rather than all at once.

## Supported models for AI features in your app

<Note>
  These models are available for AI features inside the apps you build, such as chatbots, image generation, semantic search, and voice. They are not the models Lovable uses to write, edit, or reason about your code.
</Note>

When you ask Lovable to add or update an AI feature, you can name a supported model or describe what you want and let Lovable pick the right one. Each model links to its official source for technical details.

### Choosing a model

Not sure which to use? Describe what you want, and Lovable picks a model for you. This table shows where to start and when you might switch.

| Use case                                                 | Start with                          | Switch when                                         |
| -------------------------------------------------------- | ----------------------------------- | --------------------------------------------------- |
| Chat and assistant features                              | Gemini 3 Flash Preview              | You need deeper reasoning or longer context.        |
| High-volume, simple text tasks                           | Gemini 3.1 Flash Lite or GPT-5 Nano | Accuracy matters more than cost.                    |
| Image generation and editing                             | GPT Image 2                         | You want lower-cost drafts or a Gemini image model. |
| Semantic search and retrieval-augmented generation (RAG) | Gemini Embedding 001                | You need multimodal retrieval.                      |
| Text-to-speech                                           | GPT-4o Mini TTS                     | You need character or higher-fidelity voices.       |
| Speech-to-text                                           | GPT-4o Mini Transcribe              | You need higher transcription accuracy.             |

### Chat models

Chat models power conversational and text features: chatbots, assistants, summaries, document Q\&A, translation, classification, and extraction. They range from fast, low-cost models for simple tasks to high-reasoning models for complex work.

Ask Lovable to:

* Build a chatbot or in-app assistant.
* Summarize long text, documents, or transcripts.
* Answer questions from your own content.
* Classify, extract, or translate text.

| Model                                                                                                            | Best for                                                                                                  |
| ---------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| [Gemini 3 Flash Preview (default)](https://ai.google.dev/gemini-api/docs/models/gemini-3-flash-preview)          | Fast, general-purpose chat and iterative builds where responsiveness matters.                             |
| [Gemini 3.5 Flash](https://deepmind.google/models/model-cards/gemini-3-5-flash/)                                 | Fast coding, reasoning, and agentic workflows.                                                            |
| [Gemini 3.1 Pro Preview](https://ai.google.dev/gemini-api/docs/models/gemini-3.1-pro-preview)                    | Advanced coding, long-context understanding, and complex multi-step reasoning. Slower and premium-priced. |
| [Gemini 3.1 Flash Lite](https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-lite)                      | High-volume, lightweight tasks like classification, summarization, and translation.                       |
| [Gemini 2.5 Pro](https://docs.cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/2-5-pro)               | Deep reasoning, advanced coding, and research. Most capable 2.5 model, most expensive.                    |
| [Gemini 2.5 Flash](https://docs.cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/2-5-flash)           | Assistants and general workflows balancing speed and intelligence.                                        |
| [Gemini 2.5 Flash Lite](https://docs.cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/2-5-flash-lite) | Simple, high-throughput tasks at the lowest cost.                                                         |
| [GPT-5.6 Sol](https://platform.openai.com/docs/models/gpt-5.6-sol)                                               | Flagship GPT-5.6 preview. Strongest for the hardest reasoning, coding, and agentic tasks.                 |
| [GPT-5.6 Terra](https://platform.openai.com/docs/models/gpt-5.6-terra)                                           | Balanced GPT-5.6 preview for everyday work at lower cost.                                                 |
| [GPT-5.6 Luna](https://platform.openai.com/docs/models/gpt-5.6-luna)                                             | Fast, low-cost GPT-5.6 preview for simple or high-volume tasks.                                           |
| [GPT-5.5 Pro](https://platform.openai.com/docs/models/gpt-5.5-pro)                                               | Frontier reasoning, in-depth research, and complex engineering. Slowest and most expensive.               |
| [GPT-5.5](https://platform.openai.com/docs/models/gpt-5.5)                                                       | Complex reasoning, advanced coding, and long-context knowledge work.                                      |
| [GPT-5.4 Pro](https://platform.openai.com/docs/models/gpt-5.4-pro)                                               | Advanced coding, deep research, and long-context multi-step reasoning. Premium-priced.                    |
| [GPT-5.4](https://platform.openai.com/docs/models/gpt-5.4)                                                       | Complex reasoning, coding, and long-context knowledge tasks.                                              |
| [GPT-5.4 Mini](https://platform.openai.com/docs/models/gpt-5.4-mini)                                             | Assistants and mid-complexity reasoning at lower cost.                                                    |
| [GPT-5.4 Nano](https://platform.openai.com/docs/models/gpt-5.4-nano)                                             | Summaries, classification, and high-volume simple tasks. Cheapest and fastest 5.4.                        |
| [GPT-5.2](https://openai.com/index/introducing-gpt-5-2/)                                                         | Complex reasoning and deep coding or analytical workflows.                                                |
| [GPT-5](https://openai.com/index/introducing-gpt-5/)                                                             | Accuracy-critical tasks and high-quality reasoning.                                                       |
| [GPT-5 Mini](https://platform.openai.com/docs/models/gpt-5-mini)                                                 | Assistants and business workflows balancing speed and cost.                                               |
| [GPT-5 Nano](https://platform.openai.com/docs/models/gpt-5-nano)                                                 | Quick, simple responses and high-volume tasks. Cheapest and fastest GPT-5.                                |

#### Faster responses with priority processing

If low latency matters, you can ask Lovable to use **priority processing** for a chat feature. Priority processing sends the request to OpenAI's faster serving tier, so responses can come back more quickly during busy periods.

Ask Lovable to:

* Make an AI feature respond faster or with lower latency.
* Use priority processing for a chat feature.

Priority processing is available for supported OpenAI chat models only, not for Gemini models. It comes at a premium price: you are charged the priority rate only when OpenAI actually serves the request at the priority tier. If OpenAI falls back to standard processing, you pay the standard rate. See [Usage and pricing](#usage-and-pricing) for how AI usage is billed.

### Image models

Image models generate and edit images from text prompts, uploaded images, or both. Use them for visual assets, product mockups, marketing imagery, and in-app image editing.

Ask Lovable to:

* Generate images from a text description.
* Edit or restyle an uploaded image.
* Create product mockups or marketing visuals.
* Produce thumbnails or illustrations on demand.

| Model                                                                                                                            | Best for                                                                                                                     |
| -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [GPT Image 2 (default)](https://platform.openai.com/docs/models/gpt-image-2)                                                     | High-quality image generation and editing; product mockups, marketing imagery, and creative content.                         |
| [GPT Image 1 Mini](https://platform.openai.com/docs/models/gpt-image-1-mini)                                                     | Cost-efficient image generation; thumbnails, drafts, and high-volume workflows.                                              |
| [Gemini 3.1 Flash Image](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/3-1-flash-image)           | Fast image generation and editing with strong subject consistency and text rendering. Also known as Nano Banana 2.           |
| [Gemini 3.1 Flash Lite Image](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/3-1-flash-lite-image) | Faster, lower-cost image generation and editing for high-volume, cost-sensitive workflows. Also known as Nano Banana 2 Lite. |
| [Gemini 3 Pro Image](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/3-pro-image)                   | Detailed visuals, text rendering in images, and multi-image composition. Also known as Nano Banana Pro.                      |
| [Gemini 2.5 Flash Image](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/2-5-flash-image)           | Very low-cost image generation and quick visual outputs.                                                                     |

### Embedding models

Embedding models turn content into a format that can be searched by meaning instead of exact keywords. Use them for semantic search, retrieval-augmented generation (RAG), FAQ bots, document search, and knowledge bases.

Ask Lovable to:

* Build semantic search over uploaded documents.
* Create a FAQ bot that answers from your help content.
* Build a company knowledge base that finds relevant internal docs.

| Model                                                                                               | Best for                                                                  |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| [Gemini Embedding 001 (default)](https://ai.google.dev/gemini-api/docs/models/gemini-embedding-001) | General-purpose semantic search, document retrieval, and recommendations. |
| [Gemini Embedding 2](https://ai.google.dev/gemini-api/docs/models/gemini-embedding-2)               | Multimodal retrieval across text, images, video, audio, and PDFs.         |
| [Text Embedding 3 Small](https://developers.openai.com/api/docs/models/text-embedding-3-small)      | Cost-sensitive or high-volume text embedding workloads.                   |
| [Text Embedding 3 Large](https://developers.openai.com/api/docs/models/text-embedding-3-large)      | Higher-quality text retrieval when accuracy matters more than cost.       |

### Text-to-speech models

Text-to-speech models turn text into natural-sounding spoken audio, so your app can read content aloud, narrate generated text, or talk back. Describe the voice feature you want, and Lovable wires up the backend and picks the right settings. Speech streams as it is generated by default, so playback can begin before the full clip is ready, and you can describe the tone or pacing you want in plain language (for example, "speak slowly and warmly").

Ask Lovable to:

* Add a "read aloud" button that speaks an article or summary.
* Narrate AI-generated stories, lessons, or briefings.
* Turn a book or document into an audiobook.
* Build a voice assistant that responds with spoken audio.

| Model                                                                                        | Best for                                                               |
| -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [GPT-4o Mini TTS (default)](https://platform.openai.com/docs/models/gpt-4o-mini-tts)         | Natural-sounding speech for narration, read-aloud, and voice features. |
| [Gemini 2.5 Flash TTS](https://ai.google.dev/gemini-api/docs/speech-generation)              | Cost-effective speech for everyday and high-volume voice features.     |
| [Gemini 2.5 Pro TTS](https://ai.google.dev/gemini-api/docs/speech-generation)                | Higher-fidelity speech when voice quality matters most.                |
| [Gemini 2.5 Flash Lite Preview TTS](https://ai.google.dev/gemini-api/docs/speech-generation) | Lightweight preview model for simple speech tasks.                     |
| [Gemini 3.1 Flash TTS Preview](https://ai.google.dev/gemini-api/docs/speech-generation)      | Newest Gemini speech model, in preview.                                |

### Speech-to-text models

Speech-to-text models turn spoken audio into text, so people can talk to your app instead of typing and your app can work with what they said. Upload a voice note, call recording, or meeting audio, and the app transcribes it. Transcription streams as it is produced by default; because these features run in real time, very long recordings may time out, so transcribe long audio in segments.

Ask Lovable to:

* Build a meeting assistant that turns a recording into notes and action items.
* Add voice input or dictation so users can speak instead of type.
* Transcribe and search voice memos.
* Caption or subtitle uploaded audio.

| Model                                                                                              | Best for                                                                    |
| -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [GPT-4o Mini Transcribe (default)](https://platform.openai.com/docs/models/gpt-4o-mini-transcribe) | Fast, cost-effective transcription for most voice input and audio features. |
| [GPT-4o Transcribe](https://platform.openai.com/docs/models/gpt-4o-transcribe)                     | Higher-accuracy transcription when quality matters more than cost.          |

Combine text-to-speech and speech-to-text to build apps people can have a real back-and-forth with, such as voice assistants, two-way translators, and hands-free helpers.

## Monitor AI usage and activity

Every project has an AI activity dashboard under **Cloud → AI** that shows what your app's AI features cost and how they are performing. Use it to track spend, spot failed requests, and inspect individual AI calls. Lovable reads this activity too, so the agent can help you debug failures and improve your app's AI features.

<Note>
  The **Cloud → AI** dashboard is a per-project view for monitoring and debugging AI features. It shows individual requests with their status, duration, models, token usage, cost, and, when request content is available, the redacted request and response.

  To review AI gateway spend across your workspace, go to **Settings → Plans & credit usage → Usage details** and select **Run credits**. There, you can see AI gateway usage as billed credits and filter usage by project.
</Note>

Choose a time range to summarize recent AI activity. Three cards show:

* **Total cost**: the credits your app's AI requests used in the selected range.
* **Success rate**: the percentage of requests that completed successfully.
* **Avg. Duration**: the average time a request took, in milliseconds.

How far back you can view activity depends on your plan: Free workspaces can view the last 24 hours, and paid plans can view the last 90 days.

### Recent requests

The activity list shows recent AI requests, newest first. Each entry shows its status, a title taken from the request, when it ran, the model used, the input and output tokens, the credits it cost, and how long it took. When an AI action takes several steps, they appear together as a single run so you can see the cost of each step.

Lovable always records this summary information for every AI request, so both the dashboard and the agent can see each call's status, model, tokens, cost, and duration, even when the request content is not available.

### Let Lovable debug and improve your AI features

Give Lovable visibility into your app's AI calls so it can help you make them better. When this is on, Lovable keeps the full request and response for each AI call, so the agent (and you) can open a request to see exactly what was sent and returned. The agent can use this to debug failures, refine your prompts and knowledge, and reduce cost and latency. Secrets are removed automatically, and details are kept for 90 days.

It is on by default on Free and Pro. On Business and Enterprise it is off by default; enable it from the prompt on **Cloud tab → AI**, or from the **AI app context** setting in [project settings](/features/projects/settings). Changing it requires permission to edit the project.

When it is off, the dashboard and the agent still see summary metrics (status, model, tokens, cost, and duration); they just cannot open a request to see its full content.

## Usage and pricing

<Note>
  **Temporary offering, subject to change:** Free, Pro, and Business workspaces receive a **4-credit monthly AI grant** for AI gateway usage in deployed apps. On Free plans, the grant resets on the 1st of each calendar month at **00:00 UTC**. On Pro and Business plans, it refreshes with the subscription billing cycle. The grant does not roll over.
</Note>

AI gateway usage is measured when AI features inside your deployed app make model calls. These requests are separate from the Lovable agent that helps you plan, build, and edit your project.

AI gateway usage uses credits. Credit usage depends on the model used and the amount of work performed, such as text tokens, generated images, audio processing, call volume, or other provider-reported usage.

AI gateway usage rates are based on the underlying provider model costs. To estimate relative model costs, refer to the official provider pricing sources linked from the [supported model list](#supported-models-for-ai-features-in-your-app).

On Free, Pro, and Business plans, AI gateway usage draws from the monthly AI grant first. After that, it draws from general credits where available.

To review AI gateway usage, go to **Settings → Plans & credit usage → Usage details** and select **Run credits**. For more information about AI gateway costs, monthly AI grants, top-ups, auto top-up, alerts, and usage tracking, see [Credits and usage](/introduction/credits-and-usage).

### Cancelled requests

If your app cancels an in-flight AI request, some usage may still be counted. The built-in AI connector waits briefly for the provider to finish and report final usage before closing the connection.

Provider behavior on cancelled requests varies, so some usage may still be billed even if the app closes the connection before the response finishes.

## Workspace rate limits

To ensure reliable performance and fair access for all users, the built-in AI connector applies rate limits per workspace. These limits help maintain system stability, prevent abuse, control costs, and provide a consistent experience for everyone. Rate limits are measured in **requests (model calls) per minute**, not tokens per minute.

If your app’s requests exceed the allowed rate, the server returns a `429 Too Many Requests` status code and the request will not be processed.

If your workspace runs out of credits, the server returns a `402 Payment Required` status code. You can restore access by adding credits or enabling auto top-up in **Settings → Plans & credit usage**.

For more information, see [Credits and usage](/introduction/credits-and-usage).

Rate limits are more restrictive for free users, while paid plans include higher thresholds and greater flexibility.

* **Free plan users**: upgrade anytime to increase your limits.
* **Paid plan users**: contact [Lovable Support](https://lovable.dev/support) if you need additional capacity.

## FAQ

<AccordionGroup>
  <Accordion title="Is the built-in AI connector the same thing as the Lovable agent?">
    No. The built-in AI connector adds AI features to the apps you build with Lovable. The Lovable agent is what helps you build and edit your project.

    The models listed on this page are available for AI features inside your app. They are not the models Lovable uses to write, edit, or reason about your code.
  </Accordion>

  <Accordion title="Do I need my own OpenAI, Google, or other provider API key?">
    No. Lovable automatically generates and manages the API key for each project. You do not need to create a provider account, configure billing with a model provider, or paste API keys into your app.
  </Accordion>

  <Accordion title="Where do AI calls run?">
    AI calls run through a secure backend edge function that Lovable creates for you. Calls are not made directly from the browser, which helps keep credentials and prompts server-side.
  </Accordion>

  <Accordion title="Can I choose which model my app uses?">
    Yes. Each model type has its own default, and you can ask Lovable to use a different supported model or combination of models for a specific AI feature. See [Supported models for AI features in your app](#supported-models-for-ai-features-in-your-app).
  </Accordion>

  <Accordion title="Can my app work with voice and audio?">
    Yes. The built-in AI connector includes both text-to-speech (so your app can read content aloud or respond with voice) and speech-to-text (so your app can transcribe voice notes, recordings, and meetings, or take voice input). Ask Lovable to add a feature like a "read aloud" button, a voice assistant, or a meeting transcriber, and it sets up the backend for you. See [Text-to-speech](#text-to-speech-models) and [Speech-to-text](#speech-to-text-models).

    For higher-fidelity or character voices as a core part of your product, you can also connect [ElevenLabs](/integrations/eleven-labs).
  </Accordion>

  <Accordion title="Can my app use Anthropic (Claude) models?">
    No. The built-in AI connector currently offers models from Google and OpenAI, listed under [Supported models](#supported-models-for-ai-features-in-your-app). Anthropic models are not available through it. If your app needs a specific provider that isn't offered, call that provider directly from a backend edge function using your own API key stored as a [secret](/features/secrets).
  </Accordion>

  <Accordion title="Can I use my own API key so AI usage doesn't consume my credits?">
    Not with the built-in AI connector, which always runs through Lovable and bills your workspace credits. If you want usage billed to your own provider account instead, ask Lovable to call the provider's API directly from a backend edge function, with your key stored as a [secret](/features/secrets). That usage is billed by the provider, and your app only consumes regular Cloud usage for running the function.
  </Accordion>

  <Accordion title="What happens if my workspace runs out of credits?">
    If your workspace runs out of credits, AI requests return a `402 Payment Required` status code. You can restore access by adding credits or enabling auto top-up in **Settings → Plans & credit usage**.

    For more information, see [Credits and usage](/introduction/credits-and-usage).
  </Accordion>
</AccordionGroup>
