How does the "user" parameter work in Azure OpenAI Service

shuang 0 Reputation points
2024-03-04T06:45:46.08+00:00

I am reading about the Azure OpenAI Service REST API and saw that the "user" parameter can aid in monitoring and detecting abuse. I am curious about the specifics of how this parameter works and from where I can monitor token usage against the "user" parameter. Additionally, there is an image provided in the original post.User's image

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,886 questions
{count} votes

1 answer

Sort by: Most helpful
  1. dupammi 8,460 Reputation points Microsoft Vendor
    2024-03-04T09:17:48.5066667+00:00

    Hi @shuang

    Thank you for using the Microsoft Q&A forum.

    As per your question, I understand that you would like to know more details about the "user" parameter in Azure OpenAI REST API. I will be happy to assist you with this.

    The "user" parameter in Azure OpenAI Service REST API is used to provide a unique identifier representing your end-user. This helps Azure OpenAI monitor and detect abuse. It is recommended to use pseudo-anonymized values such as GUIDs instead of PII identifiers, while providing values for this parameter in the request.

    You can easily generate UUIDs using a variety of methods in your application and then copy and paste them into your Postman requests.

    See below: User's image

    Below is the repro I tried from my end in POSTMAN. See below.

    Note: Passed above uuid as value for "user".

    User's image

    In the above POSTMAN response, I received "finish_reason": "content_filter" because the content was filtered based on the severity level of the categories.

    Please consult the curl-openai-reference-example-request and content filtering guide to understand more from the official documentation. Also note that the "user" parameter is optional and not required for the Azure OpenAI Service REST API to function.

    Regarding your other question, you can try using Azure Monitor to track token usage by creating a diagnostic setting to collect platform logs and metrics.

    I hope you understand. Thank you.


    Please do not forget to click Accept Answer and Yes for was this answer helpful, wherever the information provided helps you. This can be beneficial to other community members.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.