Azure OpenAI Chat Model throwing 'API version not supported'

Hey guys,

we’re hosting models on azure (their foundry), but it seems like we can’t use these as ‘chat models’ in the AI agent node.

I tried multiple different models (deepseek, models from OpenAI..) but is always throws the same error.

“API version not supported”.

i think it has to do with the fact that these models send chat completion type of payload, instead of using the current standard of Response API payload.

any idea how to fix this?

Or how to actually use models hosted on azure foundry in n8n agent node?

thanks!

@Adam_Luka its not the payload, its the API Version field in your Azure OpenAI credential, that error means the value set there isnt supported for your resource. set it to a current supported api-version (microsofts azure openai api-version-deprecation page lists which are live vs retired). one caveat, the Azure OpenAI node only targets OpenAI deployments, non-openai foundry models like deepseek go through the Azure AI inference endpoint, not this node.

I tried multiple API versions in my credentials, but nothing seems to be working.

it has to do with the fact that the AI agent node is tied to the Chat completions payload, instead of the response API.

Seems like n8n is just behind in this regard.

@Adam_Luka

Can you turn this off in chat model?

image

@Adam_Luka correcting myself, it IS reachable, just not through the Azure OpenAI node, use the OpenAI Chat Model node with the credentials Base URL set to your foundry openai-compatible endpoint (https://{your-project}.services.ai.azure.com/openai/v1) plus your foundry api key. the Azure OpenAI node stays locked to the classic .openai.azure.com chat-completions surface, which is why it rejected every api-version you tried.

@Adam_Luka

There was a reported regression in n8n versions around 2.20.0 where the Azure node began forcing the /responses endpoint without a toggle to switch back. If you recently updated and things broke, some users have found stability by pinning their Docker image back to n8nio/n8n:2.19.5 until a formal “Use Responses API” toggle is added to the Azure node.

Can you try this?

Welcome @Adam_Luka!

The core issue is that the Azure OpenAI Chat Model node in n8n is hardcoded to use the Azure OpenAI inference path (/openai/deployments/{deployment}/chat/completions), which only works for OpenAI-hosted models on Azure. Non-OpenAI models deployed via Azure AI Foundry (like DeepSeek) use a different endpoint format entirely.

For those models, the easiest path is to use the OpenAI Chat Model node (not the Azure one) and point it at the Azure AI Foundry inference endpoint directly - the endpoint looks like https://{your-project}.services.ai.azure.com/models and accepts an API key. In the credential, set the Base URL to that endpoint and use your Azure AI Foundry API key. The model name should match the deployment name in Foundry.

If you want to stay on the Azure OpenAI node, it will only work correctly for OpenAI-published models (GPT-4o, etc.) deployed to Azure OpenAI Service, not Azure AI Foundry.

hey @nguyenthieutoan ,

Thanks for pointing me in the right direction!

For anyone facing the same issue, the solution is very close to what was shared above, but with a few minute changes:

  1. Use the OpenAI Chat Model node
  2. When setting up the credentials, use the following:
    1. Api key - Your Foundry API key
    2. But the Base URL is slightly different, it’s not /models but: https://{your-project}.services.ai.azure.com/openai/v1
  3. Then you can choose which model you want to use

Thanks again, guys!