Repository navigation
Releases
v3.0.0
v3.0.0
The first 3.0 release rebuilds the DashScope Java SDK around a typed, resource-style client. One DashScopeClient (or DashScopeAsyncClient) replaces the per-capability entry classes of the 2.x line, with typed request/response models, an unchecked exception family, a layered configuration chain, automatic retries, and text-like streaming. Legacy 2.x APIs remain available as frozen facades under com.alibaba.dashscope.legacy_2x so existing code can keep compiling with an import update.
This release also significantly expands AgentStudio: dynamic workflow management, typed agent permissions and fixed-version bindings, plus a new Sandbox API for managed agents (DeepSeek Harness / OpenClaw) with native Web UI preview.
Scope: 1,255 files changed (+72,758 / −9,295) since v2.23.8; 796 SDK tests pass on JDK 8.
⚠️ Breaking Changes
3.0 is an intentional FQCN, source, and binary compatibility break. See the Migration Guide for the full entry-point mapping table and before/after examples.
- Legacy packages moved — 2.x APIs (other than AgentStudio and
shared) now live undercom.alibaba.dashscope.legacy_2x.*, carry type-level@Deprecated, and will be removed in 4.0. To keep existing code compiling, prefix your 2.x imports withlegacy_2x; new code should use the 3.0 client. - Exceptions — checked
ApiException/NoApiKeyException/InputRequiredExceptionare replaced by the uncheckedDashScopeExceptionfamily (AuthenticationException,RateLimitException,ContentFilterException,ApiTimeoutException, …) carryingcode, HTTP status andrequest_id. Build the client withraiseOnError(false)to restore 2.x-style result inspection (result.isError()). - Streaming — sync
streamCallreturningFlowablebecomescreateStreamingreturning a typedResponseStream<T>(Iterable+AutoCloseable, incremental deltas by default). The async client still exposes RxJavaFlowable. - Client lifecycle — per-capability
new Generation()objects become oneDashScopeClientin try-with-resources, sharing a connection pool and configuration. - Configuration — per-param
apiKey(...)and global constants become the config chain: builder > system property > environment variable >~/.dashscope/config.toml> defaults, with per-requestRequestOptionsoverrides.DashScopeClient.builder().build()works with justDASHSCOPE_API_KEYexported. - AgentStudio — same business package, new FQCN
com.alibaba.dashscope.applications.agentstudio.*, also reachable viaclient.agentStudio(). The 3.0baseUrldoes not apply to AgentStudio; useDASHSCOPE_AGENTSTUDIO_URLto override its endpoint. assistants.*/threads.*have no 3.0 equivalent yet — keep thelegacy_2ximports.
Features
New 3.0 client / resource API (#300)
- One
DashScopeCliententry point with 16 typed resources (chat(),multimodal(),embeddings(),rerank(),images(),videos(),apps(),audio(),tingwu(),tokenization(),agentStudio(), …), Lombok-builder request params and typed responses. - Async client — supported unary calls return
CompletableFuture<T>; streams use RxJavaFlowable<T>. - Automatic retries for non-streaming HTTP based on request settings and failure type, with backoff and
Retry-After/Retry-After-ms/X-Should-Retrysupport, overridable per request viaRequestOptions. - Encrypted channel — opt-in RSA envelope encryption (
RequestOptions.enableEncryption(true)) with automatic gateway public-key fetch and caching. - HTTP/SSE/WebSocket transport improvements and expanded model/audio/platform resources.
- Local tokenizer —
TokenizerFactory.qwen()counts offline when the vocabulary is available (downloading it if missing); remote counting viatokenization().count. - Frozen 2.x APIs migrated to
legacy_2x, AgentStudio regrouped, and runnable examples/tests updated. Validation: 735 tests, 0 failures on JDK 8 at merge time.
AgentStudio: dynamic workflows and agent configuration (#304)
AgentStudioClient.dynamicWorkflows()adds seven resource operations, available synchronously and throughCompletableFuture: create, retrieve, partial update, list, archive, list versions, and retrieve a fixed version.- Cursor pagination preserves filters; update parameters distinguish omitted fields from explicit nulls when clearing descriptions or input schemas.
- Typed Workflow permissions and fixed-version bindings in Agent configuration.
- Ships with the runnable
AgentStudioDynamicWorkflowsrecipe (EN/ZH guides) and nine new MockWebServer tests; validated against production with 40 checks covering sync/async operations, version immutability, null handling, pagination and archive behavior.
AgentStudio: Sandbox and managed Agent APIs (#306)
- New
com.alibaba.dashscope.agentstudio.sandboxpackage: a unified client for official-image templates, template files, Sandbox lifecycle operations and typed resource handles. - Managed Agent support: launch, lookup, sessions, turns, SSE subscriptions, cancellation, attachments and release — enabling DeepSeek Harness / OpenClaw through the Java SDK.
- Native Web UI preview — open DSH/OpenClaw Web UIs through a local preview, with template/Sandbox reuse, automatic OpenClaw device pairing by default (
autoPairOpenClaw=falseretains manual pairing) and cleanup of newly created resources. Requires Node.js when used. - Model credentials are configured independently of the platform API key; reused templates/Sandboxes must correspond to the requested Harness image.
Sandbox test coverage and examples (#307)
- 11 offline tests covering image resolution, template/instance payloads, independent model credentials, turns/SSE, files, error metadata and release.
- Three runnable examples: ordinary Sandbox lifecycle, managed Harness chat, and native Web UI preview — each releases owned resources and preserves reusable templates or borrowed resources.
- Example dry-run harness extended (46 checks passed); production SDK code, dependencies and CI configuration unchanged.
Bug Fixes
- WebSocket post-close send race (#301) — after a duplex stream was cancelled/disposed, an orphaned RxJava thread could still run the
streamingDataonCompletefinish-task send and reconnect, throwingNoApiKeyExceptionas an RxJavaUndeliverableExceptionwhen no global API key was set.OkHttpWebSocketClientnow guards theonCompletesend withisClosed+ try/catch, returns quietly from the reconnect catch when closed, and downgrades theonNextcatch log to debug when closed. Live-flow failures still surface viaemitResponseError. Includes a deterministic regression test (TestOkHttpWebSocketClientCloseRace).
Documentation
- Bilingual docs aligned with the Python SDK (#305) — shared documentation structure with capability recipes, an examples hub, a developer guide, and reference pages linked to generated Javadoc. Clarifies async audio, stream errors and retries, image task IDs, legacy imports, offline tokenization and dry-run coverage; fixes the native HTTP endpoint example, documents wire-log redaction limits, and makes the streaming/async Quickstart examples independently compilable (
javac --release 8). Both locales build withmkdocs build --strict.
CI & Chore
- GitHub Actions bumped to v5 (Node 24) (#301) —
actions/checkoutandactions/setup-javav4 → v5 acrossrelease.yml,build-and-test.ymlandlinter.yml, clearing the Node.js 20 / setup-java v4 deprecation annotations.linter.ymlcheckout stays SHA-pinned. - Reverted the web preview cleanup change from #306 (3ed47c1).
- Version bumped to 3.0.0 (
pom.xml,Version.java).
Installation
Maven:
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dashscope-sdk-java</artifactId>
<version>3.0.0</version>
</dependency>Gradle:
implementation 'com.alibaba:dashscope-sdk-java:3.0.0'Requires JDK 8+. If 3.0.0 is not yet resolvable, the Maven Central deployment is still being published/synced — please check back shortly.
Contributors
Thanks to everyone who contributed to this release:
New Contributors
Full Changelog: v2.23.8...v3.0.0
v2.23.8
Release Notes
🚀 Highlights
- Stable, network-free tokenizer tests in CI: the Qwen tokenizer vocabulary (
qwen.tiktoken) is now pre-downloaded into a SHA256-verified local cache beforemvn testruns, eliminating flaky test failures caused by on-demand ModelScope downloads from overseas runners (#297). - Maintenance release: no runtime/API changes compared to 2.23.7 — upgrading is safe and requires no code changes.
🔧 CI & Chore
- Pre-download Qwen tokenizer vocab before tests (#297):
- Since 2.23.7 (#293),
qwen.tiktokenis no longer bundled in the jars and is fetched from ModelScope on first use. That on-demand download proved flaky from overseas CI runners and could fail unit tests for reasons unrelated to the code under test. - Both the
build-and-testandreleaseworkflows now download the vocab up front into~/.cache/dashscope/tokenizers/qwen.tiktoken, verify it against its expected SHA256 checksum, and retry up to 3 attempts (with curl-level retries and timeouts) before failing the job with a clear error. - As a result, tokenizer tests never touch the network during
mvn test: they resolve the vocab from the verified local cache, making per-PR CI and tag-triggered release runs deterministic.
- Since 2.23.7 (#293),
- Bump SDK version to 2.23.8 (#298): updates
pom.xmlandVersion.java.
⚠️ Breaking Changes
- None. This release only touches CI workflows and version metadata; the SDK's runtime behavior is identical to 2.23.7. The offline-vocab guidance from 2.23.7 still applies: in air-gapped environments, provide the vocab via the
DASHSCOPE_QWEN_VOCABenvironment variable or placeqwen.tiktokenon the classpath.
📦 Installation
Maven:
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dashscope-sdk-java</artifactId>
<version>2.23.8</version>
</dependency>Gradle:
implementation 'com.alibaba:dashscope-sdk-java:2.23.8'👥 Contributors
Thanks to all the contributors who made this release possible:
📝 Full Changelog
v2.23.7
v2.23.7 Release Notes
🚀 Highlights
- Agent Studio usage analytics: new usage summary and trend APIs let you query consumption statistics directly from the SDK (#294).
- Much smaller distribution jars: the Qwen tokenizer vocabulary (
qwen.tiktoken) is no longer bundled in the jars. It is resolved at runtime fromDASHSCOPE_QWEN_VOCAB, the classpath, or a SHA256-verified ModelScope download cached under~/.cache/dashscope/tokenizers(#293).
✨ Features
- agentstudio: add usage summary and trend APIs (#294)
♻️ Refactoring
- tokenizers: stop shipping
qwen.tiktokenin distribution jars; resolve the vocab at runtime via environment variable, classpath, or verified ModelScope download with local cache, mirroring dashscope-sdk-python#237 (#293)
🔧 CI & Chore
- Add automated Maven Central release workflow triggered by
v*tags, gated by themaven-centralenvironment approval; upgrademaven-gpg-pluginto 3.2.7 with loopback pinentry for headless CI signing and add anautoPublishswitch (defaultfalse) to the central publishing plugin (#295) - Bump SDK version to 2.23.7 (#293)
⚠️ Breaking Changes
- No API breaks. Behavioral change for offline environments: since
qwen.tiktokenis no longer bundled,QwenTokenizerneeds network access on first use to download the vocab from ModelScope. In air-gapped/offline setups, provide the vocab via theDASHSCOPE_QWEN_VOCABenvironment variable or placeqwen.tiktokenon the classpath (#293).
📦 Installation
Maven:
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dashscope-sdk-java</artifactId>
<version>2.23.7</version>
</dependency>Gradle:
implementation 'com.alibaba:dashscope-sdk-java:2.23.7'👥 Contributors
Thanks to all the contributors who made this release possible:
📝 Full Changelog
v2.23.6
What's New
🚀 Qwen Live SDK — Realtime WebSocket Conversation API (#290)
A brand-new SDK for building realtime voice conversations with Qwen over WebSocket. The entry point is QwenLiveConversation, which manages a single-connect WebSocket lifecycle with full session management.
Core classes (package com.alibaba.dashscope.audio.live):
QwenLiveConversation— WebSocket session withconnect(),close(),cancel(), andawaitSessionClosed()semanticsQwenLiveConnectionParam— Connection configuration (API key, model, endpoint); readsDASHSCOPE_WEBSOCKET_QWEN_LIVE_BASE_URLenv overrideQwenLiveSessionConfig— Session-level configuration (turn detection, input/output modalities, etc.)QwenLiveResponsesConfig— Model response configurationQwenLiveCallback/QwenLiveCallbackDispatcher— Unified event callbacks with optional ordered async dispatchQwenLiveContext/QwenLiveContextCompaction— Context and context compaction supportQwenLiveDelegation/QwenLiveDelegationType— Client and responses delegation
Key features:
- Byte array (
byte[]) audio input support - Unified
onErrorcallback with optional ordered async dispatch - Guaranteed single
onClosecallback — transport failures during close now deliver the requested close code correctly - Dedicated WebSocket endpoint (no longer shares the Omni base URL)
Samples: QwenLiveQuickStart.java, QwenLiveUsage.java
🔧 Voice Enrollment — Base64 Audio Support
VoiceEnrollmentService now supports base64-encoded audio input for voice cloning, in addition to existing audio formats.
🐛 Bug Fixes
close()now always completes with exactly oneonClosecallback; socket cancellation during close frame rejection no longer causes missed callbacks- Transport failures during a pending close now correctly deliver the requested close code instead of being silently dropped
Full Changelog
Contributors
v2.23.5
v2.23.5
🚀 New Features
AgentStudio Session Mount Support (#288)
- Add
PerToolConfig.paramsfor tool-specific parameters (e.g.knowledge_application_idforsearch_knowledgebasesRAG tool) - Add
SessionResourceto echo provider/entity_id/project_ids/profile_schema for Bailian memory mounts and region/bucket/oss_path for OSS mounts - Add typed
Mountbuilder that extendsLinkedHashMap, compatible with existingList<Map<String, Object>> resourcesparameter - Add wire-level tests to validate Mount field names
🐛 Bug Fixes
Multimodal SSE Event Handling (#285)
- Fix misleading
Result no outputERROR logs when gateway emits successful auxiliary SSE frames without model output - Backfill
requestIdfromx-request-idresponse header variants when response body omitsrequest_id - Propagate request IDs through HTTP/SSE, WebSocket, and audio logs for better failure correlation
- Add regression coverage for header, body, task ID, and unknown fallbacks
👥 Contributors
v2.23.4
What's Changed
🚀 New Features
Agent Model Config: maxTokens/temperature Parameters (#284)
ModelConfiggains optional inference parameters:temperature,max_tokens,enable_thinking,thinking_budget- Added
builder(),toBuilder()andof(id)factory methods model(String)/model(ModelConfig)builder aliases;setModel(String)as alias ofsetModelConfigAgentCreateParamnow validatesmodel.idclient-side- Fixed streaming: tolerate non-object
deltapayload (typed asJsonElementinstead ofJsonObject) - Fixed stream iterator to fail fast on second pass instead of blocking
🔧 Improvements
Image Synthesis: Multimodal Model Check (#283)
- Added
MULTIMODAL_MODEL_PREFIXESconstant for models that only run on multimodal generation endpoints - Implemented
checkMultimodalModelto verify and throw exceptions for multimodal models - Invoked model check in
asyncCall,syncCall, andcallmethods - Updated documentation to clarify multimodal models should use
ImageGenerationclass - Added unit tests for rejecting multimodal models in synchronous calls
📊 Statistics
- 2 PRs merged
- 456 lines added
- 20 new test cases added
🙌 Contributors
Full Changelog: v2.23.3...v2.23.4
v2.23.3
What's Changed
🚀 New Features
Decision Model API Support (#279)
Introduce comprehensive decision model API to support intelligent decision-making scenarios:
-
Core Classes:
DecisionModel- Main entry point for decision model invocationDecisionModelParam- Input parameter configuration with validationDecisionQuestion&DecisionAnswer- Data structures for Q&A interactionsDecisionModelResult- Server response parsingDecisionModelUsage- Token usage statistics
-
Key Capabilities:
- Workspace-scoped base URL resolution
- Support for bare String and Array type state parameters
- Optional true/false description parameters for noul questions
- Comprehensive parameter validation (options count, levels count limits)
- Enhanced error handling and null value checks
-
Documentation: Added usage examples and API documentation links in README
Agent Studio Memory Management (#282)
Complete memory resource family mirroring Claude Managed Agents API:
-
MemoryStores API:
- CRUD operations + archive functionality
memoryStores().create(),list(),retrieve(),update(),delete(),archive()
-
Memories API:
- Nested memory management with optimistic locking
memories().create(),list(),retrieve(),update(),delete()
-
MemoryVersions API:
- Version history and redaction capabilities
memoryVersions().list(),retrieve(),redact()
-
Advanced Features:
- Sync + CompletableFuture support for all operations
- Cursor-based pagination with typed prefixes field
- Client-side depth >= 2 derivation from flat listing
- ApiException with memory 409 conflict codes
- Dotted wire keys support (e.g.,
created_at.gte)
-
Testing: 13 MockWebServer tests covering request shapes, auto-pagination, depth emulation, nested error parsing
🔧 Improvements
Custom Base URL for Encryption (#280)
- Support custom base URL configuration for encryption key fetching
- Enhanced flexibility for different deployment environments
📊 Statistics
- 3 PRs merged
- 2,893 lines added
- 10 new files created
- 13 new test cases added
🙌 Contributors
Full Changelog: v2.23.2...v2.23.3
v2.23.2
What's Changed
Bug Fixes
SSE Streaming Error Handling (#278)
Fixed error handling and status parsing issues in SSE streaming responses. Enhanced OkHttpHttpClient to properly detect and propagate errors during streaming, improved HTTP status code parsing for edge cases, and added comprehensive test coverage for SSE error scenarios.
Features
AgentStudio Session Agent Override (#275)
Session create/update now support the agent override object form (type=agent_with_overrides with system/tools/mcp_servers/skills) in addition to the Agent ID string. Added top-level environment_variables and mcp_configs fields. SessionCreateParam agent field accepts String (backward compatible), override Map, or SessionAgent. SessionUpdateParam adds vaultIds/environmentVariables/agent(patch)/mcpConfigs with delete-override semantics for null sub-fields. New SessionAgent union helper class provides ofString/ofOverride builders.
Audio Model Usage Tokens (#276)
Added tokens field to audio model usage output. RecognitionUsage and SpeechSynthesisUsage now expose token consumption metrics in their usage responses.
Contributors
@luk384090-cloud
@foleydang
@songguocola
Full Changelog: v2.23.1...v2.23.2
v2.23.1
What's Changed
Features
-
MultiModalEmbeddingParam Parameter Enhancements (#273)
Aligned with Python SDK by adding multiple explicit builder fields:dimension(output vector dimension),outputType,fps(video frame sampling rate),instruct(custom task instruction),enableFusion(fuse multiple contents into single vector),resLevel(resolution level),maxVideoFrames(max video frames). Resolves user-reported issue where dimension could not be set when calling Multimodal-Embedding for image vectorization (expected 1152 dimensions, not 1024). Generic.parameter(k, v)channel remains available and takes precedence, ensuring full backward compatibility. -
Omni Model Video Parameter Rename (#274)
Renamed therepresentation_compactparameter for input video in the Omni model.
Contributors
Full Changelog: v2.23.0...v2.23.1
v2.23.0
🚀 Features
-
AgentStudio: Tool Approval, Event Deltas, Session Resources & Security (#270) by @coolsky99
AddedSessionThreadsresource (188 lines), extendedSessionswith new capabilities, and introduced protocol-level support for tool approval, event deltas, and security features. Includes comprehensive test coverage (172 lines). ~1,188 lines of new code across 19 files. -
AgentStudio: Deployment Environment Variables (#271) by @coolsky99
Added environment variable support toDeploymentCreateParamandDeploymentUpdateParam, enabling configuration of deployment environments. -
Audio: Omni Video Compactness & ASR Runtime Context Updates (#269) by @songguocola
Added video compactness support for Omni real-time config and ASR runtimeinput.contextupdates via continue-task. EnhancedRecognitionclass with improved flexibility.
🐛 Fixes
- ASR Phrase Finetune & OSS Upload (#267) by @lzsweb
Fixed ASR phrase finetune options and OSS upload issues. Added extensive test coverage for SDK client tracking headers (TestSdkClientTrackingHeader, 190 lines) and DashScope headers (TestDashScopeHeaders, 215 lines).