Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pydantic_ai_slim/pydantic_ai/models/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ class OpenAIModelSettings(ModelSettings, total=False):
See [OpenAI's safety best practices](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids) for more details.
"""

openai_service_tier: Literal['auto', 'default', 'flex']
openai_service_tier: Literal['auto', 'default', 'flex', 'priority']
"""The service tier to use for the model request.

Currently supported values are `auto`, `default`, and `flex`.
Currently supported values are `auto`, `default`, `flex`, and `priority`.
For more information, see [OpenAI's service tiers documentation](https://platform.openai.com/docs/api-reference/chat/object#chat/object-service_tier).
"""

Expand Down Expand Up @@ -803,6 +803,7 @@ async def _responses_create(
top_p=sampling_settings.get('top_p', NOT_GIVEN),
truncation=model_settings.get('openai_truncation', NOT_GIVEN),
timeout=model_settings.get('timeout', NOT_GIVEN),
service_tier=model_settings.get('openai_service_tier', NOT_GIVEN),
reasoning=reasoning,
user=model_settings.get('openai_user', NOT_GIVEN),
text=text or NOT_GIVEN,
Expand Down