Qwen3-Open-Source
Copied!
Try AIAdd to Compare
ReasoningText Generation
Overview
ReasoningText Generation
Achieves effective integration of thinking and non-thinking modes, allowing mode switching during conversations. Its reasoning capability reaches the SOTA level in the same scale industry, and its general capability significantly surpasses Qwen2.5-7B.
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 docsFunction Calling
Use function calling to connect large language models with external tools and systems.View docsCache
Context Cache stores shared prefixes for long-context requests to reduce repeated computation, improve latency, and lower cost.View docsStructured Outputs
Structured Outputs help ensure the model returns a JSON string in the expected format.View docsBatches
feature.funeTuning
Pricing
- Input$0.18Per 1M tokens
- Output$0.7Per 1M tokens
- Input(Thinking)$0.18Per 1M tokens
- Output(Thinking)$2.1Per 1M tokens
toc.rateLimitsAndContext
- Max Input98.30K
- Max Output8.19K
- RPMRequests Per Minute600
- TPMTokens Per Minute1M
- Context131.07K
API Reference
Get API KeyCopied!
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="qwen3-8b",
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}")