Access to current user identifier within GPTs

In relation to the GPTs functionality, I know that at the moment you can retrieve your own UserID using the API.

Is it possible to retrieve an ID for the user that is currently using a GPT?

A use case would be where you want to store information in a backend app for each user specifically and retrieve it later via the functions.

7 Likes

I second this question. I think moving forward with custom GPTs, it’s going to be useful to be able to know the user’s ID.

2 Likes

You can implement OAuth and have your users sign in. I doubt openai would offer a way to id users without their consent.

1 Like

So then it isn’t possible (via GPTs) to retrieve data relevant to an individual user?

Context is maintained in threads, but you’re not going to get a user identifier that would be consistent across threads/GPTs

1 Like

So then there’s no way to connect an App that’s built with my own custom front-end (and using the OpenAI API) with my GPTs?

That seems like it’s a missing feature as it means we can’t build GPTs that interact with IoTs…

Maybe I’m misunderstanding something? It seems like GPTs will just be narrowed-down versions of ChatGPT and not powerful things that can interact with user-specific content…

If you want to build your own UI, then use Assistants (also new) rather than GPTs. Same concepts just without the GPT UI.

2 Likes

I guess the motivation for going the GPTs route was to take advantage of the upcoming store. We wanted our app to be available to others via the store without us having to market it ourselves.

After some testing, I did find that the API calls to our backend from ChatGPT does pass the conversation id and an ephemeral user id, which expires after 24 hours. Unfortunately, this won’t be useful, since it’s not a persistent value. Seems to be the same as what’s available for plugins.

2 Likes

I was thinking about this, and I suppose a user could just identify themselves by just telling your GPT what their username and password is.

It could then just call an action in your schema to store the user for future retrieval, or verify who it is.

1 Like

Yeah I come down to this realization recently, a couple of thoughts:

  1. if you can afford it, make your service stateless so you don’t need to rely on uid, or session id or what not, I know it’s not always feasible but worth a shot;
  2. Use assistant API. You probably lose some traffic from open AI store (in the future), but you gain better control, e.g. uid;
  3. Make some clunky actions that allow user to jump to your login page and you figure out how to wire up whatever in their request and user login event, in my opinion, not worth it.

Am also interested in something like this.
Right now seems like the best solution is to build our own chat as a workaround.

But a feature like this seems like it could be added in the future, rendering the cost/benefit of the effort involved in building our own chats questionable.

I don’t think it’s possible. GPTs have a GPT_ID but no assistant id. You can create an assistant from your GPT to get the assistant id.

1 Like

If you add Oauth2 authentication to your app, then you can let user sign in to your app and let every request be sent with user id

1 Like

What brings me to this conversation is that I am doing the exact above – I require an email verification.

My question is, you know there will be clowns out there trying to impersonate valid users – so is there a way to identify that clown is based upon their ChatGPT acount? The account id, the email, whatever. A temporary id that expires in 24 hours is useless because it will be more than 24 hours before we discover the attempt.

I did all three, but instead of assistants api I used chat completion api. And users don’t have to jump to a login page. And I can still create a GPT and place it in the GPT store.

https://chat.openai.com/share/2af2878d-b1dd-4762-9f28-d32d5f86ba3b

But, it would be nice to know who the clowns are that will try to log in using the email address in the example above.

I had the same issue like you and got stuck. My final approach is to ask the user’s email When The user starts the app.
It’s not a good solution,but at least you won’t get stuck.