Docs
Building

Add AI features

Build a server-backed AI feature using your own provider account

Ask the agent for the AI feature you need and specify the behavior, data sources and limits. For the supported Supabase Edge Function workflow, connect the intended Supabase project and supply your AI provider key through its secret controls.

Keep the provider key on the server

Frontend code is delivered to visitors. The agent should put private provider calls in a server function and have the app call that function. Do not paste the key into a prompt or a frontend environment variable.

Build and verify

  1. Connect Supabase and select the project for this app.
  2. Describe the feature and any data it should use.
  3. In the Supabase connection dialog, use Edge Function secrets to set the secret name used by the function, such as OPENAI_API_KEY.
  4. Have the agent deploy through the available authorized workflow and report the outcome.
  5. Try a successful request and a failure case in the app, including what happens when limits are reached.
text
Add an assistant that answers questions about the documents in this
project and cites its sources. Keep the provider key on the server,
require sign-in, add a per-user limit and show useful request errors.

A saved secret does not prove a function was deployed or that the provider key is usable. Check each result. If a required secret or service is unavailable, the app should explain that state instead of pretending the feature worked.

Your provider bills you for the app's AI requests separately from your PlutoAI plan. Review limits and server-side access checks before publishing.

See databases, authentication and environment variables.