Mastra is a TypeScript agent framework. Use the @ai-sdk/openai provider with the AIgateway base URL and every model in our catalog becomes a Mastra-compatible agent brain.
Create an AIgateway-scoped provider with createOpenAI (passing baseURL as the second arg of openai() is model-settings and gets ignored — it would hit real OpenAI). Then hand its model to Mastra's Agent.