GPTs “User-Agent” setting

Hey there! The News API you’re using requires all incoming requests include a User-Agent header. Without seeing your action schema directly, it looks like you’re probably hitting the API directly.

Essentially, in the background when you ask ChatGPT to contact the News API, it makes a request to the API on the backend. Right now, the request that ChatGPT is making doesn’t include a User-Agent header, but the News API wants one, which is causing the error you’re seeing.

Unfortunately, ChatGPT doesn’t seem to support the headers field in OpenAPI yet, so you’re going to have to create a proxy around the News API. You might be able to use something like Cloudflare Workers for this; all you’ll need to do is forward on requests and add a User-Agent header to them with the User Agent you want. I don’t have the time to explain how to do this, but there’s lots of documentation around that for Cloudflare Workers.

Anyway, I can confidently tell you that this isn’t an issue with authorization or ChatGPT; your Action just isn’t forming the requests in the format that the News API is expecting and you’ll need to take action to fix that :slight_smile:

1 Like