Skip to main content
Use Mastra against the Modellix LLM gateway. Mastra is not a built-in Modellix provider β€” configure a custom OpenAI-compatible endpoint with url set to https://llm.modellix.ai/v1, or pass a Vercel AI SDK provider instance as model.
This page covers LLM text only (https://llm.modellix.ai).Modellix expects full provider/name Model IDs in the request body (for example openai/gpt-5.5). Treat Modellix as a gateway: use a three-part id (modellix/<provider>/<name>) so Mastra forwards openai/gpt-5.5 upstream. See Models & Pricing.

Set Up Mastra

1

Install Mastra

Follow the Mastra getting started flow for your app, or add the core package to an existing TypeScript project:
For the AI SDK provider path below, also install:
2

Set Credentials

Create a Modellix API key in the console:
Do not set url to a full /chat/completions path β€” use the /v1 base only. Do not point Mastra at the media host (https://api.modellix.ai). A plain string like model: "openai/gpt-5.5" routes to OpenAI’s built-in provider, not Modellix.
3

Configure a Custom OpenAI-Compatible Model (Recommended)

Pass an object to model with id, url, and apiKey:
Other catalog examples:Traffic still uses Chat Completions on https://llm.modellix.ai/v1.
4

Optional: Use createOpenAICompatible

Mastra accepts AI SDK language models anywhere a "provider/model" string works:
Same pattern as the Vercel AI SDK guide. You can also put this model in Mastra fallback chains.
5

Optional: Fallbacks Across Catalog IDs

Keep several Modellix models on the same gateway URL:

Troubleshooting