GPT action - header paramter

Hi all

Is it possible to pass two header parameters in an action? The service that I need to connect requires two parameters to authenticate.
if it’s possible can someone share what it looks like in the action schema?

7 Likes

Typically you’d do:

          {
            "name": "BlahBlah",
            "in": "header",
            "description": "Do a thing",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "value"
              ]
            }
          },

Where we use a single enum for the ‘value’ to force it to a single thing.

However, I’ve tried using this and it seems to not support headers which is annoying. parameter BlahBlah has location header; ignoring

But I was testing for normal requests, maybe authentication lets you use headers since lots of auth endpoints require them.

Same thing, and I am not seeing anything anywhere on this. To me it’s extremely confusing considering MOST API calls either have, or request header values to be sent. I am second guessing myself in regards to understanding what ‘Action’ actually is considering it states it’s a method to allow your custom GPT to call API’s to add functionality. I have tried so many different ways of passing header information. It would be nice if someone either said yes it can be done, and this is how it’s done or if it was stated NO you can not pass header values through the action to call external API’s

Same issue here, I’ll follow this thread in hope someone has finds an answer to this question

I am having the same issue. Looking forward to a solution.

1 Like

I have also run into this issue. No solution so far. Considering setting up some sort of API Gateway or API forwarder that routes GPT calls.

Does anyone know if the Assistant API also has these limitations?

UPDATE: I have not found an easy way to add headers to a request via Google’s API Gateway. Google Cloud Endpoints might work, but it looks significantly more complicated.

UPDATE2: Ok. I have solved this for my use case. I ended up creating a Google/firebase cloud function that adds in the header I need. My action calls that function instead of the api endpoint, and then the function adds the header, forwards the request along, and passes the data back. There’s also a Google API Gateway in the middle, but I don’t think that is 100% necessary.

3 Likes

Seems to be working fine when I tested today !

@jean.malartic how did you get it working?

@jean.malartic , please can you tell us how did you get it work ?

on my end I simply passed the header as a parameter in a path
It used to skip the information and send an error message but since my latest attempts it worked fine and passed the header parameters correctly.

an example :

“paths”: {
“/v1/blocks/{block_id}”: {
“get”: {
“summary”: “Retrieve a Block”,
“description”: “Retrieves detailed information about a block using its unique ID.”,
“operationId”: “retrieveBlock”,
“parameters”: [
{
“name”: “block_id”,
“in”: “path”,
“required”: true,
“description”: “The unique identifier of the block.”,
“schema”: {
“type”: “string”
}
},
{
“name”: “Notion-Version”,
“in”: “header”,
“required”: true,
“description”: “The version of the Notion API being used.”,
“schema”: {
“type”: “string”,
“default”: “2022-06-28”
}
}
],

1 Like

I have very similar setup and I’m getting this message about my API spec:
In path /summary, method get, operationId get_all_summaries, parameter X-TOKEN has location header; ignoring.

This actually prevents the whole API spec to work

Hi there. Have you found a solution to this problem?

You would have to add a server which can handle the call from your GPT and can relay information from your api by adding required headers. There are few 3rd party services which can help you with this