Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAI Conversation - 401 Incorrect API key provided #125398

Closed
gerdemann opened this issue Sep 6, 2024 · 21 comments · Fixed by #141374
Closed

OpenAI Conversation - 401 Incorrect API key provided #125398

gerdemann opened this issue Sep 6, 2024 · 21 comments · Fixed by #141374

Comments

@gerdemann
Copy link

The problem

Hi,
I have entered a correct API key, but it still tells me that it is not valid.
The error message also looks like a different (hashed) key to me.

Sorry, I had a problem talking to OpenAI: Error code: 401 - {'error': {'message': 'Incorrect API key provided: w$niXtAt**dHN5. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}

What version of Home Assistant Core has the issue?

core-2024.9.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

OpenAI Conversation

Link to integration documentation on our website

https://www.home-assistant.io/integrations/openai_conversation/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Sep 6, 2024

Hey there @balloob, mind taking a look at this issue as it has been labeled with an integration (openai_conversation) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of openai_conversation can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign openai_conversation Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


openai_conversation documentation
openai_conversation source
(message by IssueLinks)

@Cyrelion
Copy link

Cyrelion commented Sep 6, 2024

I'm getting the same error since the upgrade, and it looks like the openai connection is now trying to use the discovergy (inexogy) api key. API keys for openai are still correct in the .storage files.

@gerdemann
Copy link
Author

gerdemann commented Sep 6, 2024

Yes, that's right. In my case, it also takes the discovergy/inexogy access data.
Perhaps this is related to the caching of the requests.
f760c13

@hstreitenberger
Copy link

Same here: also since upgrade, and it's used the key from discovergy (inexogy)!?

@Cyrelion
Copy link

Any news on this? It's still not working :-(

@Cyrelion
Copy link

@balloob I know you are a quite busy person, maybe you can forward this problem to another developer to have a look at. This is quite frustrating because now all my tts scripts aren't working at the moment.

@gerdemann
Copy link
Author

Yes, that's right. In my case, it also takes the discovergy/inexogy access data. Perhaps this is related to the caching of the requests. f760c13

If I undo this change, everything works again.

@Loi83
Copy link

Loi83 commented Sep 19, 2024

Yes, that's right. In my case, it also takes the discovergy/inexogy access data. Perhaps this is related to the caching of the requests. f760c13

If I undo this change, everything works again.

Would you tell us which change you undid?

@gerdemann
Copy link
Author

The change from this commit:
f760c13

@Loi83
Copy link

Loi83 commented Sep 19, 2024

okay, unfortunately I have no idea what I had to do, so I'll have to wait for a fix 😅

@gerdemann
Copy link
Author

@balloob Can we revert this commit (f760c13) until there is a solution?

@Cyrelion
Copy link

Still no Solution for this?

@prinzkafka
Copy link

Same Problem - Integration takes password from Discovergy/Inexogy as API Key 🙈

@gerdemann
Copy link
Author

Any updated on this? Can the commit be reverted?

@hstreitenberger
Copy link

I have the same problem...
Has someone a working workaround for this problem, maybe delete the integrations an reinstall oder something similar?

gerdemann added a commit to gerdemann/core that referenced this issue Dec 10, 2024
@sebster6
Copy link

Would be grateful for a workaround as well, having the same problem and can’t get any OpenAI communication working because of it. :(

@p1ranha
Copy link

p1ranha commented Feb 12, 2025

Same problem here, I just got my Voice PE, and cannot use it because of this bug.

@p1ranha
Copy link

p1ranha commented Feb 12, 2025

@balloob Is there some workaround, like deleting the cache in the meantime, while we wait for the fix?

@prinzkafka
Copy link

@balloob Is there some workaround, like deleting the cache in the meantime, while we wait for the fix?

I‘ve changed the password from Discovergy to my API Key from Open AI 🙈🫣🤣

@p1ranha
Copy link

p1ranha commented Feb 12, 2025

@balloob Is there some workaround, like deleting the cache in the meantime, while we wait for the fix?

I‘ve changed the password from Discovergy to my API Key from Open AI 🙈🫣🤣

Can you then change it back and have both working? Discovergy is critical to me, as it controls what electrical devices are permitted or not.

I even installed the OpenAI Extended from Hacs, but it has the same problem for whatever reason. It also uses password from discovergy.

@p1ranha
Copy link

p1ranha commented Feb 12, 2025

Actually I did install OpenAI Extended from Hacs and commented the two lines (33 and 156) in the custom_components/extended_openai_conversation/init.py which are similar to this commit.

This helped with this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants