GPT Actions Error - "Auth URL, Token URL and API hostname must share a root domain"

I’m trying to add an action to a new GPT I’m creating. I’m getting the following error when trying to save:

image

“Authorization URL, Token URL and API hostname must share a root domain”

I believe the source of this error is that I am trying to use Yahoo’s Fantasy Sports APIs via OAuth2 and they have differing root domains for OAUTH and the actual API calls themselves:

https://api.login.yahoo.com/oauth2/authorize

VS

https://fantasysports.yahooapis.com

So, this restriction looks like it will prevent me from using this API. Is there a workaround? This immediately put the brakes on this custom GPT I wanted to build.

2 Likes

@tyler.schacht having the same issue here with HubSpot API:

Authorization URL:
https://app.hubspot.com

Root URL:

1 Like

Same here, trying to use Google APIs… I imagine a lot of services are like this. Hope this is something OpenAI will fix

3 Likes

For me it worked by shortening the urls with an url shortener.

6 Likes

@tyler.schacht Do you intend to incorporate oauth in your actions?

When setting up the OAuth - what should the redirect URIs be?

Can search for the source I found in OpenAI’s docs, but seems like the callback url should be on this format:
https://chat.openai.com/aip/{custom-gpt-id}/oauth/callback

So, for example: https://chat.openai.com/aip/g-tJykiAEa3FA/oauth/callback

Edit - found source: OpenAI Platform
Might be wrong, as I realize this says it’s for “Plugins” :person_shrugging:

2 Likes

Yes…and the issue i’m running into is that OpenAI requires the OAuth root domain to be the same as the API root domain. However, for my yahoo API I am trying to use, it is different.

When you create the GPT Action, the OpenAI editor will give you the callback value to use. It’s a catch-22 thing…you don’t know the correct value until you setup the action in the GPT editor.

2 Likes

I managed to avoid the “Authorization URL, Token URL and API hostname must share a root domain” issue.

Now, the re-direct is not working. I end up in “ChatGPT” with the error: “Couldn’t log in with plugin”.

I am using the Callback URL which is shown under the Configure tab below the Actions field.

Any idea what’s wrong?

1 Like

I believe you worked around the domain issue by using url-shorteners (redirects). I wonder if that worked for getting past the initial error message but is causing issues when actually being utilized?

I’m debating on pulling back until next week based on UI issues. I wanted to dive deep into GPTs over the next few days, but I fear the Actions functionality is just currently unreliable. The UI change last night was sudden and unexpected, and since that change I have been unable to edit any existing actions (the changes will never save even after clicking the ‘update’ button). The only solution is to delete the previous action and re-create it.

2 Likes

I am seeing the same error message. However, if I start a new chat with the custom GPT it will actually make the calls. It seems like the auth token gets stored and then used when you start a new session. I think it is the redirect that just isn’t working correctly.

2 Likes

Kind of where I am too. Working on an action that needs google apis. Managed to get OAuth working, got the redirect “Couldn’t log in with plugin”” issue but when accessed the gpt again, I could sign in to my gmail account, but could not actually access the API (404 not found)…

1 Like

Thanks for the tip about the URL shortener @Daniel. I managed to get it work yesterday for Google APIs.

Tips that might help others:

  1. You need to create a shortened url for all three URLs. The two in the oauth box and the other URL in your json file.
  2. On the previous configuration page you will find the callback url that you will need to whitelist in your Google Cloud Console. Note this URL changes when you make a change in your GPT config. So this can be a reason why you get a failure.
  3. When I got it to work it redirected me to the plugin page and said there was an error. But when I go to use the (published) GPT again it has saved the token and it makes the call with no oauth page anymore.

Having the url shortener is obviously not ideal, but it lets me keep hacking while I wait for them to make the fix.

Hope it helps someone.

4 Likes

What shortener are u using? I’ve tried TinyURL but when connection fires it wants me to login to TinyURL and wont proceed. Thoughts?

it does , thanks so much Kiwi. Now when i try to retrieve my emails, the assistant is not passing anything "Some info will be sent to www.googleapis.com, only do this for sites you trust - Gmail Assistant needs to send this info to www.googleapis.com

{}
"

here is the schema, Any idea why it is not passing info?
{
“openapi”: “3.1.0”,
“info”: {
“title”: “Google APIs”,
“description”: “API for accessing various Google services including Gmail and Google Calendar.”,
“version”: “1.0.0”
},
“servers”: [
{
“url”: “https://www.googleapis.com
}
],
“paths”: {
“/gmail/messages”: {
“get”: {
“summary”: “List Gmail messages”,
“operationId”: “listGmailMessages”,
“responses”: {
“200”: {
“description”: “A list of Gmail messages”,
“content”: {
“application/json”: {
“schema”: {
“$ref”: “#/components/schemas/MessageList”
}
}
}
}
}
}
},
“/gmail/messages/{messageId}”: {
“get”: {
“summary”: “Get a specific Gmail message”,
“operationId”: “getGmailMessage”,
“parameters”: [
{
“name”: “messageId”,
“in”: “path”,
“required”: true,
“schema”: {
“type”: “string”
}
}
],
“responses”: {
“200”: {
“description”: “Details of a specific message”,
“content”: {
“application/json”: {
“schema”: {
“$ref”: “#/components/schemas/Message”
}
}
}
}
}
}
},
“/calendar/events”: {
“get”: {
“summary”: “List Google Calendar events”,
“operationId”: “listCalendarEvents”,
“responses”: {
“200”: {
“description”: “A list of calendar events”,
“content”: {
“application/json”: {
“schema”: {
“$ref”: “#/components/schemas/EventList”
}
}
}
}
}
}
},
“/calendar/events/{eventId}”: {
“get”: {
“summary”: “Get a specific calendar event”,
“operationId”: “getCalendarEvent”,
“parameters”: [
{
“name”: “eventId”,
“in”: “path”,
“required”: true,
“schema”: {
“type”: “string”
}
}
],
“responses”: {
“200”: {
“description”: “Details of a specific event”,
“content”: {
“application/json”: {
“schema”: {
“$ref”: “#/components/schemas/Event”
}
}
}
}
}
}
}
},
“components”: {
“schemas”: {
“MessageList”: {
“type”: “array”,
“items”: {
“$ref”: “#/components/schemas/Message”
}
},
“Message”: {
“type”: “object”,
“properties”: {
“id”: {
“type”: “string”
},
“subject”: {
“type”: “string”
},
“body”: {
“type”: “string”
}
}
},
“EventList”: {
“type”: “array”,
“items”: {
“$ref”: “#/components/schemas/Event”
}
},
“Event”: {
“type”: “object”,
“properties”: {
“id”: {
“type”: “string”
},
“title”: {
“type”: “string”
},
“start”: {
“type”: “string”,
“format”: “date-time”
},
“end”: {
“type”: “string”,
“format”: “date-time”
}
}
}
}
}
}

I am glad to report that I fixed that issue and that also, now I do not need to worry about Auth URL, Token and API domain not sharing a root domain.
Here are the urls, as you can see they do not share a root domain:

https://accounts.google.com/o/oauth2/auth
https://oauth2.googleapis.com/token
https://gmail.googleapis.com/gmail/v1

1 Like

@getinference could you please share your solution - how does your schema look like? How did you setup the Authentification? THX!

1 Like

I’m noticing this too, starting a new chat makes the api calls work, but the experience is not great since it misleadingly says Couldn’t log in with plugin. Did you find any way to fix the UI issue?

I used TinyURL to get mine to work. Hampus I’m not sure why it wants you to log into TinyURL to access your URL? That seems strange. The urls should be public.

@getinference Thanks for letting us know OpenAI have made the fix. I will have a go at updating my settings.

@Terceseht maybe it didn’t correctly get a Token the first time you ran it? Can you let us know a bit more details about your setup?

Here is my json if it helps anyone.

{
“openapi”: “3.1.0”,
“info”: {
“title”: “YouTube searcher”,
“description”: “Finds cool videos on YouTube using the YouTube API.”,
“version”: “v1.0.0”
},
“servers”: [
{
“url”: “This was the tinyurl”
}
],
“paths”: {
“/search”: {
“get”: {
“description”: “Run a YouTube search for a video list”,
“operationId”: “YouTubeSearch”,
“parameters”: [
{
“name”: “part”,
“in”: “query”,
“description”: “The type of message (which is always snippet)”,
“required”: true,
“schema”: {
“type”: “string”,
“enum”: [
“snippet”
]
}
},
{
“name”: “maxResults”,
“in”: “query”,
“description”: “The number of results to return. Please limit this at 25.”,
“required”: true,
“schema”: {
“type”: “number”
}
},
{
“name”: “q”,
“in”: “query”,
“description”: “This is the search query for YouTube search”,
“required”: true,
“schema”: {
“type”: “string”
}
},
{
“name”: “key”,
“in”: “query”,
“description”: “This is the API key and should not be shared”,
“required”: true,
“schema”: {
“type”: “string”,
“enum”: [
“This is where my key goes. Probably a better way, but I’m not making it public so meh.”
]
}
}
],
“deprecated”: false
}
}
},
“components”: {
“schemas”: {}
}
}

1 Like