> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modelstudio.console.alibabacloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Qwen-TTS non-real-time speech synthesis API reference

> Request parameters and response fields for the non-realtime speech synthesis (Qwen-TTS) API.

<table style={{ display: "table", tableLayout: "fixed", width: "100%" }}>
  <colgroup>
    <col style={{ width: "47.89%" }} />

    <col style={{ width: "52.11%" }} />
  </colgroup>

  <tbody>
    <tr>
      <td>
        ## Request body <span id="58f39efa90jby" /> <span id="7c782df20fkq8" />
      </td>

      <td rowSpan={3}>
        <Tabs>
          <Tab title="Non-streaming output">
            <Tabs>
              <Tab title="Python">
                > In DashScope Python SDK 2.0, non-realtime speech synthesis is called through the `client.audio.tts.http` resource.

                ```python
                # Install the latest version of the DashScope SDK
                import os
                import dashscope

                # The following is the configuration for the Singapore region. Replace {WorkspaceId} with your actual workspace ID. The region value varies by region.
                client = dashscope.Client(
                    # The API keys for Singapore and Beijing regions are different. Get your API key: https://www.alibabacloud.com/help/model-studio/get-api-key
                    # If the environment variable is not configured, replace the following line with your Model Studio API key: api_key="sk-xxx"
                    api_key=os.getenv("DASHSCOPE_API_KEY"),
                    workspace="{WorkspaceId}",
                    region="ap-southeast-1",
                )

                text = "Let me recommend a T-shirt to everyone. This one is really super nice. The color is very elegant, and it's also a perfect item to match. Everyone can buy it without hesitation. It's truly beautiful and very forgiving on the figure. No matter what body type you have, it will look great. I recommend everyone to place an order."
                result = client.audio.tts.http.synthesize(
                    text,
                    model="qwen3-tts-flash",
                    voice="Cherry"
                )
                print(result.audio_url, result.audio_id, result.expires_at)
                ```
              </Tab>

              <Tab title="Java">
                ```java expandable
                // Install the latest version of the DashScope SDK
                import com.alibaba.dashscope.aigc.multimodalconversation.AudioParameters;
                import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversation;
                import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationParam;
                import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationResult;
                import com.alibaba.dashscope.exception.ApiException;
                import com.alibaba.dashscope.exception.NoApiKeyException;
                import com.alibaba.dashscope.exception.UploadFileException;
                import com.alibaba.dashscope.utils.JsonUtils;
                import com.alibaba.dashscope.utils.Constants;
                public class Main {
                    private static final String MODEL = "qwen3-tts-flash";
                    public static void call() throws ApiException, NoApiKeyException, UploadFileException {
                        MultiModalConversation conv = new MultiModalConversation();
                        MultiModalConversationParam param = MultiModalConversationParam.builder()
                                .model(MODEL)
                                // The API keys for Singapore and Beijing regions are different. Get your API Key: https://www.alibabacloud.com/help/model-studio/get-api-key
                                // If the environment variable is not configured, replace the following line with your Model Studio API key: apiKey("sk-xxx")
                                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                                .text("Today is a wonderful day to build something people love!")
                                .voice(AudioParameters.Voice.CHERRY)
                                .parameter("language_type", "English")
                                .build();
                        MultiModalConversationResult result = conv.call(param);
                        System.out.println(JsonUtils.toJson(result));
                    }
                    public static void main(String[] args) {
                        // Singapore region
                        Constants.baseHttpApiUrl = "https://dashscope-intl.aliyuncs.com/api/v1";
                        try {
                            call();
                        } catch (ApiException | NoApiKeyException | UploadFileException e) {
                            System.out.println(e.getMessage());
                        }
                        System.exit(0);
                    }
                }
                ```
              </Tab>

              <Tab title="curl">
                ```bash
                # ======= IMPORTANT NOTE =======
                # Singapore region
                # The API keys for Singapore and Beijing regions are different. Get your API Key: https://www.alibabacloud.com/help/model-studio/get-api-key
                # If the environment variable is not configured, replace $DASHSCOPE_API_KEY with your Model Studio API key: sk-xxx.
                # === DELETE THIS COMMENT WHEN EXECUTING ===

                curl -X POST 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
                -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
                -H 'Content-Type: application/json' \
                -d '{
                    "model": "qwen3-tts-flash",
                    "input": {
                        "text": "Let me recommend a T-shirt to everyone. This one is really super nice. The color is very elegant, and it's also a perfect item to match. Everyone can buy it without hesitation. It's truly beautiful and very forgiving on the figure. No matter what body type you have, it will look great. I recommend everyone to place an order.",
                        "voice": "Cherry",
                        "language_type": "English"
                    }
                }'
                ```
              </Tab>
            </Tabs>
          </Tab>

          <Tab title="Streaming output">
            <Tabs>
              <Tab title="Python">
                > In DashScope Python SDK 2.0, non-realtime speech synthesis is called through the `client.audio.tts.http` resource.

                ```python
                # DashScope SDK version 2.0.1 or later required
                import os
                import dashscope

                # The following is the configuration for the Singapore region. Replace {WorkspaceId} with your actual workspace ID. The region value varies by region.
                client = dashscope.Client(
                    # The API keys for Singapore and Beijing regions are different. Get your API key: https://www.alibabacloud.com/help/model-studio/get-api-key
                    # If the environment variable is not configured, replace the following line with your Model Studio API key: api_key="sk-xxx"
                    api_key=os.getenv("DASHSCOPE_API_KEY"),
                    workspace="{WorkspaceId}",
                    region="ap-southeast-1",
                )

                text = "Let me recommend a T-shirt to everyone. This one is really super nice. The color is very elegant, and it's also a perfect item to match. Everyone can buy it without hesitation. It's truly beautiful and very forgiving on the figure. No matter what body type you have, it will look great. I recommend everyone to place an order."
                for chunk in client.audio.tts.http.stream(
                    text,
                    model="qwen3-tts-flash",
                    voice="Cherry",
                ):
                    # chunk.audio contains the decoded audio bytes (bytes); when chunk.is_final is True, the chunk carries the URL of the full audio
                    print(chunk)
                ```
              </Tab>

              <Tab title="Java">
                ```java expandable
                // DashScope SDK version 2.19.0 or later required
                import com.alibaba.dashscope.aigc.multimodalconversation.AudioParameters;
                import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversation;
                import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationParam;
                import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationResult;
                import com.alibaba.dashscope.exception.ApiException;
                import com.alibaba.dashscope.exception.NoApiKeyException;
                import com.alibaba.dashscope.exception.UploadFileException;
                import com.alibaba.dashscope.utils.JsonUtils;
                import com.alibaba.dashscope.utils.Constants;
                import io.reactivex.Flowable;
                public class Main {
                    private static final String MODEL = "qwen3-tts-flash";
                    public static void streamCall() throws ApiException, NoApiKeyException, UploadFileException {
                        MultiModalConversation conv = new MultiModalConversation();
                        MultiModalConversationParam param = MultiModalConversationParam.builder()
                                .model(MODEL)
                                // The API keys for Singapore and Beijing regions are different. Get your API Key: https://www.alibabacloud.com/help/model-studio/get-api-key
                                // If the environment variable is not configured, replace the following line with your Model Studio API key: apiKey("sk-xxx")
                                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                                .text("Today is a wonderful day to build something people love!")
                                .voice(AudioParameters.Voice.CHERRY)
                                .parameter("language_type", "English")
                                .build();
                        Flowable<MultiModalConversationResult> result = conv.streamCall(param);
                        result.blockingForEach(r -> {System.out.println(JsonUtils.toJson(r));
                        });
                    }
                    public static void main(String[] args) {
                        // Singapore region
                        Constants.baseHttpApiUrl = "https://dashscope-intl.aliyuncs.com/api/v1";
                        try {
                            streamCall();
                        } catch (ApiException | NoApiKeyException | UploadFileException e) {
                            System.out.println(e.getMessage());
                        }
                        System.exit(0);
                    }
                }
                ```
              </Tab>

              <Tab title="curl">
                ```bash
                # ======= IMPORTANT NOTE =======
                # Singapore region
                # The API keys for Singapore and Beijing regions are different. Get your API Key: https://www.alibabacloud.com/help/model-studio/get-api-key
                # If the environment variable is not configured, replace $DASHSCOPE_API_KEY with your Model Studio API key: sk-xxx.
                # === DELETE THIS COMMENT WHEN EXECUTING ===

                curl -X POST 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
                -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
                -H 'Content-Type: application/json' \
                -H 'X-DashScope-SSE: enable' \
                -d '{
                    "model": "qwen3-tts-flash",
                    "input": {
                        "text": "Let me recommend a T-shirt to you. This one is truly stunning. Its color highlights your elegance and makes it an ideal match for any outfit. You can buy it without hesitation - it looks great on everyone. It flatters all body types. Whether you're tall, short, slim, or curvy, this T-shirt suits you perfectly. We highly recommend ordering it.",
                        "voice": "Cherry",
                        "language_type": "English"
                    }
                }'
                ```
              </Tab>
            </Tabs>

            For real-time playback of Base64-encoded audio, see [Streaming playback](/en/model-studio/qwen-tts-api#qwen-tts-streaming-playback).
          </Tab>
        </Tabs>
      </td>
    </tr>

    <tr>
      <td>
        <strong>model</strong>`string`<strong>(required)</strong>

        The model name. For details, see [Supported models](/en/model-studio/non-realtime-tts-user-guide#d2ad2470a394c).
      </td>
    </tr>

    <tr>
      <td>
        <strong>input</strong>`object`<strong>(required)</strong>

        Input parameters.

        <Accordion title="Properties" defaultOpen>
          <strong>text</strong> `string` <strong>(required)</strong>

          The text to synthesize. Supports multilingual mixed input. The maximum input length is 600 characters.

          <strong>voice</strong> `string` <strong>(required)</strong>

          The voice to use. See [Supported system voices](/en/model-studio/non-realtime-tts-user-guide#bac280ddf5a1u).

          <strong>language\_type</strong> `string` (optional)

          The language of the synthesized audio. Defaults to `Auto`.

          - `Auto`: Use when the input contains multiple languages or the language cannot be determined. The model automatically matches pronunciation for each language segment, though accuracy is not guaranteed.
          - Specific language: Use for single-language text. Specifying the language significantly improves synthesis quality and typically produces better results than `Auto`. Valid values:

            - `Chinese`
            - `English`
            - `German`
            - `Italian`
            - `Portuguese`
            - `Spanish`
            - `Japanese`
            - `Korean`
            - `French`
            - `Russian`
        </Accordion>
      </td>
    </tr>
  </tbody>
</table>

<table style={{ display: "table", tableLayout: "fixed", width: "100%" }}>
  <colgroup>
    <col style={{ width: "47.82%" }} />

    <col style={{ width: "52.18%" }} />
  </colgroup>

  <tbody>
    <tr>
      <td>
        ## Response object (streaming and non-streaming formats are identical) <span id="cd3063363egdc" />
      </td>

      <td rowSpan={7}>
        <CodeGroup>
          ```json Qwen3-TTS-Flash
          {
              "status_code": 200,
              "request_id": "5c63c65c-cad8-4bf4-959d-xxxxxxxxxxxx",
              "code": "",
              "message": "",
              "output": {
                  "text": null,
                  "finish_reason": "stop",
                  "choices": null,
                  "audio": {
                      "data": "",
                      "url": "http://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/1d/ab/20251218/d2033070/39b6d8f2-c0db-4daa-9073-5d27bfb66b78.wav?Expires=1766113409&OSSAccessKeyId=YOUR_ACCESS_KEY_ID&Signature=YOUR_SIGNATURE",
                      "id": "audio_5c63c65c-cad8-4bf4-959d-xxxxxxxxxxxx",
                      "expires_at": 1766113409
                  }
              },
              "usage": {
                  "input_tokens": 0,
                  "output_tokens": 0,
                  "characters": 195
              }
          }
          ```
        </CodeGroup>
      </td>
    </tr>

    <tr>
      <td>
        <strong>status\_code</strong> `integer`

        The HTTP status code as defined in [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-status-codes). Common values:<br />• `200`: Request succeeded.<br />• `400`: Invalid request parameters.<br />• `401`: Unauthorized.<br />• `404`: Resource not found.<br />• `500`: Internal server error.<br />
      </td>
    </tr>

    <tr>
      <td>
        <strong>request\_id</strong> `string`

        A unique identifier for this request. Use it for troubleshooting.
      </td>
    </tr>

    <tr>
      <td>
        <strong>code</strong> `string`

        The error code returned on failure. See [Error codes](/en/model-studio/error-code).
      </td>
    </tr>

    <tr>
      <td>
        <strong>message</strong> `string`

        The error message returned on failure. See [Error codes](/en/model-studio/error-code).
      </td>
    </tr>

    <tr>
      <td>
        <strong>output</strong>`object`

        The model output.

        <Accordion title="Properties" defaultOpen>
          <strong>text</strong>`string`

          Always null. Ignore this field.

          <strong>choices</strong>`string`

          Always null. Ignore this field.

          <strong>finish\_reason</strong>`string`

          The generation status:

          - `null` — Generation is in progress.
          - `stop` — Generation finished normally, or a stop condition was met.

          <strong>audio</strong> `object`

          The audio output from the model.

          <Accordion title="Properties" defaultOpen>
            <strong>url</strong> `string`

            The URL of the complete audio file, valid for 24 hours. In non-streaming mode, returned directly in the response. In streaming mode, only returned in the last chunk of the SSE stream (intermediate chunks do not contain this field).

            <strong>data</strong> `string`

            Base64-encoded audio data. In non-streaming mode, this field is always an empty string (use `url` to get the complete audio file). In streaming mode, intermediate chunks contain Base64-encoded audio segments, while the last chunk returns an empty string (use `url` to get the complete audio).

            <strong>id</strong> `string`

            A unique identifier for the audio.

            <strong>expires\_at</strong> `integer`

            The URL expiration time as a Unix timestamp.
          </Accordion>
        </Accordion>
      </td>
    </tr>

    <tr>
      <td>
        <strong>usage</strong> `object`

        Character usage for this request.

        <Accordion title="Properties" defaultOpen>
          <strong>output\_tokens</strong> `integer`

          The number of tokens consumed by the output audio. For the Qwen3-TTS-Flash model, this field is always 0.

          <strong>input\_tokens</strong> `integer`

          The number of tokens consumed by the input text. For the Qwen3-TTS-Flash model, this field is always 0.

          <strong>characters</strong> `integer`

          The number of characters in the input text. Returned only by the Qwen3-TTS-Flash model.
        </Accordion>
      </td>
    </tr>

    <tr>
      <td>
        <strong>request\_id</strong> `string`

        A unique identifier for this request. Use it for troubleshooting.
      </td>

      <td />
    </tr>
  </tbody>
</table>

## Audio download and playback <span id="qwen-tts-audio-examples" />

Before running the examples, [obtain and configure an API key](/en/model-studio/get-api-key) and [install the DashScope SDK](/en/model-studio/install-sdk). The Python playback example also requires PyAudio and NumPy. See the code comments for PyAudio installation instructions, and install NumPy with `pip install numpy`.

### Download audio (Java) <span id="qwen-tts-audio-download" />

You must import the Gson dependency. Add it using Maven or Gradle:

<Tabs>
  <Tab title="Maven">
    Add the following to `pom.xml`:

    ```xml
    <!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.13.1</version>
    </dependency>
    ```
  </Tab>

  <Tab title="Gradle">
    Add the following to `build.gradle`:

    ```gradle
    // https://mvnrepository.com/artifact/com.google.code.gson/gson
    implementation("com.google.code.gson:gson:2.13.1")
    ```
  </Tab>
</Tabs>

```java expandable
import com.alibaba.dashscope.aigc.multimodalconversation.AudioParameters;
import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversation;
import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationParam;
import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.exception.UploadFileException;
import com.alibaba.dashscope.utils.Constants;

import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URL;

public class Main {
    private static final String MODEL = "qwen3-tts-flash";
    public static void call() throws ApiException, NoApiKeyException, UploadFileException {
        MultiModalConversation conv = new MultiModalConversation();
        MultiModalConversationParam param = MultiModalConversationParam.builder()
                // The API Keys for the Singapore and Beijing regions are different. Get an API Key: https://www.alibabacloud.com/help/model-studio/get-api-key
                // If you have not configured the environment variable, replace the following line with your Model Studio API Key: .apiKey("sk-xxx")
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                .model(MODEL)
                .text("Today is a wonderful day to build something people love!")
                .voice(AudioParameters.Voice.CHERRY)
                .languageType("English") // We recommend matching this with the language of the text for correct pronunciation and natural intonation.
                .build();
        MultiModalConversationResult result = conv.call(param);
        String audioUrl = result.getOutput().getAudio().getUrl();
        System.out.print(audioUrl);

        // Download the audio file to local storage
        try (InputStream in = new URL(audioUrl).openStream();
             FileOutputStream out = new FileOutputStream("downloaded_audio.wav")) {
            byte[] buffer = new byte[1024];
            int bytesRead;
            while ((bytesRead = in.read(buffer)) != -1) {
                out.write(buffer, 0, bytesRead);
            }
            System.out.println("\nAudio file downloaded to: downloaded_audio.wav");
        } catch (Exception e) {
            System.out.println("\nFailed to download audio file: " + e.getMessage());
        }
    }
    public static void main(String[] args) {
        // The following is the configuration for the Singapore region.
        Constants.baseHttpApiUrl = "https://dashscope-intl.aliyuncs.com/api/v1";
        try {
            call();
        } catch (ApiException | NoApiKeyException | UploadFileException e) {
            System.out.println(e.getMessage());
        }
        System.exit(0);
    }
}
```

### Streaming playback <span id="qwen-tts-streaming-playback" />

<Tabs>
  <Tab title="Python">
    ```python expandable
    # coding=utf-8
    #
    # Installation instructions for pyaudio:
    # APPLE Mac OS X
    #   brew install portaudio
    #   pip install pyaudio
    # Debian/Ubuntu
    #   sudo apt-get install python-pyaudio python3-pyaudio
    #   or
    #   pip install pyaudio
    # CentOS
    #   sudo yum install -y portaudio portaudio-devel && pip install pyaudio
    # Microsoft Windows
    #   python -m pip install pyaudio

    import os
    import dashscope
    import pyaudio
    import time

    # The following is the configuration for the Singapore region. Replace {WorkspaceId} with your actual workspace ID. The region value varies by region.
    client = dashscope.Client(
        # The API Keys for the Singapore and Beijing regions are different. Get an API key: https://www.alibabacloud.com/help/model-studio/get-api-key
        # If the environment variable is not configured, replace the following line with your Model Studio API key: api_key="sk-xxx"
        api_key=os.getenv("DASHSCOPE_API_KEY"),
        workspace="{WorkspaceId}",
        region="ap-southeast-1",
    )

    p = pyaudio.PyAudio()
    # Create an audio stream
    stream = p.open(format=pyaudio.paInt16,
                    channels=1,
                    rate=24000,
                    output=True)

    text = "Today is a wonderful day to build something people love!"

    for chunk in client.audio.tts.http.stream(
        text,
        model="qwen3-tts-flash",
        voice="Cherry",
        language_type="English",  # We recommend matching this with the language of the text for correct pronunciation and natural intonation.
    ):
        if chunk.audio:
            # Play the audio data directly (chunk.audio contains the decoded audio bytes)
            stream.write(chunk.audio)
        if chunk.is_final:
            print(f"finish at: {chunk.expires_at}")
    time.sleep(0.8)
    # Clean up resources
    stream.stop_stream()
    stream.close()
    p.terminate()
    ```
  </Tab>

  <Tab title="Java">
    You must import the Gson dependency. Add it using Maven or Gradle:

    <Tabs>
      <Tab title="Maven">
        Add the following to `pom.xml`:

        ```xml
        <!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.13.1</version>
        </dependency>
        ```
      </Tab>

      <Tab title="Gradle">
        Add the following to `build.gradle`:

        ```gradle
        // https://mvnrepository.com/artifact/com.google.code.gson/gson
        implementation("com.google.code.gson:gson:2.13.1")
        ```
      </Tab>
    </Tabs>

    ```java expandable
    // Please install the latest version of the DashScope SDK
    import com.alibaba.dashscope.aigc.multimodalconversation.AudioParameters;
    import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversation;
    import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationParam;
    import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationResult;
    import com.alibaba.dashscope.exception.ApiException;
    import com.alibaba.dashscope.exception.NoApiKeyException;
    import com.alibaba.dashscope.exception.UploadFileException;
    import com.alibaba.dashscope.utils.Constants;
    import io.reactivex.Flowable;
    import javax.sound.sampled.*;
    import java.util.Base64;

    public class Main {
        private static final String MODEL = "qwen3-tts-flash";
        public static void streamCall() throws ApiException, NoApiKeyException, UploadFileException {
            MultiModalConversation conv = new MultiModalConversation();
            MultiModalConversationParam param = MultiModalConversationParam.builder()
                    // The API Keys for the Singapore and Beijing regions are different. Get an API Key: https://www.alibabacloud.com/help/model-studio/get-api-key
                    // If you have not configured the environment variable, replace the following line with your Model Studio API Key: .apiKey("sk-xxx")
                    .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                    .model(MODEL)
                    .text("Today is a wonderful day to build something people love!")
                    .voice(AudioParameters.Voice.CHERRY)
                    .languageType("English") // We recommend matching this with the language of the text for correct pronunciation and natural intonation.
                    .build();
            Flowable<MultiModalConversationResult> result = conv.streamCall(param);
            result.blockingForEach(r -> {
                try {
                    // 1. Get the Base64-encoded audio data
                    String base64Data = r.getOutput().getAudio().getData();
                    byte[] audioBytes = Base64.getDecoder().decode(base64Data);

                    // 2. Configure the audio format (adjust according to the audio format returned by the API)
                    AudioFormat format = new AudioFormat(
                            AudioFormat.Encoding.PCM_SIGNED,
                            24000, // Sample rate (must match the format returned by the API)
                            16,    // Bit depth
                            1,     // Number of channels
                            2,     // Frame size (in bytes)
                            24000, // Frame rate (must match the sample rate)
                            false  // Big-endian
                    );

                    // 3. Play audio data in real time
                    DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
                    try (SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info)) {
                        if (line != null) {
                            line.open(format);
                            line.start();
                            line.write(audioBytes, 0, audioBytes.length);
                            line.drain();
                        }
                    }
                } catch (LineUnavailableException e) {
                    e.printStackTrace();
                }
            });
        }
        public static void main(String[] args) {
            // The following is the configuration for the Singapore region.
            Constants.baseHttpApiUrl = "https://dashscope-intl.aliyuncs.com/api/v1";
            try {
                streamCall();
            } catch (ApiException | NoApiKeyException | UploadFileException e) {
                System.out.println(e.getMessage());
            }
            System.exit(0);
        }
    }
    ```
  </Tab>
</Tabs>
