How can I update access Token using refresh Token?

I am making authenticated Plugin. I gave refresh Token and access Token to ChatGPT. And when the chatgpt call APIs, there is an access Token on the API Headers.

But, I have a question. When the access Token expired, how can I update the access Token using refresh Token. The ChatGPT has refresh Token and access Token too. But, there is only access token when the api is called.

How can the chatgpt update their access token to my plugin? Do you have acny idea?

This is going to sound silly, but have you tried asking that question in ChatGPT? I found it’s very good at explaining how oauth works and what you need to do.

I think for this specific question, the general idea is that you have some kind of /token endpoint which ChatGPT can call (with the refresh token) to get a new access token when the current one has expired. i.e. It calls your endpoint, and you send it back a new access token.

Cool I got that!! Thank you so much!!

I found that the ChatGPT give me refresh Token when the token expired to authorization_url

Interesting, can you give an example? This seems to be a common topic, so anything you can share will be apricated.

What does that refresh token call look like? I think it is mentioned that authorization_url will be called with refresh_token but never provided the request schema anywhere