Skip to content

Get-OpenAICreditGrants - Now requires authorization using session key instead of the API Key. #5

@mc1903

Description

@mc1903
          > Hi, in this Get-OpenAICreditGrants.ps1 script, the key being used is apikey, but openai requires it to be sessionkey. Did I misunderstand something?

Hi,

No, you didn't misunderstand anything. It looks like they have changed something on the backend.

I am seeing:


Get-OpenAICreditGrants -jsonOut -Verbose
VERBOSE: APIKey is sk-pkxb**************************************oB1emM
VERBOSE: GET https://api.openai.com/dashboard/billing/credit_grants with 0-byte payload
{
    "error":  {
                  "message":  "Your request to GET /dashboard/billing/credit_grants must be made with a session key (that is, it can only be made from the browser). You made it with the following key type: secret.",
                  "type":  "server_error",
                  "param":  null,
                  "code":  null
              }
}


The API endpoint I am using is an unofficial one, so this is likely to happen.

When I have some free time, I will look to see if this function can be fixed.

Thanks
M

Originally posted by @mc1903 in #4 (comment)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions