EmpirioLabs 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.
ModelsDirect link to Models
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|---|---|---|---|---|---|---|---|---|
empiriolabs/deepseek-v4-flash | 1.0M | $0.14 | $0.28 | |||||
empiriolabs/deepseek-v4-pro | 1.0M | $2 | $3 | |||||
empiriolabs/fugu-ultra | 1.0M | $8 | $45 | |||||
empiriolabs/gemma-4-26b-a4b | 262K | $0.05 | $0.29 | |||||
empiriolabs/glm-4-5-flash | 200K | — | — | |||||
empiriolabs/glm-4-7-flash | 200K | — | — | |||||
empiriolabs/glm-5-1 | 202K | $0.82 | $3 | |||||
empiriolabs/glm-5-2 | 1.0M | $1 | $4 | |||||
empiriolabs/kimi-k2-6 | 256K | $0.89 | $4 | |||||
empiriolabs/kimi-k2-7-code | 256K | $0.95 | $4 | |||||
empiriolabs/kimi-k2-7-code-highspeed | 256K | $2 | $8 | |||||
empiriolabs/mimo-v2-5 | 1.0M | $0.70 | $1 | |||||
empiriolabs/mimo-v2-5-pro | 1.0M | $2 | $4 | |||||
empiriolabs/minimax-m2-7 | 200K | $0.15 | $0.60 | |||||
empiriolabs/minimax-m2-7-highspeed | 200K | $0.30 | $1 | |||||
empiriolabs/minimax-m3 | 1.0M | $0.23 | $0.90 | |||||
empiriolabs/muse-spark-1-1 | 1.0M | $1 | $4 | |||||
empiriolabs/qwen3-5-122b-a10b | 256K | $0.12 | $0.92 | |||||
empiriolabs/qwen3-5-27b | 256K | $0.09 | $0.69 | |||||
empiriolabs/qwen3-5-35b-a3b | 256K | $0.06 | $0.46 | |||||
empiriolabs/qwen3-5-397b-a17b | 256K | $0.17 | $1 | |||||
empiriolabs/qwen3-5-4b | 262K | $0.04 | $0.07 | |||||
empiriolabs/qwen3-5-9b | 262K | $0.09 | $0.13 | |||||
empiriolabs/qwen3-5-plus | 1.0M | $0.36 | $2 | |||||
empiriolabs/qwen3-6-27b | 256K | $0.41 | $2 | |||||
empiriolabs/qwen3-6-flash | 1.0M | $0.25 | $2 | |||||
empiriolabs/qwen3-6-max-preview | 256K | $1 | $8 | |||||
empiriolabs/qwen3-6-plus | 1.0M | $0.50 | $3 | |||||
empiriolabs/qwen3-7-max | 1.0M | $3 | $8 | |||||
empiriolabs/qwen3-7-plus | 1.0M | $0.40 | $2 | |||||
empiriolabs/qwen3-max | 256K | $1 | $6 | |||||
empiriolabs/step-3-5-flash | 256K | $0.10 | $0.30 | |||||
empiriolabs/step-3-5-flash-2603 | 256K | $0.10 | $0.30 | |||||
empiriolabs/step-3-7-flash | 256K | $0.20 | $1 |
Advanced configurationDirect link to Advanced configuration
Custom headersDirect 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 selectionDirect 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";
}
});