Tongyi Qianwen API Integration for Openclaw

A professional developer guide for integrating Alibaba's Tongyi Qianwen (Qwen) models via the DashScope platform with full OpenAI SDK compatibility.

zhangifonly
v1.0.0
Mar 22, 2026
0
712
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install qwen-api

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install qwen-api using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Tongyi Qianwen API Integration?

The Tongyi Qianwen API skill provides a comprehensive framework for developers to leverage Alibaba Cloud's powerful Qwen model series. By utilizing the DashScope (Aliyun Bailian) platform, this skill enables seamless integration of high-performance LLMs into your AI workflows. It is a vital component for those using Openclaw Skills who require robust alternatives to traditional providers, offering unique advantages such as content moderation bypass on international endpoints and massive 10-million token context windows.

This integration is designed for high compatibility, allowing developers to switch from OpenAI to Qwen by simply updating the base URL and API key. Whether you need the deep reasoning of qwen-max, the cost-efficiency of qwen-plus, or specialized multimodal capabilities for image and video analysis, this skill covers the entire model matrix for modern AI agent development.

Tongyi Qianwen API Integration Use Cases

  • Building AI coding assistants with high-performance reasoning using qwen-plus.
  • Analyzing massive datasets or academic papers utilizing the 10-million token capacity of qwen-long.
  • Implementing visual and audio understanding in applications using qwen-vl-max.
  • Developing low-latency chatbots for high-concurrency environments with qwen-turbo.
  • Bypassing strict content filters for international applications using the Singapore endpoint with Openclaw Skills.

How Tongyi Qianwen API Integration Works

  1. Authentication: The skill initializes a connection to the DashScope platform using a provided API key.
  2. Endpoint Selection: Based on latency or moderation requirements, it selects between International (Singapore), China (Beijing), or US nodes.
  3. SDK Compatibility: It wraps requests using the OpenAI-compatible SDK format to minimize code changes.
  4. Processing: Requests are routed to the specific model (e.g., qwen-max for reasoning or qwen-vl for vision).
  5. Advanced Handling: For long documents, it manages file uploads and extraction before triggering the chat completion sequence.

Tongyi Qianwen API Integration Setup

To start using this integration with Openclaw Skills, install the required library and configure your client:

pip install -U openai

Configure your environment variables or direct client initialization:

from openai import OpenAI

# Initialize for international usage
client = OpenAI(
    api_key="sk-your-dashscope-api-key",
    base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
)

Tongyi Qianwen API Integration Data Schema & Taxonomy

The skill manages data through the DashScope ecosystem with the following structure:

Data Component Format Description
API Keys String sk- prefixed credentials from Aliyun DashScope
Model Identifiers String qwen-max, qwen-plus, qwen-long, etc.
Long Context Files file-id Managed via client.files.create for extraction
Headers JSON Used for custom inspection settings (X-DashScope-DataInspection)

Tongyi Qianwen API Integration Advanced Features

  • Support for 10M token context windows using the file-extract purpose in qwen-long.
  • Content inspection bypass available on international endpoints via extra_headers.
  • Native multimodal support for both image_url and video_url inputs.
  • Function calling (Tool Use) for building autonomous agents that interact with external APIs.
  • Zero-latency migration via OpenAI-compatible API endpoints for existing Openclaw Skills setups.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*