Error with Bearer token authorization for GPT to access GPT plugin

I have created a GPT and added actions to connect to my GPT Plugin that performs all operations. I use Bearer token, but I am unable to authorize using it. I tired to change prompt and directly instruct to include Bearer token in the header but it also doesn’t work. I tried different approaches with configuring yaml file but they all failed.
I tried these schemes:

securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: Bearer
      in: header

and

securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

How to resolve this issue?

Just checking, have you also added your Bearer token through the UI? Under your action, you’ll need to scroll down on the left panel and add it through the authentication settings.

I think this is what @huwsername is referring to.

1 Like

yes, I have added it. I wonder, if anyone successfully added bearer authentication.


The problem is that client doesn’t produce correct request.

{
  "domain": "my_plugin.com",
  "method": "post",
  "path": "/query",
  "operation": "query_query_post",
  "operation_hash": "7c3dc79b3c01e1802865f8a35266fc7a54759f89",
  "is_consequential": true,
  "params": {
    "queries": [
      {
        "query": "my_query"
      }
    ]
  }
}

It misses part where authorization is added to header

"is_consequential": true,
  "headers": {
    "Authorization": "Bearer my-token"
  },
1 Like

I actually tried Bearer. I used the test button to try it out in preview. It just hanged, so I googled and got here. But when I go ahead and started the normal chat session and specifically asking it to use Actions, it actually did work. I see it hitting my server and able to retrieve the right info.