-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Initial Checks
- I confirm that I'm using the latest version of Pydantic AI
- I confirm that I searched for my issue in https://github.com/pydantic/pydantic-ai/issues before opening this issue
Description
when running gpt-5 through Azure you get the following error
ModelHTTPError: status_code: 400, model_name: gpt-5, body: {'message': 'Encrypted content is not supported with this model.', 'type': 'invalid_request_error', 'param': 'include', 'code': None}
Example Code
import os
from openai import AsyncAzureOpenAI
from pydantic import BaseModel
from pydantic_ai import Agent, NativeOutput
from pydantic_ai.models.openai import OpenAIResponsesModel
from pydantic_ai.providers.openai import OpenAIProvider
class CalendarEvent(BaseModel):
name: str
date: str
participants: list[str]
client = AsyncAzureOpenAI(
azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
api_version=os.environ["OPENAI_API_VERSION"],
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
)
model = OpenAIResponsesModel(
model_name="gpt-5",
provider=OpenAIProvider(openai_client=client),
)
agent = Agent(
model=model,
tools=[],
system_prompt="Extract the event information.",
output_type=NativeOutput(CalendarEvent),
)
result = await agent.run(
[
"Alice and Bob are going to a science fair on Friday.",
]
)Python, Pydantic AI & LLM client version
python -V
Python 3.13.7
import pydantic_ai
pydantic_ai.__version__
'1.0.2'
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working