How to make o1-mini work with "on your data" REST API?

Art 20 Reputation points
2025-02-05T19:51:47.1866667+00:00

I am sending this request via Postman:

POST https://example.openai.azure.com/openai/deployments/o1-mini/chat/completions?api-version=2024-10-21

{
    "data_sources": [
        {
            "type": "azure_search",
            "parameters": {
                "endpoint": "https://example.search.windows.net",
                "index_name": "my_index",
                "authentication": {
                    "type": "system_assigned_managed_identity"
                }
            }
        }
    ],
    "messages": [
        {
            "role": "user",
            "content": "Who is DRI?"
        },
        {
            "role": "assistant",
            "content": "DRI stands for Directly Responsible Individual of a service. Which service are you asking about?"
        },
        {
            "role": "user",
            "content": "Opinion mining service"
        }
    ]
}


And I always get this error:

"error": {
        "requestid": "4e0fa9eb-fb31-4d4a-869e-cfc3328f7374",
        "code": 400,
        "message": "An error occurred when calling Azure OpenAI: Server responded with status 400. Error message: {\n  \"error\": {\n    \"message\": \"Unsupported value: 'messages[0].role' does not support 'system' with this model.\",\n    \"type\": \"invalid_request_error\",\n    \"param\": \"messages[0].role\",\n    \"code\": \"unsupported_value\"\n  }\n}"
    }


I don't have any "role": "system" messages, so I guess it happens internally in OpenAI / AI Search.

Are there any workarounds to make this work? I know I can call directly AI Search and then send the context to Azure OpenAI, but then I miss the citations object that I am super interested in.

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
1,174 questions
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,624 questions
{count} votes

Accepted answer
  1. Vikram Singh 1,070 Reputation points Microsoft Employee
    2025-02-07T05:24:35.3766667+00:00

    Hi Art,

    Greetings!

    As you are using RAG (AI Search + Azure OpenAI) with the o1-mini model, and other models like 4o-mini work, it suggests that o1-mini has stricter message role requirements. This is a known issue, as system messages are accepted by the o1 model but not by o1-mini or o1-preview.

    Here are some workarounds you can try:

    1. Request Access to a Different Model: If possible, request access to a different model, such as o1. This would be the ideal solution.
    2. Disable AI Search’s System Message Injection: The issue seems to be caused by RAG (Azure AI Search) modifying the prompt. Try disabling AI Search augmentation and send a request without it to confirm.
    3. Manually Retrieve Data from AI Search and Send to OpenAI: Since o1-mini doesn’t allow system messages, you can manually extract and append citation data from the AI Search response. Although this approach loses automatic citations, it still provides the necessary context.

    I understand these are already known workarounds, but unfortunately, we can't do much as the restrictions are from OpenAI. Let me know if you have any other questions.

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.