openai-python icon indicating copy to clipboard operation
openai-python copied to clipboard

Check usage of a given user

Open Wheest opened this issue 2 years ago • 2 comments

I am testing out an application, and am using the user field to set which user has made a request. From the docs, it says that OpenAI uses this to check for abuse.

However, is there a way to get more data from the API on a per-user level? E.g. number of calls, etc.

Wheest avatar May 18 '22 17:05 Wheest

Hi @Wheest! Thanks for the issue.

I don't think there's a way to do per-user level analysis at this time. cc @kennyhsu5

hallacy avatar May 18 '22 21:05 hallacy

Many thanks.

I can of course see usage at https://beta.openai.com/account/usage, which lists details of each request, e.g.:

08:48
Local time: 19 May 2022, 09:48
text-davinci, 1 request
103 prompt + 40 completion = 143 tokens (<$0.01)

Having the user string added here would be valuable to understanding usage (and less overhead than trying to correlate using other data). I've not seen a way to export this usage data (e.g. to a CSV or JSON), but I could be missing that.

Wheest avatar May 25 '22 08:05 Wheest

Thanks for the suggestion!

This sounds like a feature request for the underlying OpenAI API and not the Python library, so I'm going to go ahead and close this issue.

Would you mind reposting at community.openai.com?

rattrayalex avatar Dec 30 '23 23:12 rattrayalex