Skip to content

[powershell] Failed to access OpenAI api with working API key #122

Description

When running the following command:

.\Codex-CLI\scripts\powershell_setup.ps1 -OpenAIApiKey (ConvertTo-SecureString "sk-f1********************bulz" -AsPlainText -Force)
-OpenAIOrganizationId "org-k**************p2hh" -OpenAIEngineId 'code-davinci-002'

I get the following error:

...\Codex-CLI\scripts\powershell_setup.ps1 : Failed to access OpenAI api [].
Please check your OpenAI API key (https://beta.openai.com/account/api-keys) and
Organization ID (https://beta.openai.com/account/org-settings).

I have confirmed my OpenAI key is correct and functional, as I was able to use it in a different project and it's working fine there. The only problem I can see is the ORG id.

Is there any restriction for which ORGs are able to use this tool? Currently my account is assigned under 'OpenAI Formal External'. Are there any restrictions on that?

Activity

  1. changed the title [-]`Failed to access OpenAI api` with working API key[/-] [+][powershell] `Failed to access OpenAI api` with working API key[/+] on Dec 9, 2022
  2. DaLVeRS2001 commented on Jan 26, 2023

    @DaLVeRS2001

    Did u solve the problem?

  3. luiz00martins commented on Jan 27, 2023

    @luiz00martins
    Author

    DaLVeRS2001 Nope, still waiting on a response.

  4. TheMasonX commented on Mar 30, 2023

    @TheMasonX

    I have this problem too, unfortunately

  5. Jony1990-del commented on Aug 6, 2023

    @Jony1990-del

    This might be a late reply, but I upgraded PowerShell to 7 and it worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions