# How can I connect OpenAi's Api to Thunkable

**URL:** https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424
**Category:** Web API's
**Created:** [January 25, 2023, 10:46am UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424 "2023-01-25T10:46:03Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [January 25, 2023, 10:46am UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/1 "2023-01-25T10:46:03Z")

</div>

This way I can make a front end for an app idea I have I just need to connect to OpenAi first.

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 25, 2023, 3:10pm UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/2 "2023-01-25T15:10:36Z")

</div>

OpenAI’s GPT-3 is basically already connected. If you go into Blocks \> Advanced (right at the bottom)  
there’s an OpenAI block there. You need to sign up for an OpenAI account and get your API key from the settings page on there. Take that API key and add it into your thunkable using an API key block:

 ![Thunk4](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/0/9006123eeb15b8e671a3fbc9cd450c69e7c6fff3.jpeg)

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [January 25, 2023, 10:11pm UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/3 "2023-01-25T22:11:19Z")

</div>

Cool, thanks I will try that.

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [January 25, 2023, 10:17pm UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/4 "2023-01-25T22:17:09Z")

</div>

Will I need a pro account for that?

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 25, 2023, 10:52pm UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/5 "2023-01-25T22:52:50Z")

</div>

Nope 🙂

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [January 25, 2023, 11:12pm UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/6 "2023-01-25T23:12:01Z")

</div>

Ok here is what I have so far,

 ![Screen Shot 2023-01-26 at 9.10.11 am](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/8/6848e7859eafda13149428b7f9373b544ed44776.png)

Now what I would like to do is make it so that when I type something into the text box make it as if I am typing it into Open AI, I have already connected, my OpenAI API to Thunkable, now I just need to set it up in the blocks,

Many Thanks Levi

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 25, 2023, 11:13pm UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/7 "2023-01-25T23:13:18Z")

</div>

What does your blocks screen look like now?

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [January 25, 2023, 11:46pm UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/8 "2023-01-25T23:46:33Z")

</div>

I think I got it to work but I would like the answer to be on screen 2 and have a button that goes to that which says the answer.

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 25, 2023, 11:48pm UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/9 "2023-01-25T23:48:37Z")

</div>

send your answer to an app variable and then make screen 2’s label text = the app variable?

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [January 25, 2023, 11:49pm UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/10 "2023-01-25T23:49:04Z")

</div>

Ok thanks I will try that.

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [January 26, 2023, 12:11am UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/11 "2023-01-26T00:11:28Z")

</div>

![Screen Shot 2023-01-26 at 10.11.07 am](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/7/e74db595471fee5b943cf6c53d07e93e469fcc7f.png)

What should I set the app variable to?

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [January 26, 2023, 12:33am UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/12 "2023-01-26T00:33:50Z")

</div>

@nathanburley21656 How should I get it to display the answer on the second screen and then after it displays it, automatically delete it so then the user can input another question?

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [January 27, 2023, 10:41pm UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/14 "2023-01-27T22:41:46Z")

</div>

I really need help with this,

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 27, 2023, 10:48pm UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/15 "2023-01-27T22:48:25Z")

</div>

I would recommend watching the video [here](https://docs.thunkable.com/variables) about app variables to understand how variables work.

The basic idea is that you need to store a value (in this case, the green `response` block) in a variable and then use that variable on another screen to display the value.

If you get stuck, post a screenshot of your blocks or a link to your project and someone can help you.

---

<div class="post-metadata">

### Author: ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)
#### Post date: [January 28, 2023, 2:14am UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/16 "2023-01-28T02:14:58Z")

</div>

you can also start reading this post by @matt_conroy,describing how to connect to openai:

> [@OpenAI ChatGPT Now Available in Thunkable with Our New Integration](https://community.thunkable.com/t/openai-chatgpt-now-available-in-thunkable-with-our-new-integration/2209360):
>
> Hey Thunkers! We’ve just introduced a new integration with OpenAI’s ChatGPT model. It’s very easy to use and add into your own apps! Take a look at our latest blog post below and let us know what you think! We’d love it if you could share some of the apps you create using ChatGPT. I’ve created a demo app [here](https://x.thunkable.com/projectPage/63b47ece8af02c021ac5e2c4) that you are welcome to remix and play around with. We also have a new set of [docs](https://docs.thunkable.com/openai-chatgpt-integration) on how to use Chat GPT.

read the thread from top to bottom, also read the link above for details.  
i posted a working model based on this discussion here:

> [@OpenAI ChatGPT Now Available in Thunkable with Our New Integration](https://community.thunkable.com/t/openai-chatgpt-now-available-in-thunkable-with-our-new-integration/2209360/14):
>
> it’s nice to know that we can connect to openAI via a thunkable block designed for that purpose. first i asked “Tell me, in a poem, why python rocks” and it came back with this: it seemed to have problems in handling newlines (\n) though, so i split the returned response by hand: Python’s great for all your coding needs It’s easy to learn and a great tool to please It’s open source, and it’s ever so flexible And it’s got a huge library to explore and collect Python’s great for …

---

<div class="post-metadata">

### Author: ![nathanburley21656](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nathanburley21656/32/150307_2.png) [@nathanburley21656](https://community.thunkable.com/u/nathanburley21656)
#### Post date: [January 30, 2023, 11:04am UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/17 "2023-01-30T11:04:24Z")

</div>

How’re you getting on now?

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [January 30, 2023, 8:49pm UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/18 "2023-01-30T20:49:17Z")

</div>

I am still working it out, I will show you what i have go so for soon.

---

<div class="post-metadata">

### Author: ![wearesleecidxp8](https://avatars.discourse-cdn.com/v4/letter/w/f17d59/32.png) [@wearesleecidxp8](https://community.thunkable.com/u/wearesleecidxp8)
#### Post date: [April 6, 2023, 4:38pm UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/19 "2023-04-06T16:38:10Z")

</div>

what to put on request setting, the property and value to integrate chat gpt?

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [April 6, 2023, 6:29pm UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/20 "2023-04-06T18:29:50Z")

</div>

Can you say more about this? Are you using certain blocks (post a screenshot)? What are you trying to do? Are you using the built-in AI block (as in [this post](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/2)) or trying to call the API?

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 1:37pm UTC](https://community.thunkable.com/t/how-can-i-connect-openais-api-to-thunkable/2240424/21 "2024-11-08T13:37:08Z")

</div>


