Are there any API/CLI available to interact with Azure OpenAI and content filters?

Taha 0 Reputation points
2025-02-27T13:30:03.4766667+00:00

Hello, I am new to azure so this might be a basic question. Is there any API or CLI available to interact with Azure Open AI service? I am specifically looking for content filters and if there is any API way to create content filter or get already created content filters.

I don't see OpenAI in the CLI reference here: https://learn.microsoft.com/en-us/cli/azure/

Is there any other such thing available in CLI or some SDK?

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

2 answers

Sort by: Most helpful
  1. Vinodh247 28,386 Reputation points MVP
    2025-02-27T17:07:49.59+00:00

    Hi ,

    Thanks for reaching out to Microsoft Q&A.

    1. You won’t find Azure OpenAI commands in the CLI today.
    2. Content filtering is handled within the same calls to the Azure OpenAI (GPT/Chat) or Moderation endpoints - there’s no separate “create filter” resource.
    3. Your best bet is to use the REST API or the existing SDKs (Python, .NET, etc.) to interact with Azure OpenAI and leverage built-in content filtering and moderation.

    Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.

    0 comments No comments

  2. Saideep Anchuri 3,140 Reputation points Microsoft Vendor
    2025-02-28T06:52:51.93+00:00

    Hi Taha

    Welcome to Microsoft Q&A Forum, thank you for posting your query here!

    Yes, there are APIs and CLI options available to interact with Azure OpenAI and manage content filters.

    Kindly refer bellow ink: REST API

    azcognitiveservices

    You can go through content safety documentation to filter out harmful content which is a separate resource from content filter provided in open AI. Attached Rest API and Python SDK docs.

    Hope this helps. Do let us know if you any further queries.

     


    If this answers your query, do click Accept Answer and Yes for was this answer helpful.

    Thank You.

    0 comments No comments

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.