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

Bubble pirate translator with OpenAI

In this Bubble.io tutorial we demonstrate how to use the OpenAI API with Bubble for no-code AI text generation using the slightly silly example of a English to Pirate text translator. We show up to succesfully make an API request to OpenAI using the Bubble API Connector and show the returned text on a page using Custom States.

Join now $19/monthLearn more
Get 500+ tutorials, a No-Code AI Assistant, 4 premium courses, and everything you need to build faster!
Bubble pirate translator with OpenAI
Explore these topics...
Plugins
API Connector
Database
Custom States
Workflow
Set state
OpenAI

With just this tutorial learn...

Unleash your inner pirate: Transform text into swashbuckling pirate speak with OpenAI and Bubble!

No coding required: Create a single-page app that turns boring text into hilarious pirate lingo!

Master the art of API integration: Learn how to connect OpenAI's powerful language model to your Bubble app effortlessly.

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.

Setting Up the OpenAI API Connection

In this Bubble tutorial video, I'm going to demonstrate how to use OpenAI and the OpenAI API and link that in with your Bubble app in order to create a pirate translator. We're going to use this demonstration to create a single page app in Bubble that takes text and converts that text into quote-unquote pirate speak like you get from the very cheesy movies. So I've created a simple page here with a multi-line text input and a button. The first thing I need to do is set up the API connection to OpenAI.

Configuring the API Connector

So I go over into my plugins and I go to the API connector or I install it from our plugins if I haven't already got it and then I add a new API. This is basically for each different service I want to integrate in with. So this one will be OpenAI and then I go over to the OpenAI documentation and this is where I begin to interpret what they've written here as part of the API request and I have to interpret it into a format that fits in with the Bubble API connector UI.

Setting Up API Headers and Authorization

I can see that I need some header content of type, content type. So I can have the shared header of content type and that's application/json and there I can see I also need to put an authorization and I can do that either by adding another shared header here or I can add it as a private key here. So that is authorization and it needs to begin with bearer followed by my API key. I found my API key in my OpenAI account so I generate a new key and I will be deleting this as soon as I've recorded the video.

Configuring the API Request

Then let's go back to the documentation. This is my data section so I can copy what they've got here between the quotes and let's call this generate text. And then it's a post and my JSON body goes in here. I'm just going to put in some line breaks so that it's a little bit clearer. What's going on here? And I need a URL to send the request to. So here we go. And so the text model, yeah, I used DaVinci prompt. These are all parameters apart from the prompt. Well, in fact, even the prompt you can play around with in the OpenAI playground to make sure you get the right settings.

Testing the API Connection

But we just want to test this. So I'm going to call this prompt because that allows me to put dynamic data into this workflow and in fact, I'll change this to action so that it shows up in my workflow menu. And then I'm going to test it. So I'm going to flesh this out a bit in a moment, but I'm going to go with something like write the following in pirate speak. And a little bit fun. I'm going to take the first sentence of the Star Wars title crew from a new hope, paste it in and let's see what happens.

Adjusting API Parameters

Okay, so I've not received an error and I've got a response. Yeah, that's the text I've got back, 'Tis a time'. So I'm going to hit save because I've got a response back. It's not a great response, but the API integration is working. So actually what I'm going to do is I'm going to check in because I was testing this before recording the video, go into the playground, just check that I've got similar settings here because this is the sort of result that I was expecting. And maybe my character length, maximum length is probably way too short. We've got max tokens there. Is that the parameter? Let's go back into here. Let's just increase the tokens and try that.

Finalizing the API Setup

Okay, there we go. I needed to increase the tokens in order to get a longer reply back. And bear in mind that the more tokens you use, the more it will increase your bill with OpenAI. So I can hit save there and that is working. Now, how do I build that into my form?

Creating the User Interface

So I need somewhere to display my results. I'm going to add in a text field and I'm going to use a custom state to save the response from the API. So I'm going to call this response. I'm putting it on the page just because that makes sense. Keep it neat and tidy. And then my text is going to be my page's response.

Setting Up the Workflow

Now let's set up our workflow. So first of all, I'm going to set this to input should not be empty. And then let's tap this into the API. Cool. We set up. OpenAI generate text. There's the dummy default data that I had. And OpenAI text generation is all about the prompt. So if I was just to say, copy in Star Wars New Hope, it is a period of civil war, et cetera. OpenAI doesn't know what to do with that. So I have to include a prompt.

Finalizing and Testing the App

So write this as pirate speak. That and then after here, I can put in the input of my multi line. And I'm just going to increase this up. Let's double it. So, so that I make sure I get the full response back. It's not limiting it by the number of tokens. And then let's preview this up. One final thing. I generate the API code here, but I'm not saving the result anywhere. So set state of my page response to. Ah, which one, which one is it? If I go back to my API, I am looking for choices and I'm looking for the first entry of choices text. Choices, first item text. And just FYI, the reason it's doing that is because you can put in parameters so that it generates more than one variation. But I'm just having to say first item because I'm telling it to only generate one.

Final Test and Conclusion

So let's go. And let's try a different bit in here. Let's copy that. Translate to pirate. Okay, so Bubble is sending the API request. And there we go. We get during the battle rebel scallywags demonstrate a secret plan. Excellent. So we can see that open their eyes. That's something very creative there. Obviously, this is a silly example, but I just wanted to demonstrate in another way, the power of what you can do with OpenAI and Bubble. Thanks for watching.

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