Change the model parameter to any model, and you’re done!(Yes, you can use Anthropic or any other model without changing anything but the model parameter)
Copy
from pydantic_ai import Agentfrom pydantic_ai.models.openai import OpenAIModelmodel = OpenAIModel( "anthropic/claude-sonnet-4-20250514",)agent = Agent(model)async def main(): response = await agent.run("What should I build with Requesty router, now that I have access to 150+ LLMs?") print(response)if __name__ == "__main__": import asyncio asyncio.run(main())