## The problem
Issue pydantic/pydantic-ai#774 (closed, 23 comments): ## OpenAI API Timeout Error in pydantic-ai Agent ### Problem Description When using the OpenAI model with the pydantic-ai Agent, a persistent `APITimeoutError` is encountered during API requests, despite having a valid and current API key. ### Environment - Library: pydantic-ai - Model Attempted: OpenAI (gpt-4o) - API Key Status: Valid and current ### Code ``` from pydantic_ai import Agent from pydantic_ai.models.openai import OpenAIModel from pydantic_ai.models.gemini import GeminiModel from pydantic_ai.models.anthropic import AnthropicModel from dotenv import load_dotenv import os...

## What fixed it
Raise the model timeout. The default is too short for slow OpenAI responses:

from pydantic_ai import Agent
from pydantic_ai.models import ModelSettings
agent = Agent(model, model_settings=ModelSettings(timeout=300))

Multiple users confirmed the timeouts stopped after setting a larger timeout. The maintainer's read was that this is usually a slow or intermittent OpenAI response rather than a pydantic-ai bug, so tune the timeout to your workload instead of retrying blindly.