Model Studio provides official DashScope SDKs (Python, Java) and supports OpenAI SDKs (Python, Node.js, Java, Go) for OpenAI-compatible API calls.
Install the SDK
Python
The SDK requires Python >= 3.8.
Java
DashScope
Add the DashScope Java SDK dependency. Replace the-latest-version with the latest version number from the Maven repository.
Gradle
dependencies {
implementation group: 'com.alibaba', name: 'dashscope-sdk-java', version: 'the-latest-version'
}Maven
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dashscope-sdk-java</artifactId>
<version>the-latest-version</version>
</dependency>OpenAI
Add the OpenAI Java SDK dependency (replace the-latest-version with the latest version number; recommended: 3.5.0). The SDK requires Java 8 or later.
Gradle
dependencies {
implementation("com.openai:openai-java:the-latest-version")
}Maven
<dependency>
<groupId>com.openai</groupId>
<artifactId>openai-java</artifactId>
<version>the-latest-version</version>
</dependency>Node.js
OpenAI
Go
OpenAI
Install the OpenAI Go SDK (which requires Go 1.22+) in your project folder:
go get 'github.com/openai/openai-go/v3'Or install a specific version:
go get -u 'github.com/openai/openai-go/v3@v3.8.1'If the installation times out, set an Alibaba Cloud mirror: go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,directImport the SDK:
import (
"github.com/openai/openai-go/v3" // imported as openai
)What to do next
After installing the SDK:
Select a model that fits your scenario from the Model Studio console.
Start building your application using models for text generation, image generation, video generation, speech synthesis, speech recognition, embedding, or reranking.
Learn about the compatibility details with the OpenAI API.


