Learn Bubble with 500+ tutorials, courses & AI Assistant ✨

Limited time launch offer get $80 off today

0 days 0 hours 0 minutes 0 seconds
SAVE $80 NOW
Planet No Code logo
Bubble.io CoachingFounder MentoringSponsorships
LoginLearn Bubble.io

How to add AI text generation to a Bubble app - OpenAI

In this Bubble tutorial we demonstrate how to generate AI text from a prompt and display the generated text in your Bubble app. This video will show you how to use the OpenAI API without the need for a plugin using the Bubble API connector.

Join now $19/monthLearn more
Get 500+ tutorials, a No-Code AI Assistant, 4 premium courses, and everything you need to build faster!
How to add AI text generation to a Bubble app - OpenAI
Explore these topics...
Plugins
API Connector
Workflow
Set state
OpenAI

With just this tutorial learn...

Connect OpenAI to Bubble in 10 mins: Learn how to integrate OpenAI's powerful API with your Bubble app for AI-powered features.

Unlock AI potential in no-code: Discover how to leverage AI capabilities in your no-code projects using Bubble and OpenAI integration.

Create an essay outline generator: Build a tool that automatically generates essay outlines using OpenAI's API and Bubble's no-code platform.

With membership you'll...

Learn how to build a ChatGPT Clone, Custom CRM for your business & SaaS Marketing website with Webflow & AI.

Unlock 500+ Bubble tutorial videos with AI powered Q&A.

Debug your Bubble app instantly with our custom trained No Code AI Assistant.

Join now $19/month
Risk-free! 14-day money-back guarantee. Cancel anytime.

Connecting OpenAI and Bubble

This video is about OpenAI and Bubble and I'm going to show you how to connect to the OpenAI API with your Bubble app and this should take no more than 10 minutes. So it's very quick. First of all we head into plugins and if you haven't already you need to install the API connector. We're going to be making this connection ourselves rather than relying on a pre-built plugin in the Bubble plugin directory because it gives us more control and flexibility.

Setting Up the API Connection

So I've created a new API here and rename it OpenAI and if I go back to this examples page this really tells you everything you need to get started and there is loads of documentation to go through to understand exactly how the models work, how to make the most of their API but we can get going with just what's provided on this page and I'm going to use the essay outline because I think that would serve as a very good demonstration. So in the API request in order to connect it through with Bubble change it from it's probably Python by default to curl or C URL and these are the details that we have to put into the right places in the Bubble API connector.

Configuring the API Endpoint

So first of all let's go for copying the URL the endpoint so we will call this essay generator, it's rather essay outline generator. We want it as an action in order to be able to use it in our workflow. Does it say whether it is post or get? I think I would guess that it is post so let's go post and then we've got some headers to fill out so we have to declare the content type you can just copy and paste this between them. The headers are in fact if we say we're doing an essay outline generator now but we might want to use a different feature of OpenAI, by using the shared header we only need to enter this part once.

Adding Authorization and Data Fields

Okay and then we also need authorization. Okay I'm going to fill out the API key in a moment let's do the rest of it first. So this is data this is everything that goes into the data field and then we need to make some of this dynamic in order to input different different text or different variables into our workflow so we can call this prompt and then I'm going to leave the rest because that's provided with the example that they give using the Tesla and you can read about the difference that any of these make in the documentation. So oh and we untick private in order to be able to access this value in a workflow.

Testing the API Connection

Right I'm just going to get my API key which I'm giving private there and then I think we can run a test so if we go back to the example we can see the sort of prompts that works really well so I'm going to copy all of that in prompt and then say create an outline for an essay about I'll say the invention of the internet and that's cool okay so I'm getting an error about the API key and that is because I have overlooked something which is quite common with authorization you have to put the term bearer and the space before your API key so let me do that okay and now let's try that again that's more promising it's thinking about it it's waiting for a response okay brilliant so let's have a look at what we've got back here.

Understanding the API Response

Okay so here we go in choices it's given us one back no hasn't it's separating them by so this basically is a new line here we go so it's basically saying point one there we go followed by a new line the internet is a global network computers that allows to exchange information and then line space is point two okay so how do we put this into a Bubble application because we have the API integration working really nicely now.

Implementing the API in Bubble

So if we go on to design I've created just rough what we need and I finally I need to add a place to display the response so I'm going to create a custom state here called generated text and because my workflow is a my API connector is set not as data but as an action I can retrieve it from my workflow builder here I'm going to connect this to my multi-line input and then I will have to create a way to display the text that's returned so I have my text response text which has a custom state and then this is the choices I think I need to let's go for each items text it's because choices returned as a list as like there are multiple options available like when you make a call to a service like OpenAI you can set how many different kind of goes or attempts you want to return back and but just so I get everything I'm gonna get it to list out each items text.

Displaying the Generated Text

Oh no wouldn't accept that okay let's have a check if I go back to plugins and then manual response I just need to see what's returned so it is text each items choices text I'm just gonna reinitiate the call yeah returns as text text field yeah so this is the field that I'm trying to get to okay I will knows that it's text so each items text it's good choices first item text okay that accepts it maybe I need to display in a repeating group in order for the list anyway I'm gonna get the first result and that's the result that I want and then lastly I need to tell this text field to basically display the custom state in it preview.

Testing the Implemented Feature

Okay so I'm gonna write an essay outline about the history of okay let's go reinit fire of the Firefox web browser leave a comment if you're using Firefox see I'm using break write an essay outline about history of the Firefox web browser okay so I click that and there will be this waiting period because it's waiting for a request to return back from OpenAI but there we go not sure if that's good or bad I mean yeah Firefox had a rise and then had a fall is it having a resurgence I mean how specific is that to Firefox but you get the idea we now have a working API connection between Bubble and OpenAI their API and you can now basically customize by going back into plugins kind of these parameters here the the model that's used the temperature tokens etc you can customize it you can really now dive into any of the examples here and build that into your Bubble application.

Table of contents

Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Your No-Code Journey Starts Here

The best way to learn Bubble.io?

Build No Code Confidently

No more delays. With 30+ hours of expert content, you’ll have the insights needed to build effectively.

Find every solution in one place

No more searching across platforms for tutorials. Our bundle has everything you need, with 500+ videos covering every feature and technique.

Dive deep into every detail

Get beyond the basics with comprehensive, in-depth courses & no code tutorials that empower you to create a feature-rich, professional app.

Monthly
Yearly
Member
Accelerate your Bubble app to launch
$99 / month
$19/month/mo
Includes:
500+ tutorials
4 premium courses
Find the right tutorial with our custom trained AI
New tutorials added each week
Cancel anytime
14 day money back
Join now
Member
Accelerate your Bubble app to launch
$990 / year
$149/year/mo
Includes:
500+ tutorials
4 premium courses
Find the right tutorial with our custom trained AI
New tutorials added each week
Cancel anytime
14 day money back
Join now

Frequently Asked Questions

Find answers to common questions about our courses, tutorials & content.

Do I need any coding experience?

No. Our Beginner Essentials course and AI No-Code Coach are designed for total newcomers. You’ll learn Bubble.io step by step - no coding required.

How does the AI No-Code Coach work?

Simply type your question in plain English, and our AI taps into the entire video library to recommend the exact lessons you need. It’s like having a personal instructor on demand.

How long can I access the content?

As long as you’re subscribed! With our monthly subscription, you get unlimited access to all 500+ videos, our growing course library, and the AI No-Code Coach.

What courses are included

Your subscription includes:

  • Bubble Beginner Essentials – Get up and running fast.
  • Build a ChatGPT Clone – Integrate AI into your no-code apps.
  • Build Your SaaS Website with AI – Learn to create a scalable startup site.
  • Develop a Custom CRM App in Bubble - Learn database relationships with a CRM.

Plus, new tutorials every week!

What if I get stuck on a lesson?

The AI No-Code Coach is your first stop for instant answers. If you need deeper help, you can book 1:1 Bubble coaching for expert guidance.

Do you offer a money-back guarantee?

Yes! If you don’t see real progress within 14 days, let us know, and we’ll issue a full refund—no questions asked.

Can I cancel anytime?

Absolutely. Your subscription is month-to-month, and you can cancel anytime—no lock-ins, no hidden fees.

What if I want more than just tutorials & courses?

Absolutely. Your subscription is month-to-month, and you can cancel anytime—no lock-ins, no hidden fees.

If you’re serious about building a successful SaaS startup, check out Mastery—our intensive mentorship program. Mastery goes beyond Bubble.io development and includes:

  1. 1:1 mentorship to fast-track your progress
  2. Marketing strategies tailored for no-code founders‍
  3. Product management insights to scale your startup‍
  4. Personalized support from experienced founders

‍

Still have questions?

Reach out to our dedicated team.

Contact
Services
Search Bubble TutorialsBubble.io CoursesBook Bubble.io CoachingApply for Mastery
Latest Bubble tutorials
Rerank Text By MEANING With Cohere In Bubble.io Step by Step!
Unlock RAG Providers for NO CODE AI App Development TODAY!
Better Tables with Built-in Search and Sort By in Bubble.io
Partnerships
Flusk.eu
VectorShift
Comnoco
Plumb
Toddle
Whereby
Get started with no code
AI Powered No Code AppsNo Code Web ScrapingBubble.io Plugin tutorialsBubble API Connector tutorialsStudent & Teacher DiscountBest tools for no coders
Follow us
Youtube
X
LinkedIn
Planet No Code logo
In partnership with
Queen Mary University of London Logo
© 2024 Planet No Code. All rights reserved.
Privacy PolicyTerms of ServiceCookies SettingsContact Us