Skip to main content

Install the Ruby SDK

Install and configure the Model Studio Ruby SDK for speech models.

Prerequisites

Install the SDK

Download dashscope-1.2.0.gem and run the following commands from its directory. The SDK has no third-party gem dependencies.
gem install --local ./dashscope-1.2.0.gem
ruby -r dashscope -e 'puts Gem.loaded_specs.fetch("dashscope").version'

Configure your API key

export DASHSCOPE_API_KEY="<API Key>"
The SDK reads your API key from DASHSCOPE_API_KEY. Set url to the full endpoint when you create the client. For a workspace-specific domain, use an API key, workspace, and endpoint from the same region. Open the Ruby SDK guide for your model, such as Qwen-Audio-Live Ruby SDK.