# Error saying that my API key is wrong although updated

**URL:** <https://forum.adalo.com/t/error-saying-that-my-api-key-is-wrong-although-updated/42339>\
**Category:** Get Help\
**Created:** [October 1, 2023, 1:46am UTC](https://forum.adalo.com/t/error-saying-that-my-api-key-is-wrong-although-updated/42339 "2023-10-01T01:46:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Artus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/artus/32/31488_2.png) [@Artus](https://forum.adalo.com/u/Artus)\
**Post date:** [October 1, 2023, 1:46am UTC](https://forum.adalo.com/t/error-saying-that-my-api-key-is-wrong-although-updated/42339/1 "2023-10-01T01:46:56Z")

</div>

Hello There,  
Would love to get help here, thanks !

I changed and deleted my old OpenAI api Key in place for a new one which caused the askchatgpt custom action to stop working. Whenever I run a test request It now displays an error saying that my API key is wrong and showing the old one I deleted. And this despite the fact I have changed the active openai key to a new code.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/7/2/722e523042ffa8cfe975078c98d6d8f0607c12f4.png)

---

<div class="post-metadata">

**Author:** ![Ali-Bazzi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/ali-bazzi/32/40359_2.png) [@Ali-Bazzi](https://forum.adalo.com/u/Ali-Bazzi)\
**Post date:** [October 1, 2023, 10:04am UTC](https://forum.adalo.com/t/error-saying-that-my-api-key-is-wrong-although-updated/42339/2 "2023-10-01T10:04:21Z")

</div>

Hello, please try to create a new custom action and include the new API key. If the issue persists, you can use the “Chat GPT” component in the Marketplace.

Thank you!

---

<div class="post-metadata">

**Author:** ![Artus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/artus/32/31488_2.png) [@Artus](https://forum.adalo.com/u/Artus)\
**Post date:** [October 1, 2023, 1:47pm UTC](https://forum.adalo.com/t/error-saying-that-my-api-key-is-wrong-although-updated/42339/3 "2023-10-01T13:47:56Z")

</div>

Thanks for your raid reply @Ali-Bazzi !  
In the end I created my onw custom action to connect to Open AI API and using the model they mentionned on their website [here](https://platform.openai.com/docs/api-reference/making-requests)

```auto
curl https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
     "model": "gpt-3.5-turbo",
     "messages": [{"role": "user", "content": "Say this is a test!"}],
     "temperature": 0.7
   }'

```

I was never able to solve the issue using the pre-built Adalo action “Ask Chat GPT”. It seems lots of users have had the same issue, maybe something to debug here ?

Thanks again !

---

<div class="post-metadata">

**Author:** ![allinjoe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/allinjoe/32/31350_2.png) [@allinjoe](https://forum.adalo.com/u/allinjoe)\
**Post date:** [October 1, 2023, 10:28pm UTC](https://forum.adalo.com/t/error-saying-that-my-api-key-is-wrong-although-updated/42339/4 "2023-10-01T22:28:21Z")

</div>

same thing here, openai not working with adalo. same issue. even following the tutorial: [https://www.youtube.com/watch?v=NpcDvTgVB0w](https://www.youtube.com/watch?v=NpcDvTgVB0w)

My error:

```auto
{
  "error": {
    "code": null,
    "message": "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accesing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.",
    "param": null,
    "type": "invalid_request_error"
  }
}

```

how to fix it?

---

<div class="post-metadata">

**Author:** ![Artus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/artus/32/31488_2.png) [@Artus](https://forum.adalo.com/u/Artus)\
**Post date:** [October 3, 2023, 5:07pm UTC](https://forum.adalo.com/t/error-saying-that-my-api-key-is-wrong-although-updated/42339/5 "2023-10-03T17:07:45Z")

</div>

hey allinjoe, in fact you need to enter the word bearer before the api key - that’s why it does not work - see below picutre for reference

![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/9/5/9528bc08f3bfe1ffe742defbb34016f6ddf4130a.png)

---

<div class="post-metadata">

**Author:** ![Artus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/artus/32/31488_2.png) [@Artus](https://forum.adalo.com/u/Artus)\
**Post date:** [October 3, 2023, 5:08pm UTC](https://forum.adalo.com/t/error-saying-that-my-api-key-is-wrong-although-updated/42339/6 "2023-10-03T17:08:58Z")

</div>

As you can see on the picture I wrote the word Bearer before the API key, and that is what you error message is saying. Does that make sense ?

---

<div class="post-metadata">

**Author:** ![allinjoe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/allinjoe/32/31350_2.png) [@allinjoe](https://forum.adalo.com/u/allinjoe)\
**Post date:** [October 5, 2023, 4:43am UTC](https://forum.adalo.com/t/error-saying-that-my-api-key-is-wrong-although-updated/42339/7 "2023-10-05T04:43:07Z")

</div>

Hi and thanks, it works. The Problem was as well that i used the name “Auth” and not “Authorization” 🙂

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/system/32/40401_2.png) [@system](https://forum.adalo.com/u/system)\
**Post date:** [October 15, 2023, 4:43am UTC](https://forum.adalo.com/t/error-saying-that-my-api-key-is-wrong-although-updated/42339/8 "2023-10-15T04:43:59Z")

</div>

Closed on October 15, 2023, 4:43am UTC

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