What you can do
Bring your own AI provider’s models into your app.Write and summarize
Draft replies, write descriptions, or summarize long text in your app.
Answer questions
Add an assistant that answers questions about your app’s content.
Sort and extract
Tag records, sort messages by topic, or pull key details out of text.
Create images
Generate images with your provider’s image models.
Getting your API key
You need an API key from your AI provider. You create it in your provider’s developer portal, and your provider bills you for your app’s AI usage. Most providers need a payment method or prepaid credits before the key works. To create a key, follow your provider’s own guide, such as the OpenAI quickstart or Anthropic’s get started guide. Copy the key when you create it, since some providers only show it once.Connecting your provider
You connect your provider by asking the AI chat to build a feature that uses it. The AI chat asks you for the key and saves it as a secret, then writes a backend function that calls your provider. The key never appears in your app’s code. To connect your AI provider:- Go to your app editor.
-
Ask the AI chat to build the feature with your provider and your own API key. For example:
-
When the AI chat shows Set secrets, paste your key into its field, such as
OPENAI_API_KEY, then click Submit Secrets.
Adding your key when the AI chat asks for it
Don’t have your key yet? Click Skip, and the AI chat builds the rest without it and tells you what won’t work until you add it. When you have your key, add it on your app’s Secrets page with the name the AI chat asked for, such asOPENAI_API_KEY, then ask the AI chat to test the feature before you publish your app. - When the AI chat finishes building the feature, try it in your app’s preview. Then publish your app so your live app gets it too.
FAQs
Which AI providers can I use?
Which AI providers can I use?
Any AI provider with an API, such as OpenAI or Anthropic. Name the provider in your request. If the AI chat needs more details, such as a link to the provider’s API documentation, it asks you for them.
Where do I add or change my key?
Where do I add or change my key?
Enter your key in the AI chat’s Set secrets card when it asks for it.If the AI chat didn’t ask for your key, or you want to change it later, add it on your app’s Secrets page under the name the AI chat used, such as
OPENAI_API_KEY. If the feature isn’t finished yet, tell the AI chat your key is saved so it can finish building it. See Managing app secrets.If your app is already published, publish it again so your live app uses the key.Does using my own key use my Base44 credits?
Does using my own key use my Base44 credits?
A little. Your provider bills you for the AI requests themselves. Each time your app calls your provider, it runs a backend function, and 100 runs use about 1 integration credit.
What happens if I run out of credits with my provider?
What happens if I run out of credits with my provider?
Your AI feature stops working until you add more credits or update your billing settings with the provider.
Can I change my AI provider later?
Can I change my AI provider later?
Yes. Ask the AI chat to switch to the new provider. It asks you for the new key, and you may need to update your prompts so they work with the new provider’s models.
How can I limit costs?
How can I limit costs?
Set a monthly budget or usage limit in your provider’s billing settings, and check your usage in your provider’s dashboard. Each provider’s cost controls work a little differently, so check their help docs.For testing, try shorter prompts or smaller requests.
Why is my AI giving unexpected answers?
Why is my AI giving unexpected answers?
Make your prompt more specific. Include clear instructions, important context, and examples of what you want, and say what not to include. You can also try a different model if your provider offers one that’s more focused on accuracy.If the problem continues, paste your prompt and the response into the AI chat and ask it to help you troubleshoot step by step.
Can I use more than one AI provider at the same time?
Can I use more than one AI provider at the same time?
Yes. Add a key for each provider, and tell the AI chat which provider to use for each feature.