Skip to content
Changelog

Use the Responses API with Azure OpenAI deployments

September 16, 20261 min read

Agno's AzureOpenAIResponses points the AzureOpenAI client at your AZURE_OPENAI_ENDPOINT and gives your deployment the tools, structured output, streaming and background responses of OpenAIResponses. Until now, Agno's AzureOpenAI model gave Azure users Chat Completions only.

from agno.agent import Agent
from agno.models.azure import AzureOpenAIResponses
 
agent = Agent(
    model=AzureOpenAIResponses(id="gpt-5.6-luna"),  # your Azure deployment name
    markdown=True,
)
agent.print_response("Explain why regression tests matter in one paragraph.")

Set id to your Azure deployment name. Azure's Responses endpoint reads the deployment from the request body, and AzureOpenAIResponses sends your id there unchanged. The model raises a ValueError at startup if id is missing.

OpenAIResponses and AzureOpenAIResponses side by side. OpenAIResponses takes a model name as its id, uses the OpenAI client and signs in with an OpenAI API key. AzureOpenAIResponses takes your Azure deployment name as its id, uses the AzureOpenAI client at your AZURE_OPENAI_ENDPOINT and signs in with an Azure API key or Entra ID. Both share tools, structured output, streaming and background responses.

AzureOpenAIResponses reads its connection from the environment when you don't pass it:

SettingEnvironment variableDefault
api_keyAZURE_OPENAI_API_KEYNone
azure_endpointAZURE_OPENAI_ENDPOINTNone
api_versionOPENAI_API_VERSION2025-04-01-preview
azure_ad_tokenAZURE_OPENAI_AD_TOKENNone

For Entra ID, pass azure_ad_token_provider or azure_ad_token. AzureOpenAIResponses uses one authentication method at a time, so an Entra ID credential never gets mixed with an API key from your environment.

Deployment names are yours to choose, so Agno can't always tell a reasoning model from its name. If your deployment serves a reasoning model and its name doesn't start with the model name, set is_reasoning_model=True.

See the cookbook, and learn more about Azure OpenAI and the OpenAI Responses model in the documentation.

Frequently asked questions

Use AzureOpenAIResponses from agno.models.azure and set id to your Azure deployment name. Set AZURE_OPENAI_API_KEY and AZURE_OPENAI_ENDPOINT, or pass them to the model. See the cookbook.

The id is your Azure deployment name, which Azure's Responses endpoint reads from the request body. AzureOpenAIResponses raises a ValueError at startup if you leave it unset.

AzureOpenAIResponses uses the api_version you pass, then the OPENAI_API_VERSION environment variable, then 2025-04-01-preview.

Yes. Pass azure_ad_token_provider or azure_ad_token, or set AZURE_OPENAI_AD_TOKEN. Agno uses one authentication method at a time and never mixes an Entra ID credential with an API key from the environment.

Shipped around the same time