HELP! PLEASE! ACTION CUSTOM-GPTs

Good evening, fellow trailblazers!

I urgently come to ask for your support, as I have been struggling for more than 7 days a day (much more) to try to resolve my error…

I created a custom-gpts and created an action, this action is failing and the failure concerns authentication.
However, I chose the method: API KEY, entered the API KEY and selected Custom: Authorization.

Follow the code below, is there any way you can help me think of a solution? passing the api key directly in the code, I tried this method of passing it via code but I was unsuccessful…

{
    "openapi": "3.0.0",
    "info": {
      "version": "1.0.0",
      "title": "Elasticsearch API",
      "license": {
        "name": "Apache 2.0"
      }
    },
    "servers": [
      {
        "url": "https://my-deployment-.es.us-central1.gcp.cloud.es.io:443"
      }
    ],
    "paths": {
      "/incident/_search": {
        "post": {
          "summary": "Search for incidents",
          "operationId": "searchIncidents",
          "tags": [
            "search"
          ],
  
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "query": {
                      "type": "object",
                      "properties": {
                        "query_string": {
                          "type": "object",
                          "properties": {
                            "query": {
                              "type": "string",
                              "description": "The search query"
                            }
                          }
                        }
                      }
                    },
                    "sort": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "properties": {
                            "order": {
                              "type": "string",
                              "enum": ["asc", "desc"]
                            }
                          }
                        }
                      }
                    },
                    "from": {
                      "type": "integer",
                      "description": "Start index for search results"
                    },
                    "size": {
                      "type": "integer",
                      "description": "Number of search results to return"
                    },
                    "_source": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Specific fields to return in the search results"
                    },
                    "aggs": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "terms": {
                            "type": "object",
                            "properties": {
                              "field": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "Search results",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "hits": {
                        "type": "object",
                        "properties": {
                          "hits": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "_source": {
                                  "type": "object",
                                  "description": "The content of the document"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "default": {
              "description": "Unexpected error",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Error"
                  }
                }
              }
            }
          }
        }
      }
    },
    "components": {
      "schemas": {
        "Error": {
          "type": "object",
          "required": [
            "code",
            "message"
          ],
          "properties": {
            "code": {
              "type": "integer",
              "format": "int32"
            },
            "message": {
              "type": "string"
            }
          }
        },
        "Document": {
          "type": "object",
          "properties": {
            "action": {
              "type": "string",
              "description": "The person's name."
            },
            "title": {
              "type": "string",
              "description": "The content or body of the information."
            },
            "system": {
              "type": "string",
              "description": "The category of the information."
            }
          },
          "required": ["title", "action", "system"],
          "additionalProperties": true
        }
      }
    }
  }

I might be wrong but security schema is not defined.

You can use the Action Builder GPT, give a sample curl request and this schema and ask it to fix the schema.

Yesterday I got it to work, I managed to pass it as authorization basic defined in the code.
however, when you say define in the schema, do you have any example of a schema with this definition?
I will follow your suggestion of the action builder where I will use a curl.