Qwen-Plus

Copied!
Try AIAdd to Compare
ReasoningText Generation

Overview

ReasoningText Generation

Qwen-Plus is an enhanced version of the Qwen ultra-large language model that supports multiple input languages such as Chinese and English. Compared to previous versions, it shows significant improvements in both Chinese and English code generation, logical reasoning, and multilingual abilities. The response style has been greatly adjusted to align with human preferences, with noticeable enhancements in the level of detail and clarity of responses. Specialized improvements have been made in creative writing, adherence to JSON formatting, and role-playing abilities.

Input

Text

Output

Text

Features

Prefix Completion

Function Calling

Cache

Structured Outputs

Batches

Web Search

Pricing

  • Input
    $0.4Per 1M tokens
  • Output
    $1.2Per 1M tokens
  • Input(Thinking)
    $0.4Per 1M tokens
  • Output(Thinking)
    $4Per 1M tokens
  • Input(Implicit Cache)
    $0.08Per 1M tokens
  • Input(Thinking Implicit Cache)
    $0.08Per 1M tokens
  • Thinking Output(Batch File)
    $2Per 1M tokens
  • Input(Batch File)
    $0.2Per 1M tokens
  • Output(Batch File)
    $0.6Per 1M tokens
  • Input(Thinking Batch File)
    $0.2Per 1M tokens
  • Explicit Cache Creation
    $0.5Per 1M tokens
  • Explicit Cache Read
    $0.04Per 1M tokens
  • Explicit Cache Creation(Thinking)
    $0.5Per 1M tokens
  • Explicit Cache Read(Thinking)
    $0.04Per 1M tokens
  • Input
    $0.4Per 1M tokens
  • Output
    $1.2Per 1M tokens
  • Input(Thinking)
    $0.4Per 1M tokens
  • Output(Thinking)
    $4Per 1M tokens
  • Input(Implicit Cache)
    $0.08Per 1M tokens
  • Input(Thinking Implicit Cache)
    $0.08Per 1M tokens
  • Thinking Output(Batch File)
    $2Per 1M tokens
  • Input(Batch File)
    $0.2Per 1M tokens
  • Output(Batch File)
    $0.6Per 1M tokens
  • Input(Thinking Batch File)
    $0.2Per 1M tokens
  • Explicit Cache Creation
    $0.5Per 1M tokens
  • Explicit Cache Read
    $0.04Per 1M tokens
  • Explicit Cache Creation(Thinking)
    $0.5Per 1M tokens
  • Explicit Cache Read(Thinking)
    $0.04Per 1M tokens

Context

Context
1M
Max Input
995.90K
Max Output
32.76K

Rate Limits

  • RPMRequests Per Minute
    600
  • TPMTokens Per Minute
    1M

API Reference

Get API Key
Copied!
12345678910111213141516171819202122232425262728293031
import os
from dashscope import Generation
import dashscope
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'

messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Who are you?"},
]
response = Generation.call(
    # If the environment variable is not set, replace it with your Model Studio API key: api_key = "sk-xxx",
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    model="qwen-plus",
    messages=messages,
    result_format="message",
    # Enable deep thinking
    enable_thinking=True,
)

if response.status_code == 200:
    # Print thinking process
    print("=" * 20 + "Thinking process" + "=" * 20)
    print(response.output.choices[0].message.reasoning_content)
    
    # Print response
    print("=" * 20 + "Full response" + "=" * 20)
    print(response.output.choices[0].message.content)
else:
    print(f"HTTP return code: {response.status_code}")
    print(f"Error code: {response.code}")
    print(f"Error message: {response.message}")