# \[Solved\] Why chatgpt API doesn't work, error response : undefined

**URL:** https://community.thunkable.com/t/solved-why-chatgpt-api-doesnt-work-error-response-undefined/2539693
**Category:** Questions about Thunkable X
**Tags:** beginner
**Created:** [August 10, 2023, 3:42pm UTC](https://community.thunkable.com/t/solved-why-chatgpt-api-doesnt-work-error-response-undefined/2539693 "2023-08-10T15:42:17Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bfcq10282o3](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bfcq10282o3](https://community.thunkable.com/u/bfcq10282o3)
#### Post date: [August 10, 2023, 3:42pm UTC](https://community.thunkable.com/t/solved-why-chatgpt-api-doesnt-work-error-response-undefined/2539693/1 "2023-08-10T15:42:17Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/0/806ed974c5266628eb2b8664c5a460be1fbaccf4.png)

here is the code, error response: undefined

why and any code sample or debugging thoughts.

---

<div class="post-metadata">

### Author: ![matt\_conroy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/matt_conroy/32/150843_2.png) [@matt\_conroy](https://community.thunkable.com/u/matt_conroy)
#### Post date: [August 10, 2023, 3:49pm UTC](https://community.thunkable.com/t/solved-why-chatgpt-api-doesnt-work-error-response-undefined/2539693/2 "2023-08-10T15:49:17Z")

</div>

Hi there @bfcq10282o3, thanks for reaching out.

Please see this below previous thread but the issue is likely that you do not have any credits to use toward the model.

> [@OpenAI ChatGPT API KEY not working](https://community.thunkable.com/t/openai-chatgpt-api-key-not-working/2321167/12):
>
> Thank you @ioannis . These are my screenshots, I somehow feel that they have made it paid for the new accounts. I found this in the FAQ [ChatGPT API FAQ | OpenAI Help Center](https://help.openai.com/en/articles/7039783-chatgpt-api-faq) The first question has something for free trial users but further below that it says ChatGPT API is not free.

 ![Screenshot 2023-08-10 at 11.46.17 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/e/8e15314c311aa0ede53985f1622449c7fa46d4b9.png)

Be sure to also set your repsonse to a text label as well.

 ![Screenshot 2023-08-10 at 11.48.45 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/c/fc855f56496600c0a2f37bf4599ecd5b0ae2c9ea.png)

---

<div class="post-metadata">

### Author: ![matt\_conroy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/matt_conroy/32/150843_2.png) [@matt\_conroy](https://community.thunkable.com/u/matt_conroy)
#### Post date: [August 10, 2023, 3:53pm UTC](https://community.thunkable.com/t/solved-why-chatgpt-api-doesnt-work-error-response-undefined/2539693/3 "2023-08-10T15:53:38Z")

</div>

I also want to point out, in case anyone else runs into this vague “undefined” error, you can check the console in your browser to get more specifics. In this case, when I used the Web Preview for the app in [x.thunkable.com](http://x.thunkable.com), the console showed a 429 error with my query.

 ![Screenshot 2023-08-10 at 11.51.01 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/5/b50eeddcc3638eb4f2c245571ca34b28634f724e.png)

A quick google search for “429 error openai” shows that this means the rate limit for my key has been exceeded. In short, I need more credits.

[https://help.openai.com/en/articles/6891829-error-code-429-rate-limit-reached-for-requests](https://help.openai.com/en/articles/6891829-error-code-429-rate-limit-reached-for-requests)

---

<div class="post-metadata">

### Author: ![bfcq10282o3](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bfcq10282o3](https://community.thunkable.com/u/bfcq10282o3)
#### Post date: [August 15, 2023, 3:42pm UTC](https://community.thunkable.com/t/solved-why-chatgpt-api-doesnt-work-error-response-undefined/2539693/4 "2023-08-15T15:42:48Z")

</div>

yes, I solved by a couple of wait and referesh,thx a lot

---

<div class="post-metadata">

### Author: ![matt\_conroy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/matt_conroy/32/150843_2.png) [@matt\_conroy](https://community.thunkable.com/u/matt_conroy)
#### Post date: [August 15, 2023, 3:49pm UTC](https://community.thunkable.com/t/solved-why-chatgpt-api-doesnt-work-error-response-undefined/2539693/5 "2023-08-15T15:49:04Z")

</div>


