Docs / Frameworks & integrations

Mastra

TypeScript agent framework; configure an OpenAI-compatible provider with the gateway base URL.

Install

Add the package to your project:

bash
npm install @mastra/core @ai-sdk/openai

Configure

Point the client at the gateway base URL with your key:

TypeScript
import { Agent } from "@mastra/core/agent";
import { createOpenAI } from "@ai-sdk/openai";

const jackz = createOpenAI({
  baseURL: "https://api.jackz.ai/v1",
  apiKey: process.env.JACKZ_API_KEY,
});

export const agent = new Agent({
  name: "assistant",
  instructions: "You are helpful.",
  model: jackz("x-ai/grok-4.6"),
});

Notes

Any model slug from the catalog works. Refer to the tool's own documentation for advanced configuration.

Official docs: mastra.ai ↗