Issue with GPT Actions not triggering external API calls

I’m having trouble with GPT Actions because they aren’t calling my external API. I tested my API with Postman and it works fine. I’ve checked my Schema thoroughly and it’s correct. My API endpoint doesn’t need authentication, which matches the settings in GPT Actions. However, I’m not seeing any signs of incoming requests from GPT in my server logs, which makes it hard to figure out the issue. Am I missing an important step? Or is it a common issue for GPT Actions to not make calls to external APIs? Any advice or tips would be very helpful.

5 Likes

You can check the description of each breakpoint, and GPT will determine whether to penalize interface calls based on the description. Just my personal understanding, I can give it a try.

I ran into this because the UI wasn’t actually saving changes to my openapi schema. Exit edit mode and come back in and see if any changes you made were actually saved.

1 Like

Thanks everyone for responses. I deleted a schema and just created a new one, and it works. At least, a POST request from my GPT to an external test API endpoint. But I’ve got another issue and that is related to a schema misconfiguration, I guess.

So far I’ve only seen this working properly with Zapier.

2 Likes

It is possible to use APIs with GPTs. I successfully created an example of a GPT that incorporates additional logic from an external server.

I am having the same problem.
I have the following scheme:

{
  "openapi": "3.1.0",
  "info": {
    "title": "title",
    "description": "description...",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://domain/"
    }
  ],
  "paths": {
    "/gpt/profile": {
      "get": {
        "description": "description",
        "operationId": "id",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "descirption",
            "required": true,
            "schema": {}
          }
        ],
        "deprecated": false
      }
    }
  },
  "components": {
    "schemas": {}
  }
  
}

When I test the https://domain/gpt/profile in postman I get a response (plain text). However, I do not get any api call from the custom GPT.
In the edit screen I get the “Error talking to…” error and when I ask what is the error I get “HTTPStatusError”
Any help?

Thanks🙏

2 Likes

Anyone? I can not get the action to call my server…

use this GPT to test if your api is correct:

API Alchemist

1 Like

Thanks but it did not help much.
It is very frustrating…

2 Likes

Are you sure they don’t arrive at all?

I had just like you in your example a / after the domain which resulted in that the calls were made to https://domain//path (notice the extra slash)
Try changing to "url": "https://domain"

I finally got it working (with some help from the API Alchemist :pray:)
Here is the version that worked for me:

Working scheme custom GPT

{
  "openapi": "3.1.0",
  "info": {
    "title": "title",
    "description": "description",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://domain/"
    }
  ],
  "paths": {
    "/path": {
      "get": {
        "description": "description.",
        "operationId": "operationId",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "description.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "description.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "// Define the properties here": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "404": {
            "description": "Not Found "
          },
          "500": {
            "description": "Internal Server Error "
          }
        },
        "deprecated": false
      }
    }
  },
  "components": {
    "schemas": {
    }
  }
}
3 Likes

Someone posted on X that it has to do with trying to modify/save the default action schema. Delete this action and create a new one. The changes saved and worked.

1 Like

Very glad I found your solution. Thank you to the person who solved this.

This was driving me crazy this evening. I kept updating the YAML Schema and kept getting an ok response from the first endpoint I created and confirmed worked but when I added the second one, it couldn’t seem to access it. What is more confusing is that as soon as one updates the Action YAML Schema the Available Actions updates and the Test button appears implying that one can access it in the right test window. I also saved and updated the GPT multiple times thinking it was being updated. The test screen also grays out when you adjust the YAML so that too makes one think it has adopted the changes. This is not behaving in a way a typical user would expect. I hope they fix this non-intuitive UI behavior soon (or include splash banner alert to watch out for this problem).

For reference here is what the response looks like when the endpoint is working:

[debug] Calling HTTP endpoint
{
“domain”: “api.domain”,
“method”: “post”,
“path”: “/api/v2/autocomplete/funding_agency/”,
“operation”: “fundingAgencyAutocomplete”,
“operation_hash”: “91c7f67d476f055c92cef1a1485b21f9342352345”,
“is_consequential”: true,
“params”: {
“search_text”: “National Science Foundation”
}
}

Here is what it looks like when it is not (note the null):

[debug] Calling HTTP endpoint
{
“domain”: “api.domain”,
“method”: null,
“path”: null,
“operation”: “pscAutocompletePost”,
“operation_hash”: “”,
“is_consequential”: true,
“params”: {
“search_text”: “medical”
}
}

1 Like

I’ve been getting the same error all day trying to connect to a Weaviate database! Postman works fine and GPT just says error talking to…

I’ll try copy > delete > create when I get home. :grin:

I was struggling to get an action to authenticate with a bearer token, I used this custom GPT (not mine) and finally got it to work without issue. For some reason, the YAML that this GPT with all the examples etc. is the one that works. When I try to modify it with regular GPT-4 ChatGPT it breaks. Go figure.

This is the custom GPT url with the domain stripped out:

g/g-VnDDTuyM5-pro-create-openapi-from-doc

I tried all of the above, i.e. recreate, API Alchemist, etc. But it still doesn’t work. Any help would be highly welcome.

Situation: I want to use GPT Actions (“Create new Action”) to access my API.

The issue: When I test the API call, my server does not get any request from my GTP. And GPT reports an error.

Error message from GPT Preview:

Comment: Otherwise my api works smoothly. Here a sample api endpoint: server.dotacoach.gg/v1/hero/npc_dota_hero_furion

My YML schema:

openapi: 3.1.0
info:
  title: Dota 2 Statistics API
  description: API for real-time Dota 2 statistics
  version: v1.0.0
servers:
  - url: https://server.dotacoach.gg
paths:
  /v1/hero/{npc_dota_hero_name}:
    get:
      description: Get stats for a specific Dota 2 hero
      operationId: getHeroStats
      tags:
        - Heroes
      parameters:
        - name: npc_dota_hero_name
          in: path
          example: npc_dota_hero_furion
          description: The name of the Dota 2 hero for which statistics are requested
          required: true
          schema:
            type: string
      deprecated: false
      responses:
        "200":
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  hero_id:
                    type: integer
                  npc_name:
                    type: string
                  localized_name:
                    type: string
                  turbo_pick_rate:
                    type: number
                    format: double
                  turbo_win_rate:
                    type: number
                    format: double
                  professional_pick_rate:
                    type: number
                    format: double
                  professional_ban_rate:
                    type: number
                    format: double
                  professional_win_rate:
                    type: number
                    format: double
                  herald_win_rate:
                    type: number
                    format: double
                  herald_pick_rate:
                    type: number
                    format: double
                  guardian_win_rate:
                    type: number
                    format: double
                  guardian_pick_rate:
                    type: number
                    format: double
                  crusader_win_rate:
                    type: number
                    format: double
                  crusader_pick_rate:
                    type: number
                    format: double
                  archon_win_rate:
                    type: number
                    format: double
                  archon_pick_rate:
                    type: number
                    format: double
                  legend_win_rate:
                    type: number
                    format: double
                  legend_pick_rate:
                    type: number
                    format: double
                  ancient_win_rate:
                    type: number
                    format: double
                  ancient_pick_rate:
                    type: number
                    format: double
                  divine_win_rate:
                    type: number
                    format: double
                  divine_pick_rate:
                    type: number
                    format: double
                  immortal_win_rate:
                    type: number
                    format: double
                  immortal_pick_rate:
                    type: number
                    format: double
                  overall_win_rate:
                    type: number
                    format: double
                  overall_pick_rate:
                    type: number
                    format: double
        "400":
          description: Bad request
        "404":
          description: Hero not found
        "500":
          description: Internal server error

What’s really frustrating is that I can take a schema that results in the “error talking to” message and copy it into a brand new GPT and it works fine.

GPTs and Assistants have been really frustrating since they were made available.

Ah! In my case clearing the GPT’s authentication mechanism, saving it, and then re-configuring it enables it to make HTTP requests to my API.

This was necessary after publishing the GPT and then making subsequent updates to it, I think?

1 Like

Can confirm that clearing the authentication (setting it to none, then saving) and readding authentication fixed it for me. It was so weird, I just added new methods and suddenly it wouldnt work, good to know its an OpenAI bug, I wasted an hour debugging the schema haha.

2 Likes