Qwen-Omni-Turbo
Copy success!
Overview
The new multimodal understanding and generation model, supporting text, image, speech, and video input as well as mixed input understanding. It can simultaneously stream text and speech, with significantly enhanced speed for multimodal content understanding. Additionally, it offers four natural dialogue tones. This model is a dynamically updated version.
Input
TextImageVideoAudio
Output
TextAudio
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 docsPricing
- Input: Text$0.07Per 1M tokens
- Input: Audio$4.44Per 1M tokens
- Input: Vision$0.21Per 1M tokens
- Output: Text (When input contains only text) $0.27Per 1M tokens
- Output: Text (When input contains images/audio/video)$0.63Per 1M tokens
- Output: Text&Audio (Output text is not charged)$8.89Per 1M tokens
Rate Limits & Context
- Max Input30K
- Max Output2K
- Context32K
- TPMTokens Per Minute100K
- RPMRequests Per Minute60
API Reference
Call APICopy success!
12345678910111213141516171819202122232425
import os
from openai import OpenAI
client = OpenAI(
# The API keys for the Singapore and Beijing regions are different. To obtain an API key, see: https://www.alibabacloud.com/help/en/model-studio/get-api-key
api_key=os.getenv("DASHSCOPE_API_KEY"),
base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
)
completion = client.chat.completions.create(
model="qwen-omni-turbo-latest",
messages=[{"role": "user", "content": "Who are you"}],
# Set the modality for the output data. The following modalities are supported: ["text","audio"]、["text"]
modalities=["text", "audio"],
audio={"voice": "Ethan", "format": "wav"},
# The stream parameter must be set to True. Otherwise, an error is reported
stream=True,
stream_options={"include_usage": True},
)
for chunk in completion:
if chunk.choices:
print(chunk.choices[0].delta)
else:
print(chunk.usage)