Ofox
Access 13 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);
}
info
Mastra uses the OpenAI-compatible /chat/completions endpoint. Some provider-specific features may not be available. Check the Ofox documentation for details.
ModelsDirect link to Models
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|---|---|---|---|---|---|---|---|---|
ofox/anthropic/claude-fable-5 | 1.0M | $10 | $50 | |||||
ofox/anthropic/claude-opus-4.8 | 1.0M | $5 | $25 | |||||
ofox/anthropic/claude-sonnet-5 | 1.0M | $2 | $10 | |||||
ofox/bailian/qwen3.7-max | 1.0M | $3 | $8 | |||||
ofox/deepseek/deepseek-v4-pro | 1.0M | $0.45 | $0.88 | |||||
ofox/google/gemini-3.1-pro-preview | 1.0M | $2 | $12 | |||||
ofox/moonshotai/kimi-k2.6 | 262K | $0.95 | $4 | |||||
ofox/openai/gpt-5.5 | 1.1M | $5 | $30 | |||||
ofox/openai/gpt-5.6-luna | 1.1M | $1 | $6 | |||||
ofox/openai/gpt-5.6-sol | 1.1M | $5 | $30 | |||||
ofox/openai/gpt-5.6-terra | 1.1M | $3 | $15 | |||||
ofox/x-ai/grok-4.3 | 1.0M | $1 | $3 | |||||
ofox/z-ai/glm-5.2 | 1.0M | $1 | $4 |
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.ofox.ai/v1",
id: "ofox/anthropic/claude-fable-5",
apiKey: process.env.OFOX_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
? "ofox/z-ai/glm-5.2"
: "ofox/anthropic/claude-fable-5";
}
});