# My openai integration is not working!

**URL:** <https://community.thunkable.com/t/my-openai-integration-is-not-working/2230305>\
**Category:** Questions about Thunkable X\
**Created:** [January 19, 2023, 8:12am UTC](https://community.thunkable.com/t/my-openai-integration-is-not-working/2230305 "2023-01-19T08:12:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahanazparvinsmrityd](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@sahanazparvinsmrityd](https://community.thunkable.com/u/sahanazparvinsmrityd)\
**Post date:** [January 19, 2023, 8:12am UTC](https://community.thunkable.com/t/my-openai-integration-is-not-working/2230305/1 "2023-01-19T08:12:05Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/9/6917e0002cd672778849131f2e9bccf918f0d56c.png)  
this is the result  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/5/359382783d8c2bc9ab4d2c8f459c22303ad7d5a3.png)  
here is the code  
note: i have imported my api key in [api-key]

---

<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 19, 2023, 10:10am UTC](https://community.thunkable.com/t/my-openai-integration-is-not-working/2230305/2 "2023-01-19T10:10:27Z")

</div>

did you do the setup step described here?

> **[OpenAI ChatGPT Integration](https://docs.thunkable.com/openai-chatgpt-integration#create-an-openai-account-and-generate-a-secret-api-key)**

---

<div class="post-metadata">

**Author:** ![sahanazparvinsmrityd](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@sahanazparvinsmrityd](https://community.thunkable.com/u/sahanazparvinsmrityd)\
**Post date:** [January 19, 2023, 10:41am UTC](https://community.thunkable.com/t/my-openai-integration-is-not-working/2230305/3 "2023-01-19T10:41:42Z")

</div>

yess

---

<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 19, 2023, 11:08am UTC](https://community.thunkable.com/t/my-openai-integration-is-not-working/2230305/4 "2023-01-19T11:08:29Z")

</div>

during testing did you supply your api\_key in the screen\_opens block?  
i just ran my test for image generation and it’s working:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/8/98efb6354708b1e39488ac069a46c0348efc00ca.jpeg)

---

<div class="post-metadata">

**Author:** ![sahanazparvinsmrityd](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@sahanazparvinsmrityd](https://community.thunkable.com/u/sahanazparvinsmrityd)\
**Post date:** [January 19, 2023, 11:55am UTC](https://community.thunkable.com/t/my-openai-integration-is-not-working/2230305/5 "2023-01-19T11:55:00Z")

</div>

yes i did

---

<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 19, 2023, 1:55pm UTC](https://community.thunkable.com/t/my-openai-integration-is-not-working/2230305/6 "2023-01-19T13:55:00Z")

</div>

Has your openai trial account expired? You need an account that is enabled for payment ((ie There is a valid credit card attached to it)

---

<div class="post-metadata">

**Author:** ![wei](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/wei/32/26160_2.png) [@wei](https://community.thunkable.com/u/wei)\
**Post date:** [January 19, 2023, 7:01pm UTC](https://community.thunkable.com/t/my-openai-integration-is-not-working/2230305/7 "2023-01-19T19:01:09Z")

</div>

Do you use your API key? It looks like an API key issue to me.

Wei

---

<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, 9:35pm UTC](https://community.thunkable.com/t/my-openai-integration-is-not-working/2230305/8 "2023-01-25T21:35:13Z")

</div>

Did you get this sorted? I’m V new at this but to me, the block below is wrong. I _think_ you’re just saying that your API key is **[api-key]**. You need to assign your actual API key to an app variable and then connect the correct app variable to this spot.

 ![359382783d8c2bc9ab4d2c8f459c22303ad7d5a3](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/3/b364ed994729125cf0f3d17d643fd91ae76a1810.png)

---

<div class="post-metadata">

**Author:** ![varunkadapatti](https://avatars.discourse-cdn.com/v4/letter/v/eb8c5e/32.png) [@varunkadapatti](https://community.thunkable.com/u/varunkadapatti)\
**Post date:** [March 2, 2023, 4:15am UTC](https://community.thunkable.com/t/my-openai-integration-is-not-working/2230305/9 "2023-03-02T04:15:29Z")

</div>

Even i have the same ‘undefined’ issue. It is happening because the free credit has expired. OpenAI gives you 18$ free credit and because that has expired it returns undefined.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [May 31, 2023, 4:15am UTC](https://community.thunkable.com/t/my-openai-integration-is-not-working/2230305/10 "2023-05-31T04:15:55Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
