FAQ: How do I implement the Userid Parameter?

You can pass this parameter in your API calls using user = '$userIDString'

For example, this is how you’d send the parameter in a Completion endpoint call with a userID of ‘1’:

response = openai.Completion.create(engine = "davinci", prompt = "This is a test", max_tokens = 5, user = "1")

2 Likes

Hi there,

I’m trying to send this user parameter from the SDK call and the REST API as recommended in How to Incorporate a UserID | OpenAI Help Center, but I’m not able to actually view the value I set in the response.

Is there any way I can get back the value I set in the user-id, so that I can perform my own abuse monitoring on users?

Thanks in advance.

Hi and welcome to the developer forum!

Not sure I follow your logic here “get back the value I set in the user-id” if you set it, you know what it is? Should be a simple matter of logging that value along with the API call prompt and reply and time/date etc. Am I missing something?

1 Like

Ah gotcha, in hindsight my question is very straightforward lol. That makes sense, we have the value and we can log it as needed. A related question though, is this value actually “monitored” by OpenAI for any policy violations and such ( as shown in Safety best practices - OpenAI API)?

Your keys/account is monitored. So, if they get flags, they might either ask you what member is sending X Y or Z prompt and/or take other actions on your account. You should be using the moderation endpoint to flag anything before sending to a model anyway.

2 Likes