From d4aa41daf6e57e5443698038320120ea66d8b0b8 Mon Sep 17 00:00:00 2001 From: shivam Date: Thu, 12 Feb 2026 18:40:45 -0800 Subject: [PATCH] docs: add API base URLs for Dashscope (International and China/Beijing) --- docs/my-website/docs/providers/dashscope.md | 24 +++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/my-website/docs/providers/dashscope.md b/docs/my-website/docs/providers/dashscope.md index 565776d6c4c..52bfbd989f8 100644 --- a/docs/my-website/docs/providers/dashscope.md +++ b/docs/my-website/docs/providers/dashscope.md @@ -1,7 +1,7 @@ -# Dashscope (Qwen API) +# Dashscope API (Qwen models) https://dashscope.console.aliyun.com/ -**We support ALL Qwen models, just set `dashscope/` as a prefix when sending completion requests** +**We support ALL Qwen models (Alibaba Cloud), just set `dashscope/` as a prefix when sending completion requests** ## API Key ```python @@ -9,6 +9,26 @@ https://dashscope.console.aliyun.com/ os.environ['DASHSCOPE_API_KEY'] ``` +## API Base +You can optionally specify the API base URL depending on your region: + +| Region | API Base | +|--------|----------| +| **International** | `https://dashscope-intl.aliyuncs.com/compatible-mode/v1` | +| **China/Beijing** | `https://dashscope.aliyuncs.com/compatible-mode/v1` | + +```python +# Set via environment variable +os.environ['DASHSCOPE_API_BASE'] = "https://dashscope-intl.aliyuncs.com/compatible-mode/v1" + +# Or pass directly in the completion call +response = completion( + model="dashscope/qwen-turbo", + messages=[{"role": "user", "content": "hello"}], + api_base="https://dashscope-intl.aliyuncs.com/compatible-mode/v1" +) +``` + ## Sample Usage ```python from litellm import completion