> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# DashScope

> Use Alibaba DashScope Qwen models with Agno agents.

Use Alibaba DashScope's Qwen models with Agno agents.

[DashScope](https://dashscope.aliyun.com/) supports a wide range of models.

We recommend experimenting to find the best-suited model for your use-case. Here are some general recommendations:

* `qwen-plus` model is good for most use-cases.

## Installation

```bash theme={null}
uv pip install -U openai agno
```

## Authentication

Set your `DASHSCOPE_API_KEY` environment variable. Get your key from [here](https://dashscope.aliyun.com/api-keys).

```bash Mac theme={null}
export DASHSCOPE_API_KEY=***
```

```bash Windows theme={null}
setx DASHSCOPE_API_KEY ***
```

## Example

Use `DashScope` with your `Agent`:

```python agent.py theme={null}
from agno.agent import Agent
from agno.models.dashscope import DashScope

agent = Agent(
    model=DashScope(id="qwen-plus"),
    markdown=True
)

# Print the response in the terminal
agent.print_response("Share a 2 sentence horror story.")

```

> [!NOTE]
>
> View more examples [here](https://agno-v2.mintlify.site/models/providers/native/dashscope/usage/basic.md).

## Parameters

| Parameter | Type | Default | Description |
| - | - | - | - |
| `id` | `str` | `"qwen-plus"` | The id of the Qwen model to use |
| `name` | `str` | `"Qwen"` | The name of the model |
| `provider` | `str` | `"Dashscope"` | The provider of the model |
| `api_key` | `Optional[str]` | `None` | The API key for DashScope (defaults to the DASHSCOPE\_API\_KEY env var, falling back to QWEN\_API\_KEY) |
| `base_url` | `str` | `"https://dashscope-intl.aliyuncs.com/compatible-mode/v1"` | The base URL for the DashScope API. For users in Mainland China, you must set the base URL to [https://dashscope.aliyuncs.com/compatible-mode/v1](https://dashscope.aliyuncs.com/compatible-mode/v1) to avoid the "invalid API key" error. |
| `enable_thinking` | `bool` | `False` | Enable thinking process for reasoning models |
| `include_thoughts` | `Optional[bool]` | `None` | Include thinking process in response (alternative parameter) |
| `thinking_budget` | `Optional[int]` | `None` | Budget for thinking tokens in reasoning models |

`DashScope` extends the OpenAI-compatible interface and supports most parameters from the [OpenAI model](https://agno-v2.mintlify.site/models/providers/native/openai/completion/overview.md).

## Thinking Models

DashScope supports reasoning models with thinking capabilities:

```python theme={null}
from agno.agent import Agent
from agno.models.dashscope import DashScope

agent = Agent(
    model=DashScope(
        id="qwen-plus",
        enable_thinking=True,
        thinking_budget=5000
    ),
    markdown=True
)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.