Qwen-Turbo

Copied!
Try AIAdd to Compare
ReasoningText Generation

Overview

ReasoningText Generation

The Turbo model of the Qwen3 series. It effectively integrates thinking mode and non-thinking mode, allowing for mode switching during conversations. Its reasoning capabilities rival those of QwQ-32B with a smaller parameter size, while its general capabilities significantly surpass those of Qwen2.5-Turbo, achieving the SOTA level in the same scale within the industry.

Input

Text

Output

Text

Features

Prefix Completion

Enable Partial Mode when calling the Qwen API to make the model continue strictly from your provided prefix text.View docs

Function Calling

Use function calling to connect large language models with external tools and systems.View docs

Cache

Context Cache stores shared prefixes for long-context requests to reduce repeated computation, improve latency, and lower cost.View docs

Structured Outputs

Structured Outputs help ensure the model returns a JSON string in the expected format.View docs

Batches

Web Search

Enable web search so the model can answer with real-time retrieved data.View docs

feature.funeTuning

Pricing

  • Input
    $0.05Per 1M tokens
  • Output
    $0.2Per 1M tokens
  • Input(Thinking)
    $0.05Per 1M tokens
  • Output(Thinking)
    $0.5Per 1M tokens
  • Input(Implicit Cache)
    $0.01Per 1M tokens
  • Input(Thinking Implicit Cache)
    $0.01Per 1M tokens
  • Thinking Output(Batch File)
    $0.25Per 1M tokens
  • Input(Batch File)
    $0.025Per 1M tokens
  • Output(Batch File)
    $0.1Per 1M tokens
  • Input(Thinking Batch File)
    $0.025Per 1M tokens

toc.rateLimitsAndContext

  • Max Input
    98.30K
  • Max Output
    8.19K
  • RPMRequests Per Minute
    600
  • TPMTokens Per Minute
    5M
  • Context
    131.07K

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-turbo",
    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}")