Run the EveryAPI gateway inside Mastra
Mastra is a TypeScript framework for agents and workflows. Use the model-provider interface documented by your Mastra release to connect an OpenAI-compatible provider to EveryAPI, then test each model-dependent feature.
One base URL line points Mastra at EveryAPI
Default global Base URL / China-first Base URL: https://api.everyapi.ai/v1 / https://api-cn.everyapi.ai/v1
From zero to your first call
- Install Mastra
Create or update a Mastra project using its current installation guide and record the package versions in your lockfile.
- Point createOpenAI at EveryAPI
Create an OpenAI-compatible provider using the API supported by your installed AI SDK and Mastra versions, with the EveryAPI base URL and key.
- Pass the provider instance to the Agent
Pass a model from that provider to an agent, using an ID available in your EveryAPI account catalog.
- Test the features your workflow uses
Agent, workflow, memory, RAG, structured-output, and tool behavior can depend on separate services, package versions, and model capabilities. Verify each path rather than assuming that changing the provider is transparent.
