Skip to main content

Ofox logoOfox

Access 107 Ofox models through Mastra's model router. Authentication is handled automatically using the OFOX_API_KEY environment variable.

Learn more in the Ofox documentation.

.env
OFOX_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: "ofox/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 Ofox documentation for details.

Models
Direct link to Models

ModelContextToolsReasoningImageAudioVideoInput $/1MOutput $/1M
ofox/anthropic/claude-fable-51.0M$10$50
ofox/anthropic/claude-haiku-4.5200K$1$5
ofox/anthropic/claude-opus-4.5200K$5$25
ofox/anthropic/claude-opus-4.61.0M$5$25
ofox/anthropic/claude-opus-4.71.0M$5$25
ofox/anthropic/claude-opus-4.81.0M$5$25
ofox/anthropic/claude-opus-51.0M$5$25
ofox/anthropic/claude-sonnet-4.5200K$3$15
ofox/anthropic/claude-sonnet-4.61.0M$3$15
ofox/anthropic/claude-sonnet-51.0M$2$10
ofox/bailian/qwen-flash1.0M$0.02$0.22
ofox/bailian/qwen-max33K$0.35$1
ofox/bailian/qwen-plus1.0M$0.12$0.29
ofox/bailian/qwen-turbo128K$0.05$0.09
ofox/bailian/qwen-vl-max131K$0.23$0.58
ofox/bailian/qwen3-coder-flash1.0M$0.50$3
ofox/bailian/qwen3-coder-next262K$0.20$2
ofox/bailian/qwen3-coder-plus1.0M$2$9
ofox/bailian/qwen3-max262K$0.36$1
ofox/bailian/qwen3.5-122b-a10b256K$0.29$2
ofox/bailian/qwen3.5-27b262K$0.29$2
ofox/bailian/qwen3.5-35b-a3b262K$0.29$2
ofox/bailian/qwen3.5-397b-a17b256K$0.55$4
ofox/bailian/qwen3.5-flash1.0M$0.10$0.40
ofox/bailian/qwen3.5-plus1.0M$0.40$2
ofox/bailian/qwen3.6-27b256K$0.60$4
ofox/bailian/qwen3.6-flash1.0M$0.25$2
ofox/bailian/qwen3.6-max-preview262K$2$12
ofox/bailian/qwen3.6-plus1.0M$0.50$3
ofox/bailian/qwen3.7-max1.0M$3$8
ofox/bailian/qwen3.7-plus1.0M$0.40$2
ofox/bailian/qwen3.8-max1.0M$2$6
ofox/deepseek/deepseek-v3.2128K$0.29$0.43
ofox/deepseek/deepseek-v4-flash1.0M$0.44$1
ofox/deepseek/deepseek-v4-pro1.0M$1$4
ofox/deepseek/deepseek-v4-pro-08131.0M$1$4
ofox/google/gemini-2.5-flash1.0M$0.30$3
ofox/google/gemini-2.5-flash-lite1.0M$0.10$0.40
ofox/google/gemini-2.5-pro1.0M$1$10
ofox/google/gemini-3-flash-preview1.0M$0.50$3
ofox/google/gemini-3.1-flash-lite1.0M$0.25$2
ofox/google/gemini-3.1-pro-preview1.0M$2$12
ofox/google/gemini-3.5-flash1.0M$2$9
ofox/google/gemini-3.5-flash-lite1.0M$0.30$3
ofox/google/gemini-3.6-flash1.0M$2$8
ofox/google/gemini-3.7-flash1.0M$2$8
ofox/minimax/m2-her200K$0.30$1
ofox/minimax/minimax-m2197K$0.30$1
ofox/minimax/minimax-m2.1205K$0.30$1
ofox/minimax/minimax-m2.1-lightning205K$0.30$2
ofox/minimax/minimax-m2.5205K$0.30$1
ofox/minimax/minimax-m2.5-lightning205K$0.30$2
ofox/minimax/minimax-m2.7205K$0.30$1
ofox/minimax/minimax-m2.7-highspeed205K$0.60$2
ofox/minimax/minimax-m3512K$0.60$2
ofox/moonshotai/kimi-k2.5262K$0.60$3
ofox/moonshotai/kimi-k2.6262K$0.95$4
ofox/moonshotai/kimi-k2.7-code262K$0.95$4
ofox/moonshotai/kimi-k2.7-code-highspeed262K$2$8
ofox/moonshotai/kimi-k31.0M$3$15
ofox/openai/gpt-4.11.0M$2$8
ofox/openai/gpt-4.1-mini1.0M$0.40$2
ofox/openai/gpt-4o128K$3$10
ofox/openai/gpt-4o-mini128K$0.15$0.60
ofox/openai/gpt-5400K$1$10
ofox/openai/gpt-5-mini256K$0.25$2
ofox/openai/gpt-5-nano400K$0.05$0.40
ofox/openai/gpt-5.1400K$1$10
ofox/openai/gpt-5.1-codex-max256K$1$10
ofox/openai/gpt-5.1-codex-mini256K$0.25$2
ofox/openai/gpt-5.2400K$2$14
ofox/openai/gpt-5.2-codex400K$2$14
ofox/openai/gpt-5.3-codex400K$2$14
ofox/openai/gpt-5.41.1M$3$15
ofox/openai/gpt-5.4-mini400K$0.75$5
ofox/openai/gpt-5.4-nano400K$0.20$1
ofox/openai/gpt-5.4-pro1.1M$30$180
ofox/openai/gpt-5.51.1M$5$30
ofox/openai/gpt-5.6-luna1.1M$0.20$1
ofox/openai/gpt-5.6-sol1.1M$5$30
ofox/openai/gpt-5.6-terra1.1M$2$12
ofox/volcengine/doubao-seed-1-6256K$0.12$0.29
ofox/volcengine/doubao-seed-1-6-flash256K$0.03$0.22
ofox/volcengine/doubao-seed-1-6-vision256K$0.12$1
ofox/volcengine/doubao-seed-1-8256K$0.12$0.29
ofox/volcengine/doubao-seed-2.0-code256K$0.67$3
ofox/volcengine/doubao-seed-2.0-lite256K$0.13$0.76
ofox/volcengine/doubao-seed-2.0-mini256K$0.06$0.56
ofox/volcengine/doubao-seed-2.0-pro256K$0.67$3
ofox/volcengine/doubao-seed-2.1-pro256K$0.88$4
ofox/volcengine/doubao-seed-2.1-turbo256K$0.44$2
ofox/volcengine/doubao-seed-character256K$0.18$0.88
ofox/volcengine/doubao-seed-evolving256K$0.88$4
ofox/x-ai/grok-4.1-fast2.0M$0.20$0.50
ofox/x-ai/grok-4.202.0M$4$12
ofox/x-ai/grok-4.31.0M$1$3
ofox/x-ai/grok-4.5500K$2$6
ofox/x-ai/grok-4.6500K$2$6
ofox/z-ai/glm-4.6205K$0.40$2
ofox/z-ai/glm-4.7205K$0.40$2
ofox/z-ai/glm-4.7-flashx200K$0.07$0.43
ofox/z-ai/glm-5205K$1$3
ofox/z-ai/glm-5-turbo200K$1$4
ofox/z-ai/glm-5.1200K$1$4
ofox/z-ai/glm-5.21.0M$1$4
ofox/z-ai/glm-5.31.0M$1$4
ofox/z-ai/glm-5v-turbo200K$1$4
107 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.ofox.ai/v1",
id: "ofox/anthropic/claude-fable-5",
apiKey: process.env.OFOX_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
? "ofox/z-ai/glm-5v-turbo"
: "ofox/anthropic/claude-fable-5";
}
});
On this page