Skip to main content

EmpirioLabs AI logoEmpirioLabs AI

Access 34 EmpirioLabs AI models through Mastra's model router. Authentication is handled automatically using the EMPIRIOLABS_API_KEY environment variable.

Learn more in the EmpirioLabs AI documentation.

.env
EMPIRIOLABS_API_KEY=your-api-key
src/mastra/agents/my-agent.ts
import { Agent } from "@mastra/core/agent";

const agent = new Agent({
id: "my-agent",
name: "My Agent",
instructions: "You are a helpful assistant",
model: "empiriolabs/deepseek-v4-flash"
});

// Generate a response
const response = await agent.generate("Hello!");

// Stream a response
const stream = await agent.stream("Tell me a story");
for await (const chunk of stream) {
console.log(chunk);
}
info

Mastra uses the OpenAI-compatible /chat/completions endpoint. Some provider-specific features may not be available. Check the EmpirioLabs AI documentation for details.

Models
Direct link to Models

ModelContextToolsReasoningImageAudioVideoInput $/1MOutput $/1M
empiriolabs/deepseek-v4-flash1.0M$0.14$0.28
empiriolabs/deepseek-v4-pro1.0M$2$3
empiriolabs/fugu-ultra1.0M$8$45
empiriolabs/gemma-4-26b-a4b262K$0.05$0.29
empiriolabs/glm-4-5-flash200K——
empiriolabs/glm-4-7-flash200K——
empiriolabs/glm-5-1202K$0.82$3
empiriolabs/glm-5-21.0M$1$4
empiriolabs/kimi-k2-6256K$0.89$4
empiriolabs/kimi-k2-7-code256K$0.95$4
empiriolabs/kimi-k2-7-code-highspeed256K$2$8
empiriolabs/mimo-v2-51.0M$0.70$1
empiriolabs/mimo-v2-5-pro1.0M$2$4
empiriolabs/minimax-m2-7200K$0.15$0.60
empiriolabs/minimax-m2-7-highspeed200K$0.30$1
empiriolabs/minimax-m31.0M$0.23$0.90
empiriolabs/muse-spark-1-11.0M$1$4
empiriolabs/qwen3-5-122b-a10b256K$0.12$0.92
empiriolabs/qwen3-5-27b256K$0.09$0.69
empiriolabs/qwen3-5-35b-a3b256K$0.06$0.46
empiriolabs/qwen3-5-397b-a17b256K$0.17$1
empiriolabs/qwen3-5-4b262K$0.04$0.07
empiriolabs/qwen3-5-9b262K$0.09$0.13
empiriolabs/qwen3-5-plus1.0M$0.36$2
empiriolabs/qwen3-6-27b256K$0.41$2
empiriolabs/qwen3-6-flash1.0M$0.25$2
empiriolabs/qwen3-6-max-preview256K$1$8
empiriolabs/qwen3-6-plus1.0M$0.50$3
empiriolabs/qwen3-7-max1.0M$3$8
empiriolabs/qwen3-7-plus1.0M$0.40$2
empiriolabs/qwen3-max256K$1$6
empiriolabs/step-3-5-flash256K$0.10$0.30
empiriolabs/step-3-5-flash-2603256K$0.10$0.30
empiriolabs/step-3-7-flash256K$0.20$1
34 available models

Advanced configuration
Direct link to Advanced configuration

Custom headers
Direct link to Custom headers

src/mastra/agents/my-agent.ts
const agent = new Agent({
id: "custom-agent",
name: "custom-agent",
model: {
url: "https://api.empiriolabs.ai/v1",
id: "empiriolabs/deepseek-v4-flash",
apiKey: process.env.EMPIRIOLABS_API_KEY,
headers: {
"X-Custom-Header": "value"
}
}
});

Dynamic model selection
Direct link to Dynamic model selection

src/mastra/agents/my-agent.ts
const agent = new Agent({
id: "dynamic-agent",
name: "Dynamic Agent",
model: ({ requestContext }) => {
const useAdvanced = requestContext.task === "complex";
return useAdvanced
? "empiriolabs/step-3-7-flash"
: "empiriolabs/deepseek-v4-flash";
}
});
On this page