Do you use Pydantic to validate your data?

You can use the Requesty router to access any LLM, and get cost management, monitoring and fallbacks out-of-the-box.

Here’s an example script:

from pydantic_ai import Agent
from pydantic_ai.models.openai import OpenAIModel
from os import getenv
from dotenv import load_dotenv

load_dotenv()

model = OpenAIModel(
    "openai/gpt-4o",
    base_url=getenv("REQUESTY_BASE_URL"),
    api_key=getenv("REQUESTY_API_KEY"),
)

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())```