Skip to main content

OrcaRouter logoOrcaRouter

Access 117 OrcaRouter models through Mastra's model router. Authentication is handled automatically using the ORCAROUTER_API_KEY environment variable.

Learn more in the OrcaRouter documentation.

.env
ORCAROUTER_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: "orcarouter/anthropic/claude-fable-5"
});

// 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);
}
note

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

Models
Direct link to Models

ModelContextToolsReasoningImageAudioVideoInput $/1MOutput $/1M
orcarouter/anthropic/claude-fable-51.0M$10$50
orcarouter/anthropic/claude-haiku-4.5200K$1$5
orcarouter/anthropic/claude-opus-4.5200K$5$25
orcarouter/anthropic/claude-opus-4.61.0M$5$25
orcarouter/anthropic/claude-opus-4.71.0M$5$25
orcarouter/anthropic/claude-opus-4.81.0M$5$25
orcarouter/anthropic/claude-opus-51.0M$5$25
orcarouter/anthropic/claude-sonnet-4.51.0M$3$15
orcarouter/anthropic/claude-sonnet-4.61.0M$3$15
orcarouter/anthropic/claude-sonnet-51.0M$2$10
orcarouter/deepseek/deepseek-chat1.0M$0.15$0.29
orcarouter/deepseek/deepseek-reasoner1.0M$0.15$0.29
orcarouter/deepseek/deepseek-v4-flash1.0M$0.15$0.29
orcarouter/deepseek/deepseek-v4-flash-07311.0M$0.15$0.29
orcarouter/deepseek/deepseek-v4-flash-free1.0M
orcarouter/deepseek/deepseek-v4-flash-vision-exp1.0M$0.15$0.29
orcarouter/deepseek/deepseek-v4-pro1.0M$0.44$0.88
orcarouter/deepseek/deepseek-v4-pro-08131.0M$0.44$0.88
orcarouter/google/gemini-2.5-flash1.0M$0.30$3
orcarouter/google/gemini-2.5-flash-lite1.0M$0.10$0.40
orcarouter/google/gemini-2.5-pro1.0M$1$10
orcarouter/google/gemini-3-flash-preview1.0M$0.50$3
orcarouter/google/gemini-3.1-flash-lite1.0M$0.25$2
orcarouter/google/gemini-3.1-flash-lite-preview1.0M$0.25$2
orcarouter/google/gemini-3.1-pro-preview1.0M$2$12
orcarouter/google/gemini-3.1-pro-preview-customtools1.0M$2$12
orcarouter/google/gemini-3.5-flash1.0M$2$9
orcarouter/google/gemini-3.5-flash-lite1.0M$0.30$3
orcarouter/google/gemini-3.6-flash1.0M$2$8
orcarouter/google/gemini-flash-latest1.0M$0.50$3
orcarouter/google/gemini-flash-lite-latest1.0M$0.25$2
orcarouter/google/gemini-robotics-er-1.6-preview131K$1$5
orcarouter/google/gemma-4-26b-a4b-it262K$0.06$0.33
orcarouter/google/gemma-4-31b-it262K$0.13$0.38
orcarouter/grok/grok-4.31.0M$1$3
orcarouter/grok/grok-4.5500K$2$6
orcarouter/grok/grok-4.6500K$2$6
orcarouter/kimi/kimi-k2.5262K$0.60$3
orcarouter/kimi/kimi-k2.6262K$0.95$4
orcarouter/kimi/kimi-k2.7-code262K$0.95$4
orcarouter/kimi/kimi-k31.0M$3$17
orcarouter/meta/muse-spark-1.11.0M$1$4
orcarouter/meta/muse-spark-1.21.0M$1$4
orcarouter/minimax/minimax-m2.5205K$0.30$1
orcarouter/minimax/minimax-m2.5-highspeed205K$0.60$2
orcarouter/minimax/minimax-m2.7205K$0.30$1
orcarouter/minimax/minimax-m2.7-highspeed205K$0.60$2
orcarouter/minimax/minimax-m31.0M$0.30$1
orcarouter/openai/gpt-3.5-turbo16K$0.50$2
orcarouter/openai/gpt-48K$30$60
orcarouter/openai/gpt-4-turbo128K$10$30
orcarouter/openai/gpt-4.11.0M$2$8
orcarouter/openai/gpt-4.1-mini1.0M$0.40$2
orcarouter/openai/gpt-4.1-nano1.0M$0.10$0.40
orcarouter/openai/gpt-4o128K$3$10
orcarouter/openai/gpt-4o-2024-05-13128K$5$15
orcarouter/openai/gpt-4o-2024-08-06128K$3$10
orcarouter/openai/gpt-4o-2024-11-20128K$3$10
orcarouter/openai/gpt-4o-mini128K$0.15$0.60
orcarouter/openai/gpt-5400K$1$10
orcarouter/openai/gpt-5-chat-latest400K$1$10
orcarouter/openai/gpt-5-mini400K$0.25$2
orcarouter/openai/gpt-5-nano400K$0.05$0.40
orcarouter/openai/gpt-5-pro400K$15$120
orcarouter/openai/gpt-5.1400K$1$10
orcarouter/openai/gpt-5.1-chat-latest128K$1$10
orcarouter/openai/gpt-5.1-codex400K$1$10
orcarouter/openai/gpt-5.1-codex-mini400K$0.25$2
orcarouter/openai/gpt-5.2400K$2$14
orcarouter/openai/gpt-5.2-chat-latest128K$2$14
orcarouter/openai/gpt-5.2-codex400K$2$14
orcarouter/openai/gpt-5.2-pro400K$21$168
orcarouter/openai/gpt-5.3-codex400K$2$14
orcarouter/openai/gpt-5.41.1M$3$15
orcarouter/openai/gpt-5.4-mini400K$0.75$5
orcarouter/openai/gpt-5.4-nano400K$0.20$1
orcarouter/openai/gpt-5.4-pro1.1M$30$180
orcarouter/openai/gpt-5.51.1M$5$30
orcarouter/openai/gpt-5.5-pro1.1M$30$180
orcarouter/openai/gpt-5.6-luna1.1M$0.20$1
orcarouter/openai/gpt-5.6-sol1.1M$4$20
orcarouter/openai/gpt-5.6-terra1.1M$2$12
orcarouter/openai/gpt-oss-120b131K$0.03$0.17
orcarouter/orcarouter/auto128K
orcarouter/orcarouter/free66K
orcarouter/orcarouter/fusion1.0M
orcarouter/orcarouter/fusion-flash200K
orcarouter/orcarouter/fusion-mini1.0M
orcarouter/qwen/qwen3-max262K$0.36$1
orcarouter/qwen/qwen3-vl-235b-a22b-instruct131K$0.40$2
orcarouter/qwen/qwen3-vl-235b-a22b-thinking131K$0.40$4
orcarouter/qwen/qwen3.5-122b-a10b262K$0.12$0.92
orcarouter/qwen/qwen3.5-27b262K$0.09$0.69
orcarouter/qwen/qwen3.5-35b-a3b262K$0.06$0.46
orcarouter/qwen/qwen3.5-397b-a17b262K$0.17$1
orcarouter/qwen/qwen3.5-flash1.0M$0.10$0.40
orcarouter/qwen/qwen3.5-plus1.0M$0.12$0.69
orcarouter/qwen/qwen3.6-35b-a3b262K$0.25$1
orcarouter/qwen/qwen3.6-flash1.0M$0.25$2
orcarouter/qwen/qwen3.6-plus1.0M$0.50$3
orcarouter/qwen/qwen3.7-flash1.0M$0.03$0.13
orcarouter/qwen/qwen3.7-max1.0M$1$4
orcarouter/qwen/qwen3.7-plus1.0M$0.35$1
orcarouter/qwen/qwen3.8-27b262K$0.33$2
orcarouter/qwen/qwen3.8-27b-free66K
orcarouter/qwen/qwen3.8-max1.0M$2$6
orcarouter/tencent/hy3256K$0.18$0.59
orcarouter/tencent/hy3-free256K
orcarouter/z-ai/glm-4.5131K$0.60$2
orcarouter/z-ai/glm-4.5-air131K$0.20$1
orcarouter/z-ai/glm-4.6205K$0.60$2
orcarouter/z-ai/glm-4.7205K$0.60$2
orcarouter/z-ai/glm-5205K$1$3
orcarouter/z-ai/glm-5.1200K$1$4
orcarouter/z-ai/glm-5.21.0M$1$4
orcarouter/z-ai/glm-5.31.0M$1$4
orcarouter/z-ai/glm-5.3-flash1.0M$0.07$0.25
117 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.orcarouter.ai/v1",
id: "orcarouter/anthropic/claude-fable-5",
apiKey: process.env.ORCAROUTER_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
? "orcarouter/z-ai/glm-5.3-flash"
: "orcarouter/anthropic/claude-fable-5";
}
});
On this page