How do I fix the ''Model {modelName} is enabled only for api versions 2024-12-01-preview and later" Error for o3-mini model in AzureAI?

Mason 25 Reputation points
2025-05-08T13:13:32.5466667+00:00

We are getting the following error when trying to use the o3-mini in a prompt flow:

'Error Code 400 - {'error': {'code': 'BadRequest','message': 'Model {modelName} is enabled only for api version2024-12-01-preview and later'}}

When I make a call to the same o3-mini deployment in python, it is a success (using api version 2024-12-02-preview).

 I tried the adding an environment variable into the flow.dag.yaml file for the api version as stated here (Wrong API version for Azure OpenAI o3-mini · Issue #1121 · microsoft/genaiscript) with no effect.

The promptflow works when the model is gpt-4o (another deployment).

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

2 answers

Sort by: Most helpful
  1. SriLakshmi C 5,365 Reputation points Microsoft External Staff Moderator
    2025-05-08T16:45:53.2066667+00:00

    Hi @Mason,

    Could you please review the JSONL file for any unsupported parameters and share the findings in a private message if possible?

    However, since the o3-mini model requires API version 2024-12-01-preview or later, issues may arise if Prompt Flow is using an earlier API version by default. This is likely the cause of the error you're encountering.

    As a workaround, you can use the default JSONL format with a model that is already confirmed to work within your environment (e.g., gpt-4o).

    {"custom_id": "task-0", "method": "POST", "url": "/chat/completions", "body": {"model": "REPLACE-WITH-MODEL-DEPLOYMENT-NAME", "messages": [{"role": "system", "content": "You are an AI assistant that helps people find information."}, {"role": "user", "content": "When was Microsoft founded?"}]}}
    {"custom_id": "task-1", "method": "POST", "url": "/chat/completions", "body": {"model": "REPLACE-WITH-MODEL-DEPLOYMENT-NAME", "messages": [{"role": "system", "content": "You are an AI assistant that helps people find information."}, {"role": "user", "content": "When was the first XBOX released?"}]}}
    {"custom_id": "task-2", "method": "POST", "url": "/chat/completions", "body": {"model": "REPLACE-WITH-MODEL-DEPLOYMENT-NAME", "messages": [{"role": "system", "content": "You are an AI assistant that helps people find information."}, {"role": "user", "content": "What is Altair Basic?"}]}}
    

    Kindly refer this Preparing your batch file.

    Also, this is the reference thread for similar issue https://learn.microsoft.com/en-us/answers/questions/2260401/azure-batch-openai-not-working-with-o3-mini-bad-re

    I Hope this helps. Do let me know if you have any further queries.


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

    Thank you!

    0 comments No comments

  2. MikeM 0 Reputation points
    2025-05-22T04:27:43.6466667+00:00

    I'm unsure of best practice, but if it helps anyone I've worked around this problem in the Azure AI .net sdk by passing an AzureOpenAIClientOptions object to the AzureOpenAIClient constructor, and specifying the ServiceVersion value. Without this, the api calls were defaulting to use ServiceVersion.V2024_10_21.

    As of right this moment you'll probably need to install a pre-release build of the Azure.AI.OpenAI package. The current latest one I can see is ServiceVersion.V2025_03_01_Preview from the 2.2.0-beta.4 build (latest stable build of 2.1.0 doesn't have it).

    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.