# <img src="https://models.dev/logos/synthetic.svg" alt="Synthetic logo" className="inline w-8 h-8 mr-2 align-middle dark:invert dark:brightness-0 dark:contrast-200" />Synthetic
[EN] Source: https://mastra.ai/models/providers/synthetic

Access 22 Synthetic models through Mastra's model router. Authentication is handled automatically using the `SYNTHETIC_API_KEY` environment variable.

Learn more in the [Synthetic documentation](https://synthetic.new/pricing).

```bash
SYNTHETIC_API_KEY=your-api-key
```

```typescript
import { Agent } from "@mastra/core";

const agent = new Agent({
  name: "my-agent",
  instructions: "You are a helpful assistant",
  model: "synthetic/hf:MiniMaxAI/MiniMax-M2"
});

// 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 [Synthetic documentation](https://synthetic.new/pricing) for details.

:::

## Models

<ProviderModelsTable
  models={[
  {
    "model": "synthetic/hf:deepseek-ai/DeepSeek-R1",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 128000,
    "maxOutput": 128000,
    "inputCost": 0.55,
    "outputCost": 2.19
  },
  {
    "model": "synthetic/hf:deepseek-ai/DeepSeek-R1-0528",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 128000,
    "maxOutput": 128000,
    "inputCost": 3,
    "outputCost": 8
  },
  {
    "model": "synthetic/hf:deepseek-ai/DeepSeek-V3",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 128000,
    "maxOutput": 128000,
    "inputCost": 1.25,
    "outputCost": 1.25
  },
  {
    "model": "synthetic/hf:deepseek-ai/DeepSeek-V3-0324",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 128000,
    "maxOutput": 128000,
    "inputCost": 1.2,
    "outputCost": 1.2
  },
  {
    "model": "synthetic/hf:deepseek-ai/DeepSeek-V3.1",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 128000,
    "maxOutput": 128000,
    "inputCost": 0.56,
    "outputCost": 1.68
  },
  {
    "model": "synthetic/hf:deepseek-ai/DeepSeek-V3.1-Terminus",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 128000,
    "maxOutput": 128000,
    "inputCost": 1.2,
    "outputCost": 1.2
  },
  {
    "model": "synthetic/hf:meta-llama/Llama-3.1-405B-Instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 128000,
    "maxOutput": 32768,
    "inputCost": 3,
    "outputCost": 3
  },
  {
    "model": "synthetic/hf:meta-llama/Llama-3.1-70B-Instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 128000,
    "maxOutput": 32768,
    "inputCost": 0.9,
    "outputCost": 0.9
  },
  {
    "model": "synthetic/hf:meta-llama/Llama-3.1-8B-Instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 128000,
    "maxOutput": 32768,
    "inputCost": 0.2,
    "outputCost": 0.2
  },
  {
    "model": "synthetic/hf:meta-llama/Llama-3.3-70B-Instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 128000,
    "maxOutput": 32768,
    "inputCost": 0.9,
    "outputCost": 0.9
  },
  {
    "model": "synthetic/hf:meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 524000,
    "maxOutput": 4096,
    "inputCost": 0.22,
    "outputCost": 0.88
  },
  {
    "model": "synthetic/hf:meta-llama/Llama-4-Scout-17B-16E-Instruct",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 328000,
    "maxOutput": 4096,
    "inputCost": 0.15,
    "outputCost": 0.6
  },
  {
    "model": "synthetic/hf:MiniMaxAI/MiniMax-M2",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 196608,
    "maxOutput": 64000,
    "inputCost": 0.55,
    "outputCost": 2.19
  },
  {
    "model": "synthetic/hf:moonshotai/Kimi-K2-Instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 128000,
    "maxOutput": 32768,
    "inputCost": 0.6,
    "outputCost": 2.5
  },
  {
    "model": "synthetic/hf:moonshotai/Kimi-K2-Instruct-0905",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 262144,
    "maxOutput": 32768,
    "inputCost": 1.2,
    "outputCost": 1.2
  },
  {
    "model": "synthetic/hf:moonshotai/Kimi-K2-Thinking",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 262144,
    "maxOutput": 262144,
    "inputCost": 0.55,
    "outputCost": 2.19
  },
  {
    "model": "synthetic/hf:openai/gpt-oss-120b",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 128000,
    "maxOutput": 32768,
    "inputCost": 0.1,
    "outputCost": 0.1
  },
  {
    "model": "synthetic/hf:Qwen/Qwen2.5-Coder-32B-Instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": false,
    "reasoning": false,
    "contextWindow": 32768,
    "maxOutput": 32768,
    "inputCost": 0.8,
    "outputCost": 0.8
  },
  {
    "model": "synthetic/hf:Qwen/Qwen3-235B-A22B-Instruct-2507",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 256000,
    "maxOutput": 32000,
    "inputCost": 0.2,
    "outputCost": 0.6
  },
  {
    "model": "synthetic/hf:Qwen/Qwen3-235B-A22B-Thinking-2507",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 256000,
    "maxOutput": 32000,
    "inputCost": 0.65,
    "outputCost": 3
  },
  {
    "model": "synthetic/hf:Qwen/Qwen3-Coder-480B-A35B-Instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 256000,
    "maxOutput": 32000,
    "inputCost": 2,
    "outputCost": 2
  },
  {
    "model": "synthetic/hf:zai-org/GLM-4.5",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 128000,
    "maxOutput": 96000,
    "inputCost": 0.55,
    "outputCost": 2.19
  },
  {
    "model": "synthetic/hf:zai-org/GLM-4.6",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 200000,
    "maxOutput": 64000,
    "inputCost": 0.55,
    "outputCost": 2.19
  }
]}
/>

## Advanced Configuration

### Custom Headers

```typescript
const agent = new Agent({
  name: "custom-agent",
  model: {
    url: "https://api.synthetic.new/v1",
    id: "synthetic/hf:MiniMaxAI/MiniMax-M2",
    apiKey: process.env.SYNTHETIC_API_KEY,
    headers: {
      "X-Custom-Header": "value"
    }
  }
});
```

### Dynamic Model Selection

```typescript
const agent = new Agent({
  name: "dynamic-agent",
  model: ({ runtimeContext }) => {
    const useAdvanced = runtimeContext.task === "complex";
    return useAdvanced
      ? "synthetic/hf:zai-org/GLM-4.6"
      : "synthetic/hf:MiniMaxAI/MiniMax-M2";
  }
});
```




---
title: "Together AI | Models | Mastra"
description: "Use Together AI models with Mastra. 6 models available."
---

{/* This file is auto-generated by generate-model-docs.ts - DO NOT EDIT MANUALLY */}



import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";