文档中心
 
全部产品
Search
  • 文档中心
  • Alibaba Cloud Model Studio
  • Panduan Pengguna (model)
  • Model multimodal
  • Penalaran visual

搜索本产品

  • 搜索本产品
  • 全部产品

    Alibaba Cloud Model Studio:Penalaran visual

    文档中心

    Alibaba Cloud Model Studio:Penalaran visual

    更新时间:Feb 05, 2026

    Model penalaran visual terlebih dahulu menghasilkan proses pemikirannya, lalu memberikan jawaban. Pendekatan ini menjadikannya cocok untuk tugas analisis visual kompleks, seperti menyelesaikan soal matematika, menganalisis data grafik, atau memahami video yang rumit.

    Showcase

    QVQ Logo
    Visual Reasoning
    Komponen di atas hanya untuk keperluan demonstrasi dan tidak mengirim permintaan nyata.

    Ketersediaan

    Wilayah yang didukung

    • Singapura: Gunakan API key untuk wilayah ini.

    • Virginia: Gunakan API key untuk wilayah ini.

    • Beijing: Gunakan API key untuk wilayah ini.

    Model yang didukung

    Global

    Dalam mode penyebaran global, titik akhir dan penyimpanan data berlokasi di wilayah AS (Virginia), serta sumber daya komputasi inferensi model dijadwalkan secara dinamis di seluruh dunia.

    • Model hybrid-thinking: qwen3-vl-plus, qwen3-vl-plus-2025-09-23, qwen3-vl-flash, qwen3-vl-flash-2025-10-15

    • Model thinking-only: qwen3-vl-235b-a22b-thinking, qwen3-vl-32b-thinking, qwen3-vl-30b-a3b-thinking, qwen3-vl-8b-thinking

    Internasional

    Dalam mode penyebaran internasional, titik akhir dan penyimpanan data berlokasi di wilayah Singapura, serta sumber daya komputasi inferensi model dijadwalkan secara dinamis di seluruh dunia, tidak termasuk Tiongkok Daratan.

    • Qwen3-VL

      • Model hybrid-thinking: qwen3-vl-plus, qwen3-vl-plus-2025-12-19, qwen3-vl-plus-2025-09-23, qwen3-vl-flash, qwen3-vl-flash-2025-10-15

      • Model thinking-only: qwen3-vl-235b-a22b-thinking, qwen3-vl-32b-thinking, qwen3-vl-30b-a3b-thinking, qwen3-vl-8b-thinking

    • QVQ

      Model thinking-only: seri qvq-max, seri qvq-plus

    AS

    Dalam mode penyebaran AS, titik akhir dan penyimpanan data berlokasi di wilayah AS (Virginia), serta sumber daya komputasi inferensi model terbatas hanya di Amerika Serikat.

    Model hybrid-thinking: qwen3-vl-flash-us, qwen3-vl-flash-2025-10-15-us

    Tiongkok Daratan

    Dalam mode penyebaran Tiongkok Daratan, titik akhir dan penyimpanan data berlokasi di wilayah Beijing, serta sumber daya komputasi inferensi model terbatas hanya di Tiongkok Daratan.

    • Qwen3-VL

      • Model hybrid-thinking: qwen3-vl-plus, qwen3-vl-plus-2025-12-19, qwen3-vl-plus-2025-09-23, qwen3-vl-flash, qwen3-vl-flash-2025-10-15

      • Model thinking-only: qwen3-vl-235b-a22b-thinking, qwen3-vl-32b-thinking, qwen3-vl-30b-a3b-thinking, qwen3-vl-8b-thinking

    • QVQ

      Model thinking-only: seri qvq-max, seri qvq-plus

    • Kimi

      Model hybrid-thinking: kimi-k2.5

    Panduan penggunaan

    • Proses berpikir: Studio Model menyediakan dua jenis model penalaran visual: hybrid-thinking dan thinking-only.

      • Model hybrid-thinking: Anda dapat mengontrol perilaku berpikirnya menggunakan parameter enable_thinking:

        • Atur ke true untuk mengaktifkan proses berpikir. Model akan terlebih dahulu menghasilkan proses berpikirnya, lalu memberikan respons akhir.

        • Atur ke false untuk menonaktifkan proses berpikir. Model akan langsung menghasilkan respons.

      • Model thinking-only: Model ini selalu menghasilkan proses berpikir sebelum memberikan respons, dan perilaku ini tidak dapat dinonaktifkan.

    • Metode output: Karena model penalaran visual mencakup proses berpikir yang detail, kami merekomendasikan menggunakan keluaran streaming untuk mencegah timeout akibat respons yang panjang.

      • Qwen3-VL dan kimi-k2.5 mendukung metode streaming maupun non-streaming.

      • Seri QVQ hanya mendukung keluaran streaming.

    • Rekomendasi prompt sistem:

      • Untuk percakapan satu giliran atau sederhana: Untuk hasil inferensi terbaik, jangan atur System Message. Sampaikan instruksi, seperti pengaturan peran model dan persyaratan format output, melalui User Message.

      • Untuk aplikasi kompleks seperti membangun agen atau mengimplementasikan pemanggilan tool: Gunakan System Message untuk menentukan peran, kemampuan, dan kerangka perilaku model guna memastikan stabilitas dan keandalannya.

    Mulai

    Prasyarat

    • Anda telah membuat API key dan mengekspor API key sebagai variabel lingkungan.

    • Jika Anda memanggil model menggunakan SDK, instal versi terbaru SDK. SDK Python DashScope harus versi 1.24.6 atau lebih baru, dan SDK Java DashScope harus versi 2.21.10 atau lebih baru.

    Contoh berikut menunjukkan cara memanggil model qvq-max untuk menyelesaikan soal matematika dari gambar. Contoh ini menggunakan keluaran streaming untuk mencetak proses berpikir dan respons akhir secara terpisah.

    Kompatibel dengan OpenAI

    Python

    from openai import OpenAI
    import os
    
    # Inisialisasi klien OpenAI
    client = OpenAI(
        # Kunci API berbeda tiap wilayah. Untuk mendapatkannya, kunjungi https://bailian.console.alibabacloud.com/?tab=model#/api-key
        # Jika Anda belum mengonfigurasi variabel lingkungan, ganti baris berikut dengan Kunci API Studio Model Anda: api_key="sk-xxx"
        api_key = os.getenv("DASHSCOPE_API_KEY"),
        # Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/compatible-mode/v1       
        base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
    )
    
    reasoning_content = ""  # Menyimpan seluruh proses berpikir
    answer_content = ""     # Menyimpan seluruh respons
    is_answering = False   # Memeriksa apakah proses berpikir telah selesai dan respons telah dimulai
    
    # Buat permintaan chat completion
    completion = client.chat.completions.create(
        model="qvq-max",  # Contoh ini menggunakan qvq-max. Anda dapat menggantinya dengan nama model lain sesuai kebutuhan.
        messages=[
            {
                "role": "user",
                "content": [
                    {
                        "type": "image_url",
                        "image_url": {
                            "url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"
                        },
                    },
                    {"type": "text", "text": "How do I solve this problem?"},
                ],
            },
        ],
        stream=True,
        # Hapus komentar berikut untuk mengembalikan penggunaan token pada chunk terakhir
        # stream_options={
        #     "include_usage": True
        # }
    )
    
    print("\n" + "=" * 20 + "Thinking process" + "=" * 20 + "\n")
    
    for chunk in completion:
        # Jika chunk.choices kosong, cetak penggunaan
        if not chunk.choices:
            print("\nUsage:")
            print(chunk.usage)
        else:
            delta = chunk.choices[0].delta
            # Cetak proses berpikir
            if hasattr(delta, 'reasoning_content') and delta.reasoning_content != None:
                print(delta.reasoning_content, end='', flush=True)
                reasoning_content += delta.reasoning_content
            else:
                # Mulai merespons
                if delta.content != "" and is_answering is False:
                    print("\n" + "=" * 20 + "Full response" + "=" * 20 + "\n")
                    is_answering = True
                # Cetak proses respons
                print(delta.content, end='', flush=True)
                answer_content += delta.content
    
    # print("=" * 20 + "Full thinking process" + "=" * 20 + "\n")
    # print(reasoning_content)
    # print("=" * 20 + "Full response" + "=" * 20 + "\n")
    # print(answer_content)

    Node.js

    import OpenAI from "openai";
    import process from 'process';
    
    // Inisialisasi klien OpenAI
    const openai = new OpenAI({
        apiKey: process.env.DASHSCOPE_API_KEY, // Baca dari variabel lingkungan. Kunci API berbeda tiap wilayah. Untuk mendapatkannya, kunjungi https://bailian.console.alibabacloud.com/?tab=model#/api-key
        // Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/compatible-mode/v1       
        baseURL: 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1'
    });
    
    let reasoningContent = '';
    let answerContent = '';
    let isAnswering = false;
    
    let messages = [
        {
            role: "user",
            content: [
            { type: "image_url", image_url: { "url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg" } },
            { type: "text", text: "Solve this problem" },
        ]
    }]
    
    async function main() {
        try {
            const stream = await openai.chat.completions.create({
                model: 'qvq-max',
                messages: messages,
                stream: true
            });
    
            console.log('\n' + '='.repeat(20) + 'Thinking process' + '='.repeat(20) + '\n');
    
            for await (const chunk of stream) {
                if (!chunk.choices?.length) {
                    console.log('\nUsage:');
                    console.log(chunk.usage);
                    continue;
                }
    
                const delta = chunk.choices[0].delta;
    
                // Tangani proses berpikir
                if (delta.reasoning_content) {
                    process.stdout.write(delta.reasoning_content);
                    reasoningContent += delta.reasoning_content;
                }
                // Tangani respons formal
                else if (delta.content) {
                    if (!isAnswering) {
                        console.log('\n' + '='.repeat(20) + 'Full response' + '='.repeat(20) + '\n');
                        isAnswering = true;
                    }
                    process.stdout.write(delta.content);
                    answerContent += delta.content;
                }
            }
        } catch (error) {
            console.error('Error:', error);
        }
    }
    
    main();

    Klik untuk melihat proses berpikir dan respons lengkap

    ====================Thinking process====================
    
    Okay, I need to solve this problem about the surface area and volume of a rectangular prism and a cube. First, I need to carefully look at the problem to make sure I understand the requirements for each part.
    
    The problem asks to calculate the surface area and volume of two shapes separately. The first shape is a rectangular prism, and the second is a cube. The units are all in centimeters, and each question is worth 6 points, for a total of 12 points. This looks like a math homework problem, possibly from elementary or middle school geometry.
    
    First, I need to recall the formulas for the surface area and volume of a rectangular prism and a cube. For a rectangular prism, the formula for surface area is: \( 2(ab + bc + ac) \), where a, b, and c are the length, width, and height, respectively. The volume is \( abc \). For a cube, because all side lengths are equal, the surface area is \( 6a^2 \), and the volume is \( a^3 \).
    
    Now, let's look at the first shape, a rectangular prism with given dimensions of length 4 cm, width 3 cm, and height 2 cm. I need to calculate its surface area first. Plugging the values into the formula:
    
    Surface Area = \( 2(4×3 + 3×2 + 4×2) \)
            = \( 2(12 + 6 + 8) \)
            = \( 2×26 \)
            = 52 cm²
    
    Next is the volume, again plugging in the values:
    
    Volume = \( 4×3×2 \)
          = 24 cm³
    
    Then, for the second shape, a cube with a side length of 3 cm. The surface area is calculated as follows:
    
    Surface Area = \( 6×3^2 \)
            = \( 6×9 \)
            = 54 cm²
    
    And the volume is:
    
    Volume = \( 3^3 \)
          = 27 cm³
    
    However, I need to check for any potential mistakes. For example, in calculating the surface area of the rectangular prism, did I miscalculate the area of any face? Or did I make a mistake in the multiplication?
    
    For instance, the three different faces of the rectangular prism are 4×3, 3×2, and 4×2. The areas of these faces are 12, 6, and 8. Adding them up gives 26, and multiplying by 2 gives 52, which should be correct. For the volume, 4×3=12, and then multiplying by 2 is 24, which is also correct.
    
    For the cube, each face is 3×3=9, and with six faces, the total is 54. The volume is 3×3×3=27, which is also correct.
    
    So the final answers should be:
    
    1. The surface area of the rectangular prism is 52 square centimeters, and the volume is 24 cubic centimeters.
    2. The surface area of the cube is 54 square centimeters, and the volume is 27 cubic centimeters.
    
    However, I need to confirm if there is any other hidden information or potential traps in the figures in the problem. For example, sometimes problems might include dashed lines or shaded areas, but in this case, the rectangular prism and cube in the image look standard, with no special markings. Therefore, I believe my calculations are correct.
    
    ====================Full response====================
    
    ### Solution:
    
    **1. Rectangular Prism (length 4 cm, width 3 cm, height 2 cm)**
    - **Surface Area**:
      \[
      2 \times (4 \times 3 + 3 \times 2 + 4 \times 2) = 2 \times (12 + 6 + 8) = 2 \times 26 = 52 \, \text{cm}^2
      \]
    - **Volume**:
      \[
      4 \times 3 \times 2 = 24 \, \text{cm}^3
      \]
    
    **2. Cube (side length 3 cm)**
    - **Surface Area**:
      \[
      6 \times 3^2 = 6 \times 9 = 54 \, \text{cm}^2
      \]
    - **Volume**:
      \[
      3^3 = 27 \, \text{cm}^3
      \]
    
    **Answer:**
    1. The surface area of the rectangular prism is \(52 \, \text{cm}^2\), and its volume is \(24 \, \text{cm}^3\).
    2. The surface area of the cube is \(54 \, \text{cm}^2\), and its volume is \(27 \, \text{cm}^3\).
    

    HTTP

    # ======= IMPORTANT =======
    # Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions    
    # Kunci API berbeda tiap wilayah. Untuk mendapatkannya, kunjungi https://bailian.console.alibabacloud.com/?tab=model#/api-key
    # === Hapus komentar ini sebelum eksekusi ===
    
    curl --location 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions' \
    --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
    --header 'Content-Type: application/json' \
    --data '{
        "model": "qvq-max",
        "messages": [
        {
          "role": "user",
          "content": [
            {
              "type": "image_url",
              "image_url": {
                "url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"
              }
            },
            {
              "type": "text",
              "text": "Solve this problem"
            }
          ]
        }
      ],
        "stream":true,
        "stream_options":{"include_usage":true}
    }'

    Klik untuk melihat proses berpikir dan respons lengkap

    data: {"choices":[{"delta":{"content":null,"role":"assistant","reasoning_content":""},"index":0,"logprobs":null,"finish_reason":null}],"object":"chat.completion.chunk","usage":null,"created":1742983020,"system_fingerprint":null,"model":"qvq-max","id":"chatcmpl-ab4f3963-2c2a-9291-bda2-65d5b325f435"}
    
    data: {"choices":[{"finish_reason":null,"delta":{"content":null,"reasoning_content":"Okay"},"index":0,"logprobs":null}],"object":"chat.completion.chunk","usage":null,"created":1742983020,"system_fingerprint":null,"model":"qvq-max","id":"chatcmpl-ab4f3963-2c2a-9291-bda2-65d5b325f435"}
    
    data: {"choices":[{"delta":{"content":null,"reasoning_content":","},"finish_reason":null,"index":0,"logprobs":null}],"object":"chat.completion.chunk","usage":null,"created":1742983020,"system_fingerprint":null,"model":"qvq-max","id":"chatcmpl-ab4f3963-2c2a-9291-bda2-65d5b325f435"}
    
    data: {"choices":[{"delta":{"content":null,"reasoning_content":" I am now"},"finish_reason":null,"index":0,"logprobs":null}],"object":"chat.completion.chunk","usage":null,"created":1742983020,"system_fingerprint":null,"model":"qvq-max","id":"chatcmpl-ab4f3963-2c2a-9291-bda2-65d5b325f435"}
    
    data: {"choices":[{"delta":{"content":null,"reasoning_content":" going to"},"finish_reason":null,"index":0,"logprobs":null}],"object":"chat.completion.chunk","usage":null,"created":1742983020,"system_fingerprint":null,"model":"qvq-max","id":"chatcmpl-ab4f3963-2c2a-9291-bda2-65d5b325f435"}
    
    data: {"choices":[{"delta":{"content":null,"reasoning_content":" solve"},"finish_reason":null,"index":0,"logprobs":null}],"object":"chat.completion.chunk","usage":null,"created":1742983020,"system_fingerprint":null,"model":"qvq-max","id":"chatcmpl-ab4f3963-2c2a-9291-bda2-65d5b325f435"}
    .....
    data: {"choices":[{"delta":{"content":"square "},"finish_reason":null,"index":0,"logprobs":null}],"object":"chat.completion.chunk","usage":null,"created":1742983095,"system_fingerprint":null,"model":"qvq-max","id":"chatcmpl-23d30959-42b4-9f24-b7ab-1bb0f72ce265"}
    
    data: {"choices":[{"delta":{"content":"centimeters"},"finish_reason":null,"index":0,"logprobs":null}],"object":"chat.completion.chunk","usage":null,"created":1742983095,"system_fingerprint":null,"model":"qvq-max","id":"chatcmpl-23d30959-42b4-9f24-b7ab-1bb0f72ce265"}
    
    data: {"choices":[{"finish_reason":"stop","delta":{"content":"","reasoning_content":null},"index":0,"logprobs":null}],"object":"chat.completion.chunk","usage":null,"created":1742983095,"system_fingerprint":null,"model":"qvq-max","id":"chatcmpl-23d30959-42b4-9f24-b7ab-1bb0f72ce265"}
    
    data: {"choices":[],"object":"chat.completion.chunk","usage":{"prompt_tokens":544,"completion_tokens":590,"total_tokens":1134,"completion_tokens_details":{"text_tokens":590},"prompt_tokens_details":{"text_tokens":24,"image_tokens":520}},"created":1742983095,"system_fingerprint":null,"model":"qvq-max","id":"chatcmpl-23d30959-42b4-9f24-b7ab-1bb0f72ce265"}
    
    data: [DONE]

    DashScope

    Catatan

    Saat memanggil model QVQ menggunakan DashScope:

    • Parameter incremental_output secara default bernilai true dan tidak dapat diatur ke false. Hanya keluaran streaming inkremental yang didukung.

    • Parameter result_format secara default bernilai "message" dan tidak dapat diatur ke "text".

    Python

    import os
    import dashscope
    from dashscope import MultiModalConversation
    
    # Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/api/v1      
    dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'
    messages = [
        {
            "role": "user",
            "content": [
                {"image": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"},
                {"text": "How do I solve this problem?"}
            ]
        }
    ]
    
    response = MultiModalConversation.call(
        # Kunci API berbeda tiap wilayah. Untuk mendapatkannya, kunjungi https://bailian.console.alibabacloud.com/?tab=model#/api-key
        # Jika variabel lingkungan belum dikonfigurasi, ganti baris berikut dengan Kunci API Studio Model Anda: api_key="sk-xxx",
        api_key=os.getenv('DASHSCOPE_API_KEY'),
        model="qvq-max",  # Contoh ini menggunakan qvq-max. Anda dapat menggantinya dengan nama model lain sesuai kebutuhan.
        messages=messages,
        stream=True,
    )
    
    # Menyimpan seluruh proses berpikir
    reasoning_content = ""
    # Menyimpan seluruh respons
    answer_content = ""
    # Memeriksa apakah proses berpikir telah selesai dan respons telah dimulai
    is_answering = False
    
    print("=" * 20 + "Thinking process" + "=" * 20)
    
    for chunk in response:
        # Jika proses berpikir dan respons keduanya kosong, abaikan
        message = chunk.output.choices[0].message
        reasoning_content_chunk = message.get("reasoning_content", None)
        if (chunk.output.choices[0].message.content == [] and
            reasoning_content_chunk == ""):
            pass
        else:
            # Jika saat ini sedang dalam proses berpikir
            if reasoning_content_chunk != None and chunk.output.choices[0].message.content == []:
                print(chunk.output.choices[0].message.reasoning_content, end="")
                reasoning_content += chunk.output.choices[0].message.reasoning_content
            # Jika saat ini sedang dalam proses respons
            elif chunk.output.choices[0].message.content != []:
                if not is_answering:
                    print("\n" + "=" * 20 + "Full response" + "=" * 20)
                    is_answering = True
                print(chunk.output.choices[0].message.content[0]["text"], end="")
                answer_content += chunk.output.choices[0].message.content[0]["text"]
    
    # Untuk mencetak seluruh proses berpikir dan respons, hapus komentar dan jalankan kode berikut
    # print("=" * 20 + "Full thinking process" + "=" * 20 + "\n")
    # print(f"{reasoning_content}")
    # print("=" * 20 + "Full response" + "=" * 20 + "\n")
    # print(f"{answer_content}")

    Klik untuk melihat proses berpikir dan respons lengkap

    ====================Thinking process====================
    Okay, I need to solve this problem about the surface area and volume of a rectangular prism and a cube. First, I need to carefully look at the problem to make sure I understand the requirements for each part.
    
    The problem asks to calculate the surface area and volume of two shapes separately. The first shape is a rectangular prism, and the second is a cube. The units are all in centimeters, and each question is worth 6 points, for a total of 12 points. This looks like a math homework problem, possibly from elementary or middle school geometry.
    
    First, I need to recall the formulas for the surface area and volume of a rectangular prism and a cube. For a rectangular prism, the formula for surface area is: \( Area = 2(ab + bc + ac) \), where a, b, and c are the length, width, and height, respectively. The volume is: \( Volume = abc \). For a cube, because all side lengths are equal, the surface area is: \( Area = 6a^2 \), and the volume is: \( Volume = a^3 \).
    
    Now, let's look at the first shape, a rectangular prism with given dimensions of length 4 cm, width 3 cm, and height 2 cm. I need to first confirm that these values correspond correctly to the variables in the formula. Usually, the three dimensions of a rectangular prism can be named arbitrarily, but for convenience, we can consider the longest side as the length, the middle one as the width, and the shortest as the height. However, in this case, the problem has clearly labeled the lengths of each side, so I can use them directly.
    
    Next, I'll calculate the surface area of the first rectangular prism. Plugging the values into the formula:
    
    \( Area = 2(4×3 + 3×2 + 4×2) \)
    
    First, calculate each term inside the parentheses:
    
    \( 4×3 = 12 \)
    \( 3×2 = 6 \)
    \( 4×2 = 8 \)
    
    Then, add these results together:
    
    \( 12 + 6 + 8 = 26 \)
    
    And multiply by 2:
    
    \( 2 × 26 = 52 \)
    
    So, the surface area of the first rectangular prism is 52 square centimeters.
    
    Next, calculate the volume:
    
    \( Volume = 4 × 3 × 2 = 24 \)
    
    So, the volume is 24 cubic centimeters.
    
    Now, let's look at the second shape, a cube with all side lengths of 3 cm. Therefore, the surface area calculation is:
    
    \( Area = 6 × 3^2 = 6 × 9 = 54 \)
    
    And the volume is:
    
    \( Volume = 3^3 = 27 \)
    
    So, the surface area of the cube is 54 square centimeters, and the volume is 27 cubic centimeters.
    
    During the calculation, I need to pay attention to the consistency of units. The unit given in the problem is centimeters, so the final results should be in square centimeters and cubic centimeters. Also, I need to ensure there are no calculation errors, such as the order of multiplication and addition, especially when calculating the surface area of the rectangular prism, where it's easy to miss a term or make a calculation mistake.
    
    Additionally, I'll check for any other possible misunderstandings, such as whether the length, width, and height are correctly identified. But in this problem, because the lengths of each side are clearly labeled, this should not be an issue. Also, for the cube, all side lengths are equal, so there's no complexity from different side lengths.
    
    To summarize, the surface area of the first rectangular prism is 52 square centimeters, and its volume is 24 cubic centimeters. The surface area of the second cube is 54 square centimeters, and its volume is 27 cubic centimeters.
    
    ====================Full response====================
    ### Solution:
    
    **1. Rectangular Prism (length 4 cm, width 3 cm, height 2 cm)**
    
    - **Surface Area**:
      \[
      Area = 2(ab + bc + ac) = 2(4×3 + 3×2 + 4×2) = 2(12 + 6 + 8) = 2×26 = 52 \, \text{cm}^2
      \]
    
    - **Volume**:
      \[
      Volume = abc = 4×3×2 = 24 \, \text{cm}^3
      \]
    
    **2. Cube (side length 3 cm)**
    
    - **Surface Area**:
      \[
      Area = 6a^2 = 6×3^2 = 6×9 = 54 \, \text{cm}^2
      \]
    
    - **Volume**:
      \[
      Volume = a^3 = 3^3 = 27 \, \text{cm}^3
      \]
    
    **Answer:**
    1. The surface area of the rectangular prism is \(52 \, \text{cm}^2\), and its volume is \(24 \, \text{cm}^3\).
    2. The surface area of the cube is \(54 \, \text{cm}^2\), and its volume is \(27 \, \text{cm}^3\).
    

    Java

    // Versi SDK DashScope >= 2.19.0
    import java.util.*;
    
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    
    import com.alibaba.dashscope.common.Role;
    import com.alibaba.dashscope.exception.ApiException;
    import com.alibaba.dashscope.exception.NoApiKeyException;
    import io.reactivex.Flowable;
    
    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.common.MultiModalMessage;
    import com.alibaba.dashscope.exception.UploadFileException;
    import com.alibaba.dashscope.exception.InputRequiredException;
    import java.lang.System;
    import com.alibaba.dashscope.utils.Constants;
    
    public class Main {
        static {
           // Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/api/v1      
            Constants.baseHttpApiUrl="https://dashscope-intl.aliyuncs.com/api/v1";
        }
        private static final Logger logger = LoggerFactory.getLogger(Main.class);
        private static StringBuilder reasoningContent = new StringBuilder();
        private static StringBuilder finalContent = new StringBuilder();
        private static boolean isFirstPrint = true;
    
        private static void handleGenerationResult(MultiModalConversationResult message) {
            String re = message.getOutput().getChoices().get(0).getMessage().getReasoningContent();
            String reasoning = Objects.isNull(re)?"":re; // Nilai default
    
            List<Map<String, Object>> content = message.getOutput().getChoices().get(0).getMessage().getContent();
            if (!reasoning.isEmpty()) {
                reasoningContent.append(reasoning);
                if (isFirstPrint) {
                    System.out.println("====================Thinking process====================");
                    isFirstPrint = false;
                }
                System.out.print(reasoning);
            }
    
            if (Objects.nonNull(content) && !content.isEmpty()) {
                Object text = content.get(0).get("text");
                finalContent.append(content.get(0).get("text"));
                if (!isFirstPrint) {
                    System.out.println("\n====================Full response====================");
                    isFirstPrint = true;
                }
                System.out.print(text);
            }
        }
        public static MultiModalConversationParam buildMultiModalConversationParam(MultiModalMessage Msg)  {
            return MultiModalConversationParam.builder()
                    // Kunci API berbeda tiap wilayah. Untuk mendapatkannya, kunjungi https://bailian.console.alibabacloud.com/?tab=model#/api-key
                    // Jika Anda belum mengonfigurasi variabel lingkungan, ganti baris berikut dengan Kunci API Studio Model Anda: .apiKey("sk-xxx")
                    .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                    // Contoh ini menggunakan qvq-max. Anda dapat menggantinya dengan nama model lain sesuai kebutuhan.
                    .model("qvq-max")
                    .messages(Arrays.asList(Msg))
                    .incrementalOutput(true)
                    .build();
        }
    
        public static void streamCallWithMessage(MultiModalConversation conv, MultiModalMessage Msg)
                throws NoApiKeyException, ApiException, InputRequiredException, UploadFileException {
            MultiModalConversationParam param = buildMultiModalConversationParam(Msg);
            Flowable<MultiModalConversationResult> result = conv.streamCall(param);
            result.blockingForEach(message -> {
                handleGenerationResult(message);
            });
        }
        public static void main(String[] args) {
            try {
                MultiModalConversation conv = new MultiModalConversation();
                MultiModalMessage userMsg = MultiModalMessage.builder()
                        .role(Role.USER.getValue())
                        .content(Arrays.asList(Collections.singletonMap("image", "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"),
                                Collections.singletonMap("text", "Solve this problem")))
                        .build();
                streamCallWithMessage(conv, userMsg);
    //             Cetak hasil akhir
    //            if (reasoningContent.length() > 0) {
    //                System.out.println("\n====================Full response====================");
    //                System.out.println(finalContent.toString());
    //            }
            } catch (ApiException | NoApiKeyException | UploadFileException | InputRequiredException e) {
                logger.error("An exception occurred: {}", e.getMessage());
            }
            System.exit(0);
        }
    }

    Klik untuk melihat proses berpikir dan respons lengkap

    ====================Thinking process====================
    Hmm, I need to solve this problem, which is to calculate the surface area and volume of two shapes. First, I need to carefully examine the image provided in the problem. The first shape is a rectangular prism, and the second is a cube. The problem asks to calculate their surface area and volume separately, with units in centimeters.
    
    Let's look at the first shape, the rectangular prism. Its dimensions should be length, width, and height. According to the labels on the image, the length is 4 cm, the width is 3 cm, and the height is 2 cm. Right? I remember the formula for the surface area of a rectangular prism is 2 times (length × width + length × height + width × height). And the volume is length times width times height. Let me double-check if the formula is correct. Yes, the surface area is indeed the sum of the areas of the six faces, and because opposite faces have equal areas, this formula is correct.
    
    So, plugging in the values, the surface area should be 2×(4×3 + 4×2 + 3×2). First, calculate the terms inside the parentheses: 4×3=12, 4×2=8, 3×2=6. Adding them up gives 12+8+6=26. Then multiplying by 2 gives 52 square centimeters. For the volume, 4×3×2=24 cubic centimeters. This part should be correct.
    
    Next is the second shape, the cube. All its side lengths are 3 cm. The surface area of a cube is 6 times the square of the side length, because it has six identical square faces. The volume is the cube of the side length. So the surface area should be 6×3²=6×9=54 square centimeters. The volume is 3³=27 cubic centimeters. I need to pay attention to the units here. The problem states the unit is cm, so the results should be written in square centimeters and cubic centimeters.
    
    However, I should double-check if I made any mistakes. For example, are the sides of the rectangular prism correctly identified? In the image, the length of the rectangular prism does look longer than its width, so length is 4, width is 3, and height is 2. For the cube, all three dimensions are 3, which is fine. Did I make any calculation errors? For example, in the surface area calculation for the rectangular prism, are the products correct, and is the addition correct? For instance, 4×3=12, 4×2=8, 3×2=6, adding up to 26, and multiplying by 2 is 52, which is correct. The volume 4×3×2=24 is also correct. For the cube, the surface area 6×9=54 and volume 27 are also correct.
    
    One thing to note is the units. The problem clearly states the unit is cm, so I should add the correct unit symbols to the answers. Also, the problem states that each question is worth 6 points, for a total of 12 points, but there are only two questions, so each is worth 6 points. This doesn't affect the calculation process, but it's a reminder not to miss any steps or units.
    
    To summarize, the surface area of the first shape is 52 square centimeters, and its volume is 24 cubic centimeters; the surface area of the second shape is 54 square centimeters, and its volume is 27 cubic centimeters. That should be it.
    
    ====================Full response====================
    **Answer:**
    
    1. **Rectangular Prism**  
       - **Surface Area**: \(2 \times (4 \times 3 + 4 \times 2 + 3 \times 2) = 2 \times 26 = 52\) square centimeters  
       - **Volume**: \(4 \times 3 \times 2 = 24\) cubic centimeters  
    
    2. **Cube**  
       - **Surface Area**: \(6 \times 3^2 = 6 \times 9 = 54\) square centimeters  
       - **Volume**: \(3^3 = 27\) cubic centimeters  
    
    **Explanation:**  
    - The surface area of a rectangular prism is obtained by calculating the total area of its six faces, and its volume is the product of its length, width, and height.  
    - The surface area of a cube is the sum of the areas of its six identical square faces, and its volume is the cube of its side length.  
    - All units are in centimeters, as required by the problem.

    HTTP

    curl

    # ======= IMPORTANT =======
    # Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation       
    # Kunci API berbeda tiap wilayah. Untuk mendapatkannya, kunjungi https://bailian.console.alibabacloud.com/?tab=model#/api-key
    # === Hapus komentar ini sebelum eksekusi ===
    
    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": "qvq-max",
        "input":{
            "messages":[
                {
                    "role": "user",
                    "content": [
                        {"image": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"},
                        {"text": "Solve this problem"}
                    ]
                }
            ]
        }
    }'

    Klik untuk melihat proses berpikir dan respons lengkap

    id:1
    event:result
    :HTTP_STATUS/200
    data:{"output":{"choices":[{"message":{"content":[],"reasoning_content":"Okay","role":"assistant"},"finish_reason":"null"}]},"usage":{"total_tokens":547,"input_tokens_details":{"image_tokens":520,"text_tokens":24},"output_tokens":3,"input_tokens":544,"output_tokens_details":{"text_tokens":3},"image_tokens":520},"request_id":"f361ae45-fbef-9387-9f35-1269780e0864"}
    
    id:2
    event:result
    :HTTP_STATUS/200
    data:{"output":{"choices":[{"message":{"content":[],"reasoning_content":",","role":"assistant"},"finish_reason":"null"}]},"usage":{"total_tokens":548,"input_tokens_details":{"image_tokens":520,"text_tokens":24},"output_tokens":4,"input_tokens":544,"output_tokens_details":{"text_tokens":4},"image_tokens":520},"request_id":"f361ae45-fbef-9387-9f35-1269780e0864"}
    
    id:3
    event:result
    :HTTP_STATUS/200
    data:{"output":{"choices":[{"message":{"content":[],"reasoning_content":" I am now","role":"assistant"},"finish_reason":"null"}]},"usage":{"total_tokens":549,"input_tokens_details":{"image_tokens":520,"text_tokens":24},"output_tokens":5,"input_tokens":544,"output_tokens_details":{"text_tokens":5},"image_tokens":520},"request_id":"f361ae45-fbef-9387-9f35-1269780e0864"}
    .....
    id:566
    event:result
    :HTTP_STATUS/200
    data:{"output":{"choices":[{"message":{"content":[{"text":"square"}],"role":"assistant"},"finish_reason":"null"}]},"usage":{"total_tokens":1132,"input_tokens_details":{"image_tokens":520,"text_tokens":24},"output_tokens":588,"input_tokens":544,"output_tokens_details":{"text_tokens":588},"image_tokens":520},"request_id":"758b0356-653b-98ac-b4d3-f812437ba1ec"}
    
    id:567
    event:result
    :HTTP_STATUS/200
    data:{"output":{"choices":[{"message":{"content":[{"text":"centimeters"}],"role":"assistant"},"finish_reason":"null"}]},"usage":{"total_tokens":1133,"input_tokens_details":{"image_tokens":520,"text_tokens":24},"output_tokens":589,"input_tokens":544,"output_tokens_details":{"text_tokens":589},"image_tokens":520},"request_id":"758b0356-653b-98ac-b4d3-f812437ba1ec"}
    
    id:568
    event:result
    :HTTP_STATUS/200
    data:{"output":{"choices":[{"message":{"content":[],"role":"assistant"},"finish_reason":"stop"}]},"usage":{"total_tokens":1134,"input_tokens_details":{"image_tokens":520,"text_tokens":24},"output_tokens":590,"input_tokens":544,"output_tokens_details":{"text_tokens":590},"image_tokens":520},"request_id":"758b0356-653b-98ac-b4d3-f812437ba1ec"}

    Kemampuan inti

    Mengaktifkan atau menonaktifkan proses berpikir

    Untuk skenario yang memerlukan proses berpikir detail, seperti menyelesaikan soal atau menganalisis laporan, Anda dapat mengaktifkan mode berpikir menggunakan parameter enable_thinking. Contoh berikut menunjukkan cara melakukannya.

    Penting

    Parameter enable_thinking hanya didukung oleh seri qwen3-vl-plus, qwen3-vl-flash, dan kimi-k2.5.

    Kompatibel dengan OpenAI

    Parameter enable_thinking dan thinking_budget bukanlah parameter standar OpenAI. Cara meneruskan parameter ini berbeda-beda tergantung bahasa pemrograman:

    • SDK Python: Anda harus meneruskannya melalui dictionary extra_body.

    • SDK Node.js: Anda dapat meneruskannya langsung sebagai parameter tingkat atas.

    import os
    from openai import OpenAI
    
    client = OpenAI(
        # Kunci API berbeda tiap wilayah. Untuk mendapatkan kunci API, kunjungi https://www.alibabacloud.com/help/en/model-studio/get-api-key
        api_key=os.getenv("DASHSCOPE_API_KEY"),
        # Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah AS (Virginia), ganti base_url dengan https://dashscope-us.aliyuncs.com/compatible-mode/v1
        # Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/compatible-mode/v1
        base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
    )
    
    reasoning_content = ""  # Menyimpan seluruh proses berpikir
    answer_content = ""     # Menyimpan seluruh respons
    is_answering = False   # Memeriksa apakah proses berpikir telah selesai dan respons telah dimulai
    enable_thinking = True
    # Buat permintaan chat completion
    completion = client.chat.completions.create(
        model="qwen3-vl-plus",
        messages=[
            {
                "role": "user",
                "content": [
                    {
                        "type": "image_url",
                        "image_url": {
                            "url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"
                        },
                    },
                    {"type": "text", "text": "How do I solve this problem?"},
                ],
            },
        ],
        stream=True,
        # Parameter enable_thinking mengaktifkan proses berpikir. Parameter thinking_budget menetapkan jumlah maksimum token untuk proses penalaran.
        # Untuk qwen3-vl-plus dan qwen3-vl-flash, Anda dapat menggunakan enable_thinking untuk mengaktifkan atau menonaktifkan proses berpikir. Untuk model dengan akhiran 'thinking', seperti qwen3-vl-235b-a22b-thinking, enable_thinking hanya dapat diatur ke true. Parameter ini tidak berlaku untuk model Qwen-VL lainnya.
        extra_body={
            'enable_thinking': enable_thinking
            },
    
        # Hapus komentar berikut untuk mengembalikan penggunaan token pada chunk terakhir
        # stream_options={
        #     "include_usage": True
        # }
    )
    
    if enable_thinking:
        print("\n" + "=" * 20 + "Thinking process" + "=" * 20 + "\n")
    
    for chunk in completion:
        # Jika chunk.choices kosong, cetak penggunaan
        if not chunk.choices:
            print("\nUsage:")
            print(chunk.usage)
        else:
            delta = chunk.choices[0].delta
            # Cetak proses berpikir
            if hasattr(delta, 'reasoning_content') and delta.reasoning_content != None:
                print(delta.reasoning_content, end='', flush=True)
                reasoning_content += delta.reasoning_content
            else:
                # Mulai merespons
                if delta.content != "" and is_answering is False:
                    print("\n" + "=" * 20 + "Full response" + "=" * 20 + "\n")
                    is_answering = True
                # Cetak proses respons
                print(delta.content, end='', flush=True)
                answer_content += delta.content
    
    # print("=" * 20 + "Full thinking process" + "=" * 20 + "\n")
    # print(reasoning_content)
    # print("=" * 20 + "Full response" + "=" * 20 + "\n")
    # print(answer_content)
    import OpenAI from "openai";
    
    // Inisialisasi klien OpenAI
    const openai = new OpenAI({
      // Kunci API berbeda tiap wilayah. Untuk mendapatkan kunci API, kunjungi https://www.alibabacloud.com/help/en/model-studio/get-api-key
      // Jika Anda belum mengonfigurasi variabel lingkungan, ganti baris berikut dengan Kunci API Studio Model Anda: apiKey: "sk-xxx"
      apiKey: process.env.DASHSCOPE_API_KEY,
     // Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah AS (Virginia), ganti base_url dengan https://dashscope-us.aliyuncs.com/compatible-mode/v1
     //  Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/compatible-mode/v1
      baseURL: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
    });
    
    let reasoningContent = '';
    let answerContent = '';
    let isAnswering = false;
    let enableThinking = true;
    
    let messages = [
        {
            role: "user",
            content: [
            { type: "image_url", image_url: { "url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg" } },
            { type: "text", text: "Solve this problem" },
        ]
    }]
    
    async function main() {
        try {
            const stream = await openai.chat.completions.create({
                model: 'qwen3-vl-plus',
                messages: messages,
                stream: true,
              // Catatan: Di SDK Node.js, parameter non-standar seperti enableThinking diteruskan sebagai properti tingkat atas dan tidak perlu dimasukkan ke extra_body.
              enable_thinking: enableThinking
    
            });
    
            if (enableThinking){console.log('\n' + '='.repeat(20) + 'Thinking process' + '='.repeat(20) + '\n');}
    
            for await (const chunk of stream) {
                if (!chunk.choices?.length) {
                    console.log('\nUsage:');
                    console.log(chunk.usage);
                    continue;
                }
    
                const delta = chunk.choices[0].delta;
    
                // Tangani proses berpikir
                if (delta.reasoning_content) {
                    process.stdout.write(delta.reasoning_content);
                    reasoningContent += delta.reasoning_content;
                }
                // Tangani respons formal
                else if (delta.content) {
                    if (!isAnswering) {
                        console.log('\n' + '='.repeat(20) + 'Full response' + '='.repeat(20) + '\n');
                        isAnswering = true;
                    }
                    process.stdout.write(delta.content);
                    answerContent += delta.content;
                }
            }
        } catch (error) {
            console.error('Error:', error);
        }
    }
    
    main();
    # ======= IMPORTANT =======
    # Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah AS (Virginia), ganti base_url dengan https://dashscope-us.aliyuncs.com/compatible-mode/v1/chat/completions
    # Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions
    # Kunci API berbeda tiap wilayah. Untuk mendapatkan kunci API, kunjungi https://www.alibabacloud.com/help/en/model-studio/get-api-key
    # === Hapus komentar ini sebelum eksekusi ===
    
    curl --location 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions' \
    --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
    --header 'Content-Type: application/json' \
    --data '{
        "model": "qwen3-vl-plus",
        "messages": [
        {
          "role": "user",
          "content": [
            {
              "type": "image_url",
              "image_url": {
                "url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"
              }
            },
            {
              "type": "text",
              "text": "Solve this problem"
            }
          ]
        }
      ],
        "stream":true,
        "stream_options":{"include_usage":true},
        "enable_thinking": true
    }'

    DashScope

    import os
    import dashscope
    from dashscope import MultiModalConversation
    
    # Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah AS (Virginia), ganti base_url dengan https://dashscope-us.aliyuncs.com/api/v1
    # Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/api/v1
    dashscope.base_http_api_url = "https://dashscope-intl.aliyuncs.com/api/v1"
    
    enable_thinking = True
    
    messages = [
        {
            "role": "user",
            "content": [
                {"image": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"},
                {"text": "How do I solve this problem?"}
            ]
        }
    ]
    
    response = MultiModalConversation.call(
        # Jika Anda belum mengonfigurasi variabel lingkungan, ganti baris berikut dengan Kunci API Studio Model Anda: api_key="sk-xxx",
        # Kunci API berbeda tiap wilayah. Untuk mendapatkan kunci API, kunjungi https://www.alibabacloud.com/help/en/model-studio/get-api-key
        api_key=os.getenv('DASHSCOPE_API_KEY'),
        model="qwen3-vl-plus",  
        messages=messages,
        stream=True,
        # Parameter enable_thinking mengaktifkan proses berpikir.
        # Untuk qwen3-vl-plus dan qwen3-vl-flash, Anda dapat menggunakan enable_thinking untuk mengaktifkan atau menonaktifkan proses berpikir. Untuk model dengan akhiran 'thinking', seperti qwen3-vl-235b-a22b-thinking, enable_thinking hanya dapat diatur ke true. Parameter ini tidak berlaku untuk model Qwen-VL lainnya.
        enable_thinking=enable_thinking
    
    )
    
    # Menyimpan seluruh proses berpikir
    reasoning_content = ""
    # Menyimpan seluruh respons
    answer_content = ""
    # Memeriksa apakah proses berpikir telah selesai dan respons telah dimulai
    is_answering = False
    
    if enable_thinking:
        print("=" * 20 + "Thinking process" + "=" * 20)
    
    for chunk in response:
        # Jika proses berpikir dan respons keduanya kosong, abaikan
        message = chunk.output.choices[0].message
        reasoning_content_chunk = message.get("reasoning_content", None)
        if (chunk.output.choices[0].message.content == [] and
            reasoning_content_chunk == ""):
            pass
        else:
            # Jika saat ini sedang dalam proses berpikir
            if reasoning_content_chunk != None and chunk.output.choices[0].message.content == []:
                print(chunk.output.choices[0].message.reasoning_content, end="")
                reasoning_content += chunk.output.choices[0].message.reasoning_content
            # Jika saat ini sedang dalam proses respons
            elif chunk.output.choices[0].message.content != []:
                if not is_answering:
                    print("\n" + "=" * 20 + "Full response" + "=" * 20)
                    is_answering = True
                print(chunk.output.choices[0].message.content[0]["text"], end="")
                answer_content += chunk.output.choices[0].message.content[0]["text"]
    
    # Untuk mencetak seluruh proses berpikir dan respons, hapus komentar dan jalankan kode berikut
    # print("=" * 20 + "Full thinking process" + "=" * 20 + "\n")
    # print(f"{reasoning_content}")
    # print("=" * 20 + "Full response" + "=" * 20 + "\n")
    # print(f"{answer_content}")
    // Versi SDK DashScope >= 2.21.10
    import java.util.*;
    
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    
    import com.alibaba.dashscope.common.Role;
    import com.alibaba.dashscope.exception.ApiException;
    import com.alibaba.dashscope.exception.NoApiKeyException;
    import io.reactivex.Flowable;
    
    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.common.MultiModalMessage;
    import com.alibaba.dashscope.exception.UploadFileException;
    import com.alibaba.dashscope.exception.InputRequiredException;
    import java.lang.System;
    import com.alibaba.dashscope.utils.Constants;
    
    public class Main {
        // Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah AS (Virginia), ganti base_url dengan https://dashscope-us.aliyuncs.com/api/v1
        // Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/api/v1
        static {Constants.baseHttpApiUrl="https://dashscope-intl.aliyuncs.com/api/v1";}
    
        private static final Logger logger = LoggerFactory.getLogger(Main.class);
        private static StringBuilder reasoningContent = new StringBuilder();
        private static StringBuilder finalContent = new StringBuilder();
        private static boolean isFirstPrint = true;
    
        private static void handleGenerationResult(MultiModalConversationResult message) {
            String re = message.getOutput().getChoices().get(0).getMessage().getReasoningContent();
            String reasoning = Objects.isNull(re)?"":re; // Nilai default
    
            List<Map<String, Object>> content = message.getOutput().getChoices().get(0).getMessage().getContent();
            if (!reasoning.isEmpty()) {
                reasoningContent.append(reasoning);
                if (isFirstPrint) {
                    System.out.println("====================Thinking process====================");
                    isFirstPrint = false;
                }
                System.out.print(reasoning);
            }
    
            if (Objects.nonNull(content) && !content.isEmpty()) {
                Object text = content.get(0).get("text");
                finalContent.append(content.get(0).get("text"));
                if (!isFirstPrint) {
                    System.out.println("\n====================Full response====================");
                    isFirstPrint = true;
                }
                System.out.print(text);
            }
        }
        public static MultiModalConversationParam buildMultiModalConversationParam(MultiModalMessage Msg)  {
            return MultiModalConversationParam.builder()
                    // Jika Anda belum mengonfigurasi variabel lingkungan, ganti baris berikut dengan Kunci API Studio Model Anda: .apiKey("sk-xxx")
                    // Kunci API berbeda tiap wilayah. Untuk mendapatkan kunci API, kunjungi https://www.alibabacloud.com/help/en/model-studio/get-api-key
                    .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                    .model("qwen3-vl-plus")
                    .messages(Arrays.asList(Msg))
                    .enableThinking(true)
                    .incrementalOutput(true)
                    .build();
        }
    
        public static void streamCallWithMessage(MultiModalConversation conv, MultiModalMessage Msg)
                throws NoApiKeyException, ApiException, InputRequiredException, UploadFileException {
            MultiModalConversationParam param = buildMultiModalConversationParam(Msg);
            Flowable<MultiModalConversationResult> result = conv.streamCall(param);
            result.blockingForEach(message -> {
                handleGenerationResult(message);
            });
        }
        public static void main(String[] args) {
            try {
                MultiModalConversation conv = new MultiModalConversation();
                MultiModalMessage userMsg = MultiModalMessage.builder()
                        .role(Role.USER.getValue())
                        .content(Arrays.asList(Collections.singletonMap("image", "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"),
                                Collections.singletonMap("text", "Solve this problem")))
                        .build();
                streamCallWithMessage(conv, userMsg);
    //             Cetak hasil akhir
    //            if (reasoningContent.length() > 0) {
    //                System.out.println("\n====================Full response====================");
    //                System.out.println(finalContent.toString());
    //            }
            } catch (ApiException | NoApiKeyException | UploadFileException | InputRequiredException e) {
                logger.error("An exception occurred: {}", e.getMessage());
            }
            System.exit(0);
        }
    }
    # ======= IMPORTANT =======
    # Kunci API berbeda tiap wilayah. Untuk mendapatkan kunci API, kunjungi https://www.alibabacloud.com/help/en/model-studio/get-api-key
    # Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah AS (Virginia), ganti base_url dengan https://dashscope-us.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation
    # Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation
    # === Hapus komentar ini sebelum eksekusi ===
    
    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-vl-plus",
        "input":{
            "messages":[
                {
                    "role": "user",
                    "content": [
                        {"image": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"},
                        {"text": "Solve this problem"}
                    ]
                }
            ]
        },
        "parameters":{
            "enable_thinking": true,
            "incremental_output": true
        }
    }'

    Batasi panjang proses berpikir

    Untuk mencegah model menghasilkan proses berpikir yang terlalu panjang, gunakan parameter thinking_budget untuk membatasi jumlah maksimum token yang dihasilkan untuk proses berpikir. Jika proses berpikir melebihi batas ini, kontennya dipotong, dan model segera mulai menghasilkan jawaban akhir. Nilai default thinking_budget adalah panjang maksimum rantai-pikiran model tersebut. Lihat Daftar model.

    Penting

    Parameter thinking_budget hanya didukung oleh Qwen3-VL (mode berpikir) dan kimi-k2.5 (mode berpikir).

    Kompatibel dengan OpenAI

    Parameter thinking_budget bukanlah parameter standar OpenAI. Jika Anda menggunakan SDK Python OpenAI, Anda harus meneruskannya melalui extra_body.

    import os
    from openai import OpenAI
    
    client = OpenAI(
        # Kunci API berbeda tiap wilayah. Untuk mendapatkan kunci API, kunjungi https://www.alibabacloud.com/help/en/model-studio/get-api-key
        api_key=os.getenv("DASHSCOPE_API_KEY"),
        # Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah AS (Virginia), ganti base_url dengan https://dashscope-us.aliyuncs.com/compatible-mode/v1
        # Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/compatible-mode/v1
        base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
    )
    
    reasoning_content = ""  # Menyimpan seluruh proses berpikir
    answer_content = ""     # Menyimpan seluruh respons
    is_answering = False   # Memeriksa apakah proses berpikir telah selesai dan respons telah dimulai
    enable_thinking = True
    # Buat permintaan chat completion
    completion = client.chat.completions.create(
        model="qwen3-vl-plus",
        messages=[
            {
                "role": "user",
                "content": [
                    {
                        "type": "image_url",
                        "image_url": {
                            "url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"
                        },
                    },
                    {"type": "text", "text": "How do I solve this problem?"},
                ],
            },
        ],
        stream=True,
        # Parameter enable_thinking mengaktifkan proses berpikir. Parameter thinking_budget menetapkan jumlah maksimum token untuk proses penalaran.
        # Untuk qwen3-vl-plus dan qwen3-vl-flash, Anda dapat menggunakan enable_thinking untuk mengaktifkan atau menonaktifkan proses berpikir. Untuk model dengan akhiran 'thinking', seperti qwen3-vl-235b-a22b-thinking, enable_thinking hanya dapat diatur ke true. Parameter ini tidak berlaku untuk model Qwen-VL lainnya.
        extra_body={
            'enable_thinking': enable_thinking,
            "thinking_budget": 81920},
    
        # Hapus komentar berikut untuk mengembalikan penggunaan token pada chunk terakhir
        # stream_options={
        #     "include_usage": True
        # }
    )
    
    if enable_thinking:
        print("\n" + "=" * 20 + "Thinking process" + "=" * 20 + "\n")
    
    for chunk in completion:
        # Jika chunk.choices kosong, cetak penggunaan
        if not chunk.choices:
            print("\nUsage:")
            print(chunk.usage)
        else:
            delta = chunk.choices[0].delta
            # Cetak proses berpikir
            if hasattr(delta, 'reasoning_content') and delta.reasoning_content != None:
                print(delta.reasoning_content, end='', flush=True)
                reasoning_content += delta.reasoning_content
            else:
                # Mulai merespons
                if delta.content != "" and is_answering is False:
                    print("\n" + "=" * 20 + "Full response" + "=" * 20 + "\n")
                    is_answering = True
                # Cetak proses respons
                print(delta.content, end='', flush=True)
                answer_content += delta.content
    
    # print("=" * 20 + "Full thinking process" + "=" * 20 + "\n")
    # print(reasoning_content)
    # print("=" * 20 + "Full response" + "=" * 20 + "\n")
    # print(answer_content)
    import OpenAI from "openai";
    
    // Inisialisasi klien OpenAI
    const openai = new OpenAI({
      // Kunci API berbeda tiap wilayah. Untuk mendapatkan kunci API, kunjungi https://www.alibabacloud.com/help/en/model-studio/get-api-key
      // Jika Anda belum mengonfigurasi variabel lingkungan, ganti baris berikut dengan Kunci API Studio Model Anda: apiKey: "sk-xxx"
      apiKey: process.env.DASHSCOPE_API_KEY,
      // Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah AS (Virginia), ganti base_url dengan https://dashscope-us.aliyuncs.com/compatible-mode/v1
      // Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/compatible-mode/v1
      baseURL: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
    });
    
    let reasoningContent = '';
    let answerContent = '';
    let isAnswering = false;
    let enableThinking = true;
    
    let messages = [
        {
            role: "user",
            content: [
            { type: "image_url", image_url: { "url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg" } },
            { type: "text", text: "Solve this problem" },
        ]
    }]
    
    async function main() {
        try {
            const stream = await openai.chat.completions.create({
                model: 'qwen3-vl-plus',
                messages: messages,
                stream: true,
              // Catatan: Di SDK Node.js, parameter non-standar seperti enableThinking diteruskan sebagai properti tingkat atas dan tidak perlu dimasukkan ke extra_body.
              enable_thinking: enableThinking,
              thinking_budget: 81920
    
            });
    
            if (enableThinking){console.log('\n' + '='.repeat(20) + 'Thinking process' + '='.repeat(20) + '\n');}
    
            for await (const chunk of stream) {
                if (!chunk.choices?.length) {
                    console.log('\nUsage:');
                    console.log(chunk.usage);
                    continue;
                }
    
                const delta = chunk.choices[0].delta;
    
                // Tangani proses berpikir
                if (delta.reasoning_content) {
                    process.stdout.write(delta.reasoning_content);
                    reasoningContent += delta.reasoning_content;
                }
                // Tangani respons formal
                else if (delta.content) {
                    if (!isAnswering) {
                        console.log('\n' + '='.repeat(20) + 'Full response' + '='.repeat(20) + '\n');
                        isAnswering = true;
                    }
                    process.stdout.write(delta.content);
                    answerContent += delta.content;
                }
            }
        } catch (error) {
            console.error('Error:', error);
        }
    }
    
    main();
    # ======= IMPORTANT =======
    # Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah AS (Virginia), ganti base_url dengan https://dashscope-us.aliyuncs.com/compatible-mode/v1/chat/completions
    # Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions
    # Kunci API berbeda tiap wilayah. Untuk mendapatkan kunci API, kunjungi https://www.alibabacloud.com/help/en/model-studio/get-api-key
    # === Hapus komentar ini sebelum eksekusi ===
    
    curl --location 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions' \
    --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
    --header 'Content-Type: application/json' \
    --data '{
        "model": "qwen3-vl-plus",
        "messages": [
        {
          "role": "user",
          "content": [
            {
              "type": "image_url",
              "image_url": {
                "url": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"
              }
            },
            {
              "type": "text",
              "text": "Solve this problem"
            }
          ]
        }
      ],
        "stream":true,
        "stream_options":{"include_usage":true},
        "enable_thinking": true,
        "thinking_budget": 81920
    }'

    DashScope

    import os
    import dashscope
    from dashscope import MultiModalConversation
    
    # Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah AS (Virginia), ganti base_url dengan https://dashscope-us.aliyuncs.com/api/v1
    # Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/api/v1
    dashscope.base_http_api_url = "https://dashscope-intl.aliyuncs.com/api/v1"
    
    enable_thinking = True
    
    messages = [
        {
            "role": "user",
            "content": [
                {"image": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"},
                {"text": "How do I solve this problem?"}
            ]
        }
    ]
    
    response = MultiModalConversation.call(
        # Jika Anda belum mengonfigurasi variabel lingkungan, ganti baris berikut dengan Kunci API Studio Model Anda: api_key="sk-xxx",
        # Kunci API berbeda tiap wilayah. Untuk mendapatkan kunci API, kunjungi https://www.alibabacloud.com/help/en/model-studio/get-api-key
        api_key=os.getenv('DASHSCOPE_API_KEY'),
        model="qwen3-vl-plus",  
        messages=messages,
        stream=True,
        # Parameter enable_thinking mengaktifkan proses berpikir.
        # Untuk qwen3-vl-plus dan qwen3-vl-flash, Anda dapat menggunakan enable_thinking untuk mengaktifkan atau menonaktifkan proses berpikir. Untuk model dengan akhiran 'thinking', seperti qwen3-vl-235b-a22b-thinking, enable_thinking hanya dapat diatur ke true. Parameter ini tidak berlaku untuk model Qwen-VL lainnya.
        enable_thinking=enable_thinking,
        # Parameter thinking_budget menetapkan jumlah maksimum token untuk proses penalaran.
        thinking_budget=81920,
    
    )
    
    # Menyimpan seluruh proses berpikir
    reasoning_content = ""
    # Menyimpan seluruh respons
    answer_content = ""
    # Memeriksa apakah proses berpikir telah selesai dan respons telah dimulai
    is_answering = False
    
    if enable_thinking:
        print("=" * 20 + "Thinking process" + "=" * 20)
    
    for chunk in response:
        # Jika proses berpikir dan respons keduanya kosong, abaikan
        message = chunk.output.choices[0].message
        reasoning_content_chunk = message.get("reasoning_content", None)
        if (chunk.output.choices[0].message.content == [] and
            reasoning_content_chunk == ""):
            pass
        else:
            # Jika saat ini sedang dalam proses berpikir
            if reasoning_content_chunk != None and chunk.output.choices[0].message.content == []:
                print(chunk.output.choices[0].message.reasoning_content, end="")
                reasoning_content += chunk.output.choices[0].message.reasoning_content
            # Jika saat ini sedang dalam proses respons
            elif chunk.output.choices[0].message.content != []:
                if not is_answering:
                    print("\n" + "=" * 20 + "Full response" + "=" * 20)
                    is_answering = True
                print(chunk.output.choices[0].message.content[0]["text"], end="")
                answer_content += chunk.output.choices[0].message.content[0]["text"]
    
    # Untuk mencetak seluruh proses berpikir dan respons, hapus komentar dan jalankan kode berikut
    # print("=" * 20 + "Full thinking process" + "=" * 20 + "\n")
    # print(f"{reasoning_content}")
    # print("=" * 20 + "Full response" + "=" * 20 + "\n")
    # print(f"{answer_content}")
    // Versi SDK DashScope >= 2.21.10
    import java.util.*;
    
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    
    import com.alibaba.dashscope.common.Role;
    import com.alibaba.dashscope.exception.ApiException;
    import com.alibaba.dashscope.exception.NoApiKeyException;
    import io.reactivex.Flowable;
    
    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.common.MultiModalMessage;
    import com.alibaba.dashscope.exception.UploadFileException;
    import com.alibaba.dashscope.exception.InputRequiredException;
    import java.lang.System;
    import com.alibaba.dashscope.utils.Constants;
    
    public class Main {
        // Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah AS (Virginia), ganti base_url dengan https://dashscope-us.aliyuncs.com/api/v1
        // Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/api/v1
        static {Constants.baseHttpApiUrl="https://dashscope-intl.aliyuncs.com/api/v1";}
    
        private static final Logger logger = LoggerFactory.getLogger(Main.class);
        private static StringBuilder reasoningContent = new StringBuilder();
        private static StringBuilder finalContent = new StringBuilder();
        private static boolean isFirstPrint = true;
    
        private static void handleGenerationResult(MultiModalConversationResult message) {
            String re = message.getOutput().getChoices().get(0).getMessage().getReasoningContent();
            String reasoning = Objects.isNull(re)?"":re; // Nilai default
    
            List<Map<String, Object>> content = message.getOutput().getChoices().get(0).getMessage().getContent();
            if (!reasoning.isEmpty()) {
                reasoningContent.append(reasoning);
                if (isFirstPrint) {
                    System.out.println("====================Thinking process====================");
                    isFirstPrint = false;
                }
                System.out.print(reasoning);
            }
    
            if (Objects.nonNull(content) && !content.isEmpty()) {
                Object text = content.get(0).get("text");
                finalContent.append(content.get(0).get("text"));
                if (!isFirstPrint) {
                    System.out.println("\n====================Full response====================");
                    isFirstPrint = true;
                }
                System.out.print(text);
            }
        }
        public static MultiModalConversationParam buildMultiModalConversationParam(MultiModalMessage Msg)  {
            return MultiModalConversationParam.builder()
                    // Jika Anda belum mengonfigurasi variabel lingkungan, ganti baris berikut dengan Kunci API Studio Model Anda: .apiKey("sk-xxx")
                    // Kunci API berbeda tiap wilayah. Untuk mendapatkan kunci API, kunjungi https://www.alibabacloud.com/help/en/model-studio/get-api-key
                    .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                    .model("qwen3-vl-plus")
                    .messages(Arrays.asList(Msg))
                    .enableThinking(true)
                    .thinkingBudget(81920)
                    .incrementalOutput(true)
                    .build();
        }
    
        public static void streamCallWithMessage(MultiModalConversation conv, MultiModalMessage Msg)
                throws NoApiKeyException, ApiException, InputRequiredException, UploadFileException {
            MultiModalConversationParam param = buildMultiModalConversationParam(Msg);
            Flowable<MultiModalConversationResult> result = conv.streamCall(param);
            result.blockingForEach(message -> {
                handleGenerationResult(message);
            });
        }
        public static void main(String[] args) {
            try {
                MultiModalConversation conv = new MultiModalConversation();
                MultiModalMessage userMsg = MultiModalMessage.builder()
                        .role(Role.USER.getValue())
                        .content(Arrays.asList(Collections.singletonMap("image", "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"),
                                Collections.singletonMap("text", "Solve this problem")))
                        .build();
                streamCallWithMessage(conv, userMsg);
    //             Cetak hasil akhir
    //            if (reasoningContent.length() > 0) {
    //                System.out.println("\n====================Full response====================");
    //                System.out.println(finalContent.toString());
    //            }
            } catch (ApiException | NoApiKeyException | UploadFileException | InputRequiredException e) {
                logger.error("An exception occurred: {}", e.getMessage());
            }
            System.exit(0);
        }
    }
    # ======= IMPORTANT =======
    # Kunci API berbeda tiap wilayah. Untuk mendapatkan kunci API, kunjungi https://www.alibabacloud.com/help/en/model-studio/get-api-key
    # Berikut adalah URL dasar untuk wilayah Singapura. Jika Anda menggunakan model di wilayah AS (Virginia), ganti base_url dengan https://dashscope-us.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation
    # Jika Anda menggunakan model di wilayah Beijing, ganti base_url dengan https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation
    # === Hapus komentar ini sebelum eksekusi ===
    
    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-vl-plus",
        "input":{
            "messages":[
                {
                    "role": "user",
                    "content": [
                        {"image": "https://img.alicdn.com/imgextra/i1/O1CN01gDEY8M1W114Hi3XcN_!!6000000002727-0-tps-1024-406.jpg"},
                        {"text": "Solve this problem"}
                    ]
                }
            ]
        },
        "parameters":{
            "enable_thinking": true,
            "incremental_output": true,
            "thinking_budget": 81920
        }
    }'

    Contoh lainnya

    Selain kemampuan penalarannya, model penalaran visual memiliki semua fitur model pemahaman visual. Anda dapat menggabungkan fitur-fitur ini untuk menangani skenario yang lebih kompleks:

    • Pemahaman multi-gambar

    • Pemahaman video

    • Memproses gambar resolusi tinggi

    • Mengirim file lokal (encoding Base64 atau path file)

    Penagihan

    Total biaya = (Token input × Harga per token input) + (Token output × Harga per token output).

    • Proses berpikir (reasoning_content) merupakan bagian dari konten output dan ditagih sebagai token output. Jika model dalam mode berpikir tidak menghasilkan proses berpikir, maka akan ditagih dengan harga mode non-berpikir.

    • Untuk informasi tentang cara menghitung token untuk gambar atau video, lihat Pemahaman visual.

    Referensi API

    Untuk parameter input dan output, lihat Qwen.

    Kode error

    Jika panggilan gagal, lihat Pesan error untuk troubleshooting.

    谢谢!我们已经收到了您的反馈。