# ✅ Step-by-Step: Integrate AI (e.g., ChatGPT) into Bubble

**URL:** <https://forum.nocodework.com/t/step-by-step-integrate-ai-e-g-chatgpt-into-bubble/103>\
**Category:** Bubble\
**Created:** [May 28, 2025, 12:52pm UTC](https://forum.nocodework.com/t/step-by-step-integrate-ai-e-g-chatgpt-into-bubble/103 "2025-05-28T12:52:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gautam](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.nocodework.com/gautam/32/12_2.png) [@Gautam](https://forum.nocodework.com/u/Gautam)\
**Post date:** [May 28, 2025, 12:52pm UTC](https://forum.nocodework.com/t/step-by-step-integrate-ai-e-g-chatgpt-into-bubble/103/1 "2025-05-28T12:52:37Z")

</div>

To integrate ChatGPT or any AI feature into your Bubble app, start by getting your API key from OpenAI. After signing in to your OpenAI account, generate a secret API key which you’ll use to connect Bubble with the AI service.

Next, follow these steps in your Bubble app:

1. **Install the API Connector Plugin**  
Go to the Plugins section in Bubble, add a new plugin, and install the API Connector.
2. **Configure the API Call**  
Open the API Connector, add a new API called “OpenAI”, and create a new API call named “ChatGPT” with the following settings:

- Method: POST
- Use as: Action
- API URL: `https://api.openai.com/v1/chat/completions`
- Headers:
  - Content-Type: `application/json`
  - Authorization: `Bearer YOUR_API_KEY`

- Request Body (raw JSON):

1. **Build the UI in Bubble**  
On your page, add a multiline input to collect the user’s message, a button to trigger the API call, and a text element to display the AI’s response.
2. **Create a Workflow**  
Go to the Workflow tab. Set an event for when the button is clicked. Add an action that calls the ChatGPT API, passing the input’s value as the user’s message. Use the API’s response to display the generated text in the text element or store it in a custom state.

**“I’ve integrated GPT into my Bubble app to enable smart AI features like chatbots, content generation, and resume writing tools. By connecting to OpenAI’s API, the app can understand and generate human-like responses. Hope you find it useful!”**

**Thankyou**
