dashscope
dashscope client sdk library
What it is and what it does
DashScope is a Python client library for Alibaba Cloud's Model Studio (Bailian) platform, exposing a broad range of AI model capabilities through a unified SDK interface. It supports synchronous, streaming, and asynchronous calling patterns for text generation (via Qwen models), multi-modal understanding (vision, video, audio), text and multi-modal embeddings, reranking, image and video synthesis, speech synthesis and recognition, and tokenization. The SDK handles authentication via API key and abstracts the HTTP/WebSocket transport layer.
The library is designed for developers integrating Alibaba's AI models into Python applications. It provides high-level classes (Generation, MultiModalConversation, TextEmbedding, ImageSynthesis, etc.) that map to specific model categories and calling patterns. Async support via AioGeneration and async_call methods enables non-blocking integration in concurrent applications. The SDK requires Python 3.8 or later and depends on standard HTTP clients (requests, httpx, aiohttp) plus cryptography for secure communication.
Use it for:
- Building chatbots or conversational AI applications using Qwen text generation models with streaming or async responses.
- Implementing semantic search or RAG systems with text embeddings and reranking via TextEmbedding and TextReRank classes.
- Creating image or video generation workflows using ImageSynthesis and VideoSynthesis for content creation pipelines.
- Adding speech synthesis (TTS) or speech recognition (ASR) to applications via SpeechSynthesizer and Transcription.
- Processing multi-modal queries (image + text, video + text) with MultiModalConversation for vision-language tasks.
- Batch processing large text corpora for embeddings using BatchTextEmbedding with async task submission and polling.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python SDK for Alibaba Cloud Model Studio (Bailian) APIs, providing access to text generation, embeddings, image/video synthesis, speech processing, and multi-modal understanding models.
Yes, if you are building on Alibaba Cloud's Model Studio platform. The SDK is actively maintained, has low install friction, and provides comprehensive coverage of Bailian's AI capabilities. Apache 2.0 licensing is permissive. However, it is only useful if you have an Alibaba Cloud account and API key; it is not a general-purpose LLM client and does not support other model providers.
Install
dashscope on PyPI
pip
pip install dashscopeuv
uv add dashscopepoetry
poetry add dashscopeInstalling dashscope
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with a recent release. Nine runtime dependencies (aiohttp, requests, websocket-client, cryptography, certifi, typer, rich, httpx, httpx-sse) are all well-established libraries, adding moderate but manageable dependency weight.
License in practice
Licensed under Apache 2.0 (permissive), which allows commercial use, modification, and distribution with minimal restrictions—suitable for most production and proprietary projects.
Quickstart
pip install dashscope
import dashscope
dashscope.api_key = 'YOUR-DASHSCOPE-API-KEY'
from dashscope import Generation
response = Generation.call(
model="qwen-plus",
messages=[{"role": "user", "content": "Hello"}],
result_format="message",
)
print(response.output.choices[0].message.content)
Requires a valid Alibaba Cloud Model Studio API key; set via code, environment variable DASHSCOPE_API_KEY, or file path.
Verify before relying
- Whether all supported models (qwen3.7-max, qwen3.5-omni-plus, etc.) are currently available and stable in production.
- Performance characteristics and rate limits for batch operations (BatchTextEmbedding, async tasks).
- Detailed error handling and retry behavior for network failures or API rate limiting.
Package facts
| License | Apache 2.0 (permissive) |
| Python support | supports the current Python release (>=3.8.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 9 — aiohttp, requests, websocket-client, cryptography, certifi, typer, rich, httpx, httpx-sse |
| Maintenance | actively maintained — 2 days since the last release |
| First released | |
| Downloads | 3,476,109/month — #2,610 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: dashscope-1.26.7-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
zai-sdkOfficial Python SDK for Z.ai's large model…
unclear · top 15,000 on PyPI
apache-airflow-providers-alibabaIntegrates Alibaba Cloud services (OSS, ADB,…
permissive · top 15,000 on PyPI
deepgram-sdkOfficial Python SDK for Deepgram's speech…
permissive · top 5,000 on PyPI
speechmatics-voicePython SDK for building real-time voice…
permissive · top 15,000 on PyPI
aliyun-log-python-sdkPython SDK for Alibaba Cloud Log Service that…
permissive · top 15,000 on PyPI
modelscopeModelScope provides unified Python interfaces…
permissive · top 5,000 on PyPI
alibabacloud-gateway-dingtalkProvides a gateway client for integrating with…
permissive · top 15,000 on PyPI
livekit-plugins-cartesiaIntegrates Cartesia's voice AI services…
permissive · top 5,000 on PyPI
elevenlabsOfficial Python SDK for ElevenLabs…
permissive · top 5,000 on PyPI
alibabacloud-credentials-apiProvides credential management interfaces and…
permissive · top 5,000 on PyPI