everyapi
Integration · TypeScript AI agent frameworkOpenAI-compatible · one key · live model catalog
Mastra

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.

01Setup code

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

02Steps

From zero to your first call

  1. Install Mastra

    Create or update a Mastra project using its current installation guide and record the package versions in your lockfile.

  2. 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.

  3. 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.

  4. 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.