Repository: promptfoo/promptfoo
Issue: [ERROR] API response error: unsupported_parameter Unsupported parameter: 'max_tokens' is not supported with this model.  │ │ Use 'max_completion_tokens' instead.
Root cause: Configuration Error

**Describe the bug**

**Even after setting up the parameter, i am getting this error: [ERROR] API response error: unsupported_parameter Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.**

My code:
```
- id: azure:chat:gpt-5-mini
    label: azure-chat-gpt-5-mini
    config:
      apiHost: '{{ env.AZURE_OPENAI_ENDPOINT }}'
      apiVersion: '2025-04-01-preview'
      max_completion_tokens: 400
```


**Expected behavior**
It should run without any errors

**System information:**
I am using macOS

If possible, please output the results of `promptfoo debug` and paste the output here.

{
  "version": "0.119.4",
  "platform": {
    "os": "darwin",
    "release": "24.6.0",
    "arch": "x64",
    "nodeVersion": "v24.11.0"
  },
  "env": {
    "telemetryDisabled": false,
    "telemetryDebug": false
  },
  "configInfo": {
    "defaultConfigPath": "/Users/apple/Desktop/promptfoo-demo/promptfooconfig.yaml",
    "configExists": true,
    "configContent": {
      "config": {
        "tags": {},
        "description": "Intent classification baseline",
        "prompts": [
          "file:///Users/apple/Desktop/promptfoo-demo/prompts/intent-classifier.json"
        ],
        "providers": [
          {
            "id": "azure:chat:gpt-5-mini",
            "label": "azure-chat-gpt-5-mini",
            "config": {
              "apiHost": "{{ env.AZURE_OPENAI_ENDPOINT }}",
              "apiVersion": "2025-04-01-preview",
              "max_completion_tokens": 400
            }
          }
        ],
        "tests": [
          "file://evals/service-intent.yaml"
        ],
        "scenarios": [],
        "env": {
          "file": ".env"
        },
        "sharing": false,
        "outputPath": [],
        "extensions": [],
        "metadata": {},
        "evaluateOptions": {}
      },
      "testSuite": {
        "description": "Intent classification baseline",
        "tags": {},
        "prompts": [
          {
            "raw": "[{\"role\":\"system\",\"content\":\"You are an intent classifier for a voice bot. Available intents: {wrong_number, service_inquiry}. Analyze the full conversation context and return ONLY a JSON object with 'intent' (one of the listed intents) and 'confidence' (0.0-1.0). Format: {\\\"intent\\\": \\\"intent_name\\\", \\\"confidence\\\": 0.9}\"},{\"role\":\"user\",\"content\":\"assistant:Mein Asha bol rahi hu bajaj KTM service team se. Kya mein Bablu ji se baat kar rahi hu? user:Haan ji boliye. assistant:Kya aapke paas do minute hai baat karne ke liye?\"}]",
            "label": "/Users/apple/Desktop/promptfoo-demo/prompts/intent-classifier.json: [{\"role\":\"system\",\"content\":\"You are an intent classifier for a voice bot. Available intents: {wrong_number, service_inquiry}. Analyze the full conversation context and return ONLY a JSON object with 'intent' (one of the listed intents) and 'confidence' (0.0-1.0). Format: {\\\"intent\\\": \\\"intent_name\\\", \\\"confidence\\\": 0.9}\"},{\"role\":\"user\",\"content\":\"assistant:Mein Asha bol rahi hu bajaj KTM service team se. Kya mein Bablu ji se baat kar rahi hu? user:Haan ji boliye. assistant:Kya aapke paas do minute hai baat karne ke liye?\"}]"
          }
        ],
        "providers": [
          {
            "initializationPromise": {},
            "env": {
              "file": ".env"
            },
            "deploymentName": "gpt-5-mini",
            "apiHost": "https://elisaopenai.openai.azure.com/",
            "config": {
              "apiHost": "https://elisaopenai.openai.azure.com/",
              "apiVersion": "2025-04-01-preview",
              "max_completion_tokens": 400,
              "basePath": "/Users/apple/Desktop/promptfoo-demo"
            },
            "mcpClient": null,
            "functionCallbackHandler": {
              "loadedCallbacks": {},
              "mcpToolNames": null
            },
            "authHeaders": {
              "api-key": "DmJrXEQC3u55p3fUraXQ5K4pru6EGCJW********QQJ99ALAC77bzf"
            },
            "label": "azure-chat-gpt-5-mini"
          }
        ],
        "providerPromptMap": {
          "azure:chat:gpt-5-mini": [
            "/Users/apple/Desktop/promptfoo-demo/prompts/intent-classifier.json: [{\"role\":\"system\",\"content\":\"You are an intent classifier for a voice bot. Available intents: {wrong_number, service_inquiry}. Analyze the full conversation context and return ONLY a JSON object with 'intent' (one of the listed intents) and 'confidence' (0.0-1.0). Format: {\\\"intent\\\": \\\"intent_name\\\", \\\"confidence\\\": 0.9}\"},{\"role\":\"user\",\"content\":\"assistant:Mein Asha bol rahi hu bajaj KTM service team se. Kya mein Bablu ji se baat kar rahi hu? user:Haan ji boliye. assistant:Kya aapke paas do minute hai baat karne ke liye?\"}]"
          ],
          "azure-chat-gpt-5-mini": [
            "/Users/apple/Desktop/promptfoo-demo/prompts/intent-classifier.json: [{\"role\":\"system\",\"content\":\"You are an intent classifier for a voice bot. Available intents: {wrong_number, service_inquiry}. Analyze the full conversation context and return ONLY a JSON object with 'intent' (one of the listed intents) and 'confidence' (0.0-1.0). Format: {\\\"intent\\\": \\\"intent_name\\\", \\\"confidence\\\": 0.9}\"},{\"role\":\"user\",\"content\":\"assistant:Mein Asha bol rahi hu bajaj KTM service team se. Kya mein Bablu ji se baat kar rahi hu? user:Haan ji boliye. assistant:Kya aapke paas do minute hai baat karne ke liye?\"}]"
          ]
        },
        "tests": [
          {
            "description": "Service inquiry intent classification",
            "vars": {},
            "assert": [
              {
                "type": "equals",
                "value": "{\"intent\": \"service_inquiry\", \"confidence\": \"0.9\"}"
              }
            ]
          }
        ],
        "scenarios": [],
        "defaultTest": {
          "metadata": {},
          "options": {}
        },
        "nunjucksFilters": {},
        "extensions": []
      },
      "basePath": "/Users/apple/Desktop/promptfoo-demo",
      "commandLineOptions": {}
    }
  }
}

- Promptfoo version: latest

**Additional context**
Add any other context about the problem here.


Can you try setting `isReasoningModel: true` in the config object and let
me know if that works?

On Mon, Nov 10, 2025 at 4:56 AM Kirtiraj Jain ***@***.***>
wrote:

> *mrkirthi-24* created an issue (promptfoo/promptfoo#6153)
> <https://github.com/promptfoo/promptfoo/issues/6153>
>
> *Describe the bug*
>
> *Even after setting up the parameter, i am getting this error: [ERROR] API
> response error: unsupported_parameter Unsupported parameter: 'max_tokens'
> is not supported with this model. Use 'max_completion_tokens' instead.*
>
> My code:
>
> - id: azure:chat:gpt-5-mini
>     label: azure-chat-gpt-5-mini
>     config:
>       apiHost: '{{ env.AZURE_OPENAI_ENDPOINT }}'
>       apiVersion: '2025-04-01-preview'
>       max_completion_tokens: 400
>
> *Expected behavior*
> It should run without any errors
>
> *System information:*
> I am using macOS
>
> If possible, please output the results of promptfoo debug and paste the
> output here.
>
> {
> "version": "0.119.4",
> "platform": {
> "os": "darwin",
> "release": "24.6.0",
> "arch": "x64",
> "nodeVersion": "v24.11.0"
> },
> "env": {
> "telemetryDisabled": false,
> "telemetryDebug": false
> },
> "configInfo": {
> "defaultConfigPath":
> "/Users/apple/Desktop/promptfoo-demo/promptfooconfig.yaml",
> "configExists": true,
> "configContent": {
> "config": {
> "tags": {},
> "description": "Intent classification baseline",
> "prompts": [
> "file:///Users/apple/Desktop/promptfoo-demo/prompts/intent-classifier.json"
> ],
> "providers": [
> {
> "id": "azure:chat:gpt-5-mini",
> "label": "azure-chat-gpt-5-mini",
> "config": {
> "apiHost": "{{ env.AZURE_OPENAI_ENDPOINT }}",
> "apiVersion": "2025-04-01-preview",
> "max_completion_tokens": 400
> }
> }
> ],
> "tests": [
> "file://evals/service-intent.yaml"
> ],
> "scenarios": [],
> "env": {
> "file": ".env"
> },
> "sharing": false,
> "outputPath": [],
> "extensions": [],
> "metadata": {},
> "evaluateOptions": {}
> },
> "testSuite": {
> "description": "Intent classification baseline",
> "tags": {},
> "prompts": [
> {
> "raw": "[{"role":"system","content":"You are an intent classifier for a
> voice bot. Available intents: {wrong_number, service_inquiry}. Analyze the
> full conversation context and return ONLY a JSON object with 'intent' (one
> of the listed intents) and 'confidence' (0.0-1.0). Format: {\"intent\":
> \"intent_name\", \"confidence\":
> 0.9}"},{"role":"user","content":"assistant:Mein Asha bol rahi hu bajaj KTM
> service team se. Kya mein Bablu ji se baat kar rahi hu? user:Haan ji
> boliye. assistant:Kya aapke paas do minute hai baat karne ke liye?"}]",
> "label":
> "/Users/apple/Desktop/promptfoo-demo/prompts/intent-classifier.json:
> [{"role":"system","content":"You are an intent classifier for a voice bot.
> Available intents: {wrong_number, service_inquiry}. Analyze the full
> conversation context and return ONLY a JSON object with 'intent' (one of
> the listed intents) and 'confidence' (0.0-1.0). Format: {\"intent\":
> \"intent_name\", \"confidence\":
> 0.9}"},{"role":"user","content":"assistant:Mein Asha bol rahi hu bajaj KTM
> service team se. Kya mein Bablu ji se baat kar rahi hu? user:Haan ji
> boliye. assistant:Kya aapke paas do minute hai baat karne ke liye?"}]"
> }
> ],
> "providers": [
> {
> "initializationPromise": {},
> "env": {
> "file": ".env"
> },
> "deploymentName": "gpt-5-mini",
> "apiHost": "https://elisaopenai.openai.azure.com/",
> "config": {
> "apiHost": "https://elisaopenai.openai.azure.com/",
> "apiVersion": "2025-04-01-preview",
> "max_completion_tokens": 400,
> "basePath": "/Users/apple/Desktop/promptfoo-demo"
> },
> "mcpClient": null,
> "functionCallbackHandler": {
> "loadedCallbacks": {},
> "mcpToolNames": null
> },
> "authHeaders": {
> "api-key": "DmJrXEQC3u55p3fUraXQ5K4pru6EGCJW********QQJ99ALAC77bzf"
> },
> "label": "azure-chat-gpt-5-mini"
> }
> ],
> "providerPromptMap": {
> "azure:chat:gpt-5-mini": [
> "/Users/apple/Desktop/promptfoo-demo/prompts/intent-classifier.json:
> [{"role":"system","content":"You are an intent classifier for a voice bot.
> Available intents: {wrong_number, service_inquiry}. Analyze the full
> conversation context and return ONLY a JSON object with 'intent' (one of
> the listed intents) and 'confidence' (0.0-1.0). Format: {\"intent\":
> \"intent_name\", \"confidence\":
> 0.9}"},{"role":"user","content":"assistant:Mein Asha bol rahi hu bajaj KTM
> service team se. Kya mein Bablu ji se baat kar rahi hu? user:Haan ji
> boliye. assistant:Kya aapke paas do minute hai baat karne ke liye?"}]"
> ],
> "azure-chat-gpt-5-mini": [
> "/Users/apple/Desktop/promptfoo-demo/prompts/intent-classifier.json:
> [{"role":"system","content":"You are an intent classifier for a voice bot.
> Available intents: {wrong_number, service_inquiry}. Analyze the full
> conversation context and return ONLY a JSON object with 'intent' (one of
> the listed intents) and 'confidence' (0.0-1.0). Format: {\"intent\":
> \"intent_name\", \"confidence\":
> 0.9}"},{"role":"user","content":"assistant:Mein Asha bol rahi hu bajaj KTM
> service team se. Kya mein Bablu ji se baat kar rahi hu? user:Haan ji
> boliye. assistant:Kya aapke paas do minute hai baat karne ke liye?"}]"
> ]
> },
> "tests": [
> {
> "description": "Service inquiry intent classification",
> "vars": {},
> "assert": [
> {
> "type": "equals",
> "value": "{"intent": "service_inquiry", "confidence": "0.9"}"
> }
> ]
> }
> ],
> "scenarios": [],
> "defaultTest": {
> "metadata": {},
> "options": {}
> },
> "nunjucksFilters": {},
> "extensions": []
> },
> "basePath": "/Users/apple/Desktop/promptfoo-demo",
> "commandLineOptions": {}
> }
> }
> }
>
>    - Promptfoo version: latest
>
> *Additional context*
> Add any other context about the problem here.
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/promptfoo/promptfoo/issues/6153>, or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AACLYJRRJ7ZTZQ6MKQOEO4334CDRTAVCNFSM6AAAAACLVAXT46VHI2DSMVQWIX3LMV43ASLTON2WKOZTGYYDOOJTHA3TIMA>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>