Back to Mastra

Firmware | Models

docs/src/content/en/models/providers/firmware.mdx

2025-12-188.1 KB
Original Source

Firmware

Access 24 Firmware models through Mastra's model router. Authentication is handled automatically using the FIRMWARE_API_KEY environment variable.

Learn more in the Firmware documentation.

bash
FIRMWARE_API_KEY=your-api-key
typescript
import { Agent } from "@mastra/core/agent";

const agent = new Agent({
  id: "my-agent",
  name: "My Agent",
  instructions: "You are a helpful assistant",
  model: "firmware/claude-haiku-4-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 Firmware documentation for details.

:::

Models

<ProviderModelsTable models={[ { "model": "firmware/claude-haiku-4-5", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 200000, "maxOutput": 64000, "inputCost": 1, "outputCost": 5 }, { "model": "firmware/claude-opus-4-5", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 200000, "maxOutput": 64000, "inputCost": 5, "outputCost": 25 }, { "model": "firmware/claude-opus-4-6", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 200000, "maxOutput": 128000, "inputCost": 5, "outputCost": 25 }, { "model": "firmware/claude-sonnet-4-5", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 200000, "maxOutput": 64000, "inputCost": 3, "outputCost": 15 }, { "model": "firmware/claude-sonnet-4-6", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 200000, "maxOutput": 64000, "inputCost": 3, "outputCost": 15 }, { "model": "firmware/deepseek-v3-2", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 128000, "maxOutput": 8192, "inputCost": 0.58, "outputCost": 1.68 }, { "model": "firmware/gemini-2.5-flash", "imageInput": true, "audioInput": true, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 1048576, "maxOutput": 65536, "inputCost": 0.3, "outputCost": 2.5 }, { "model": "firmware/gemini-2.5-pro", "imageInput": true, "audioInput": true, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 1048576, "maxOutput": 65536, "inputCost": 1.25, "outputCost": 10 }, { "model": "firmware/gemini-3-1-pro-preview", "imageInput": true, "audioInput": true, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 1000000, "maxOutput": 64000, "inputCost": 2, "outputCost": 12 }, { "model": "firmware/gemini-3-flash-preview", "imageInput": true, "audioInput": true, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 1048576, "maxOutput": 65536, "inputCost": 0.5, "outputCost": 3 }, { "model": "firmware/gemini-3-pro-preview", "imageInput": true, "audioInput": true, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 1000000, "maxOutput": 64000, "inputCost": 2, "outputCost": 12 }, { "model": "firmware/glm-5", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 198000, "maxOutput": 8192, "inputCost": 1, "outputCost": 3.2 }, { "model": "firmware/gpt-4o", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 128000, "maxOutput": 16384, "inputCost": 2.5, "outputCost": 10 }, { "model": "firmware/gpt-5-3-codex", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 400000, "maxOutput": 128000, "inputCost": 1.75, "outputCost": 14 }, { "model": "firmware/gpt-5-4", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 272000, "maxOutput": 128000, "inputCost": 2.5, "outputCost": 15 }, { "model": "firmware/gpt-5-mini", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 400000, "maxOutput": 128000, "inputCost": 0.25, "outputCost": 2 }, { "model": "firmware/gpt-5-nano", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 400000, "maxOutput": 128000, "inputCost": 0.05, "outputCost": 0.4 }, { "model": "firmware/gpt-oss-120b", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 131072, "maxOutput": 32768, "inputCost": 0.15, "outputCost": 0.6 }, { "model": "firmware/gpt-oss-20b", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 131072, "maxOutput": 32768, "inputCost": 0.07, "outputCost": 0.2 }, { "model": "firmware/grok-4-1-fast-non-reasoning", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 2000000, "maxOutput": 128000, "inputCost": 0.2, "outputCost": 0.5 }, { "model": "firmware/grok-4-1-fast-reasoning", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 2000000, "maxOutput": 128000, "inputCost": 0.2, "outputCost": 0.5 }, { "model": "firmware/grok-code-fast-1", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 256000, "maxOutput": 128000, "inputCost": 0.2, "outputCost": 1.5 }, { "model": "firmware/kimi-k2.5", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 256000, "maxOutput": 128000, "inputCost": 0.6, "outputCost": 3 }, { "model": "firmware/minimax-m2-5", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 192000, "maxOutput": 8192, "inputCost": 0.3, "outputCost": 1.2 } ]} />

Advanced configuration

Custom headers

typescript
const agent = new Agent({
  id: "custom-agent",
  name: "custom-agent",
  model: {
    url: "https://app.frogbot.ai/api/v1",
    id: "firmware/claude-haiku-4-5",
    apiKey: process.env.FIRMWARE_API_KEY,
    headers: {
      "X-Custom-Header": "value"
    }
  }
});

Dynamic model selection

typescript
const agent = new Agent({
  id: "dynamic-agent",
  name: "Dynamic Agent",
  model: ({ requestContext }) => {
    const useAdvanced = requestContext.task === "complex";
    return useAdvanced
      ? "firmware/minimax-m2-5"
      : "firmware/claude-haiku-4-5";
  }
});