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

Access 39 Alibaba models through Mastra's model router. Authentication is handled automatically using the `DASHSCOPE_API_KEY` environment variable.

Learn more in the [Alibaba documentation](https://www.alibabacloud.com/help/en/model-studio/models).

```bash
DASHSCOPE_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: "alibaba/qvq-max"
});

// 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 [Alibaba documentation](https://www.alibabacloud.com/help/en/model-studio/models) for details.

:::

## Models

<ProviderModelsTable
  models={[
  {
    "model": "alibaba/qvq-max",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 131072,
    "maxOutput": 8192,
    "inputCost": 1.2,
    "outputCost": 4.8
  },
  {
    "model": "alibaba/qwen-flash",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 1000000,
    "maxOutput": 32768,
    "inputCost": 0.05,
    "outputCost": 0.4
  },
  {
    "model": "alibaba/qwen-max",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 32768,
    "maxOutput": 8192,
    "inputCost": 1.6,
    "outputCost": 6.4
  },
  {
    "model": "alibaba/qwen-mt-plus",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": false,
    "reasoning": false,
    "contextWindow": 16384,
    "maxOutput": 8192,
    "inputCost": 2.46,
    "outputCost": 7.37
  },
  {
    "model": "alibaba/qwen-mt-turbo",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": false,
    "reasoning": false,
    "contextWindow": 16384,
    "maxOutput": 8192,
    "inputCost": 0.16,
    "outputCost": 0.49
  },
  {
    "model": "alibaba/qwen-omni-turbo",
    "imageInput": true,
    "audioInput": true,
    "videoInput": true,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 32768,
    "maxOutput": 2048,
    "inputCost": 0.07,
    "outputCost": 0.27
  },
  {
    "model": "alibaba/qwen-omni-turbo-realtime",
    "imageInput": true,
    "audioInput": true,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 32768,
    "maxOutput": 2048,
    "inputCost": 0.27,
    "outputCost": 1.07
  },
  {
    "model": "alibaba/qwen-plus",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 1000000,
    "maxOutput": 32768,
    "inputCost": 0.4,
    "outputCost": 1.2
  },
  {
    "model": "alibaba/qwen-plus-character-ja",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 8192,
    "maxOutput": 512,
    "inputCost": 0.5,
    "outputCost": 1.4
  },
  {
    "model": "alibaba/qwen-turbo",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 1000000,
    "maxOutput": 16384,
    "inputCost": 0.05,
    "outputCost": 0.2
  },
  {
    "model": "alibaba/qwen-vl-max",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 131072,
    "maxOutput": 8192,
    "inputCost": 0.8,
    "outputCost": 3.2
  },
  {
    "model": "alibaba/qwen-vl-ocr",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": false,
    "reasoning": false,
    "contextWindow": 34096,
    "maxOutput": 4096,
    "inputCost": 0.72,
    "outputCost": 0.72
  },
  {
    "model": "alibaba/qwen-vl-plus",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 131072,
    "maxOutput": 8192,
    "inputCost": 0.21,
    "outputCost": 0.63
  },
  {
    "model": "alibaba/qwen2-5-14b-instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 131072,
    "maxOutput": 8192,
    "inputCost": 0.35,
    "outputCost": 1.4
  },
  {
    "model": "alibaba/qwen2-5-32b-instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 131072,
    "maxOutput": 8192,
    "inputCost": 0.7,
    "outputCost": 2.8
  },
  {
    "model": "alibaba/qwen2-5-72b-instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 131072,
    "maxOutput": 8192,
    "inputCost": 1.4,
    "outputCost": 5.6
  },
  {
    "model": "alibaba/qwen2-5-7b-instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 131072,
    "maxOutput": 8192,
    "inputCost": 0.175,
    "outputCost": 0.7
  },
  {
    "model": "alibaba/qwen2-5-omni-7b",
    "imageInput": true,
    "audioInput": true,
    "videoInput": true,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 32768,
    "maxOutput": 2048,
    "inputCost": 0.1,
    "outputCost": 0.4
  },
  {
    "model": "alibaba/qwen2-5-vl-72b-instruct",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 131072,
    "maxOutput": 8192,
    "inputCost": 2.8,
    "outputCost": 8.4
  },
  {
    "model": "alibaba/qwen2-5-vl-7b-instruct",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 131072,
    "maxOutput": 8192,
    "inputCost": 0.35,
    "outputCost": 1.05
  },
  {
    "model": "alibaba/qwen3-14b",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 131072,
    "maxOutput": 8192,
    "inputCost": 0.35,
    "outputCost": 1.4
  },
  {
    "model": "alibaba/qwen3-235b-a22b",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 131072,
    "maxOutput": 16384,
    "inputCost": 0.7,
    "outputCost": 2.8
  },
  {
    "model": "alibaba/qwen3-32b",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 131072,
    "maxOutput": 16384,
    "inputCost": 0.7,
    "outputCost": 2.8
  },
  {
    "model": "alibaba/qwen3-8b",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 131072,
    "maxOutput": 8192,
    "inputCost": 0.18,
    "outputCost": 0.7
  },
  {
    "model": "alibaba/qwen3-asr-flash",
    "imageInput": false,
    "audioInput": true,
    "videoInput": false,
    "toolUsage": false,
    "reasoning": false,
    "contextWindow": 53248,
    "maxOutput": 4096,
    "inputCost": 0.035,
    "outputCost": 0.035
  },
  {
    "model": "alibaba/qwen3-coder-30b-a3b-instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 262144,
    "maxOutput": 65536,
    "inputCost": 0.45,
    "outputCost": 2.25
  },
  {
    "model": "alibaba/qwen3-coder-480b-a35b-instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 262144,
    "maxOutput": 65536,
    "inputCost": 1.5,
    "outputCost": 7.5
  },
  {
    "model": "alibaba/qwen3-coder-flash",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 1000000,
    "maxOutput": 65536,
    "inputCost": 0.3,
    "outputCost": 1.5
  },
  {
    "model": "alibaba/qwen3-coder-plus",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 1048576,
    "maxOutput": 65536,
    "inputCost": 1,
    "outputCost": 5
  },
  {
    "model": "alibaba/qwen3-livetranslate-flash-realtime",
    "imageInput": true,
    "audioInput": true,
    "videoInput": true,
    "toolUsage": false,
    "reasoning": false,
    "contextWindow": 53248,
    "maxOutput": 4096,
    "inputCost": 10,
    "outputCost": 10
  },
  {
    "model": "alibaba/qwen3-max",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 262144,
    "maxOutput": 65536,
    "inputCost": 1.2,
    "outputCost": 6
  },
  {
    "model": "alibaba/qwen3-next-80b-a3b-instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 131072,
    "maxOutput": 32768,
    "inputCost": 0.5,
    "outputCost": 2
  },
  {
    "model": "alibaba/qwen3-next-80b-a3b-thinking",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 131072,
    "maxOutput": 32768,
    "inputCost": 0.5,
    "outputCost": 6
  },
  {
    "model": "alibaba/qwen3-omni-flash",
    "imageInput": true,
    "audioInput": true,
    "videoInput": true,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 65536,
    "maxOutput": 16384,
    "inputCost": 0.43,
    "outputCost": 1.66
  },
  {
    "model": "alibaba/qwen3-omni-flash-realtime",
    "imageInput": true,
    "audioInput": true,
    "videoInput": true,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 65536,
    "maxOutput": 16384,
    "inputCost": 0.52,
    "outputCost": 1.99
  },
  {
    "model": "alibaba/qwen3-vl-235b-a22b",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 131072,
    "maxOutput": 32768,
    "inputCost": 0.7,
    "outputCost": 2.8
  },
  {
    "model": "alibaba/qwen3-vl-30b-a3b",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 131072,
    "maxOutput": 32768,
    "inputCost": 0.2,
    "outputCost": 0.8
  },
  {
    "model": "alibaba/qwen3-vl-plus",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 262144,
    "maxOutput": 32768,
    "inputCost": 0.2,
    "outputCost": 1.6
  },
  {
    "model": "alibaba/qwq-plus",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 131072,
    "maxOutput": 8192,
    "inputCost": 0.8,
    "outputCost": 2.4
  }
]}
/>

## Advanced Configuration

### Custom Headers

```typescript
const agent = new Agent({
  name: "custom-agent",
  model: {
    url: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
    id: "alibaba/qvq-max",
    apiKey: process.env.DASHSCOPE_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
      ? "alibaba/qwq-plus"
      : "alibaba/qvq-max";
  }
});
```




---
title: "Amazon Bedrock"
description: "Use Amazon Bedrock models via the AI SDK."
---

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