Alibaba Models (Qwen)
AvalAI provides access to supported Alibaba Qwen models through the official DashScope cloud infrastructure and provider-specific routes where listed. This guide covers text generation, multimodal understanding, reasoning, translation, coding, and image generation. It also retains deprecated model specifications for migration reference; their presence here does not imply current availability.
Alibaba Qwen Models (Deprecated and Removed from the Current AvalAI Catalog)
Alibaba recommends migrating the following deprecated Qwen models to qwen3.8-max or the Qwen3.7 series. All 45 exact IDs below are absent from the current AvalAI model catalog and tier rate-limit lists. Do not use them for new requests or assume that AvalAI automatically redirects them to a replacement. This notice does not establish an additional provider shutdown date.
Deprecated model IDs:
- General text and reasoning:
qwen-turbo,qwen-plus,qwen-plus-2025-07-28,qwen-plus-2025-09-11,qwen-flash,qwen3-max,qwen3-max-2026-01-23,qwen3-max-preview,qwen3.6-max-preview,qwq-plus,qwq-plus-2025-03-05 - Vision-language:
qwen3-vl-32b-instruct,qwen-vl-max,qwen-vl-plus,qvq-max,qwen3-vl-plus-2025-12-19,qwen3-vl-plus-2025-09-23,qwen3-vl-flash,qwen3-vl-flash-2026-01-22,qwen3-vl-flash-2025-10-15 - Translation:
qwen-mt-turbo,qwen-mt-lite - Image generation and editing:
qwen-image-plus,qwen-image-max,qwen-image-edit,qwen-image - Coding:
qwen3-coder-next,qwen3-coder-plus,qwen3-coder-plus-2025-09-23,qwen3-coder-plus-2025-07-22,qwen3-coder-480b-a35b-instruct - Open-weight Qwen3 and Qwen3-Next variants:
qwen3-next-80b-a3b-thinking,qwen3-next-80b-a3b-instruct,qwen3-235b-a22b-instruct-2507,qwen3-235b-a22b-thinking-2507,qwen3-235b-a22b,qwen3-32b,qwen3-30b-a3b,qwen3-30b-a3b-instruct-2507,qwen3-30b-a3b-thinking-2507,qwen3-14b,qwen3-8b,qwen3-235b-a22b-fp8-tput - Provider-prefixed routes:
groq.qwen3-32b,cf.qwen3-30b-a3b-fp8
Migration path:
- Use
qwen3.8-maxfor the latest flagship text, reasoning, coding, and multimodal-understanding workloads. - Use
qwen3.7-maxfor demanding reasoning and coding agents, orqwen3.7-plusfor balanced general-purpose, coding, and multimodal workloads. - For translation, reevaluate prompts and output quality with a recommended replacement. If your integration requires dedicated translation parameters, compare the currently listed
qwen-mt-plusandqwen-mt-flashroutes rather than assuming identical request behavior. - For image output, choose a supported image model such as
qwen-image-3.0orqwen-image-3.0-pro, which support/v1/images/generationsand/v1/images/edits. The recommendedqwen3.8-maxand Qwen3.7 models produce text; they are not drop-in replacements for the Images API. Review sizes, image-input handling, parameters, and per-image prices before migrating.
This list applies to the exact IDs shown, including namespaces and dated snapshots, not every similarly named route. For example, qwen3-vl-plus, qwen-flash-2025-07-28, and qwen3-max-2025-09-23 are separate IDs still present in the current catalog; their presence does not restore the deprecated aliases or snapshots above. Confirm the selected replacement in /v1/models, update the model field explicitly, and retest endpoint support, reasoning/streaming settings, tools, context limits, pricing, and tier access.
See the Alibaba provider guide, Model Explorer, and current pricing for replacement details.
Important: enable_thinking Parameter
⚠️ Note for Non-Streaming Requests: Most Alibaba Qwen models require you to explicitly set
extra_bodyparameter{"enable_thinking": False}when making non-streaming requests (stream=False). Without this parameter, DashScope may return an error.Key Requirements:
- Non-streaming requests: Must include
extra_body={"enable_thinking": False}- Streaming requests with thinking: Can use
extra_body={"enable_thinking": True}only withstream=True- Error if violated: Setting
enable_thinking: Truewithout streaming will result in aninvalid_requesterror
Example for non-streaming requests:
response = client.chat.completions.create(
model="qwen3.7-plus",
messages=[{"role": "user", "content": "Your question here"}],
stream=False,
extra_body={"enable_thinking": False}, # Required for non-streaming
)Responses API version This version uses `gpt-5.6-luna` because `qwen3.7-plus` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Your question here",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Example for streaming requests with thinking:
stream = client.chat.completions.create(
model="qwen3.7-plus",
messages=[{"role": "user", "content": "Your question here"}],
stream=True,
extra_body={"enable_thinking": True}, # Only supported with streaming
)Responses API version This version uses `gpt-5.6-luna` because `qwen3.7-plus` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Your question here",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Available Models
Alibaba's Qwen models are organized into specialized families. Chat models use v1/chat/completions; support for v1/messages and v1/responses is model-specific. Image, embedding, and reranking models use their respective endpoints. The qwen3.8-max flagship supports v1/chat/completions and v1/messages fully, with partial v1/responses support. Deprecated entries below are historical specifications, not supported request targets or current price quotes. Check the exact ID in /v1/models and consult current pricing.
Qwen Flash Series
High-performance models optimized for speed and efficiency, ideal for applications requiring fast response times with excellent quality.
⚠️ Deprecation Notice:
qwen-turboandqwen-flashare deprecated and absent from the current AvalAI catalog. Alibaba recommendsqwen3.8-maxor the Qwen3.7 series. For a current speed-focused option, also compareqwen3.8-flashandqwen3.6-flash. The separateqwen-flash-2025-07-28snapshot remains listed; it does not restore the deprecated base alias. See Deprecations for the historical Turbo shutdown notice and current exact-ID list.
| Feature | qwen-flash Deprecated | qwen-flash-2025-07-28 |
|---|---|---|
| Provider | DashScope | DashScope |
| Owner | Alibaba | Alibaba |
| Context Window | 131,072 tokens | 131,072 tokens |
| Max Input Tokens | 129,024 | 129,024 |
| Max Output Tokens | 16,384 | 16,384 |
| Strengths | Ultra-fast, Tiered pricing | Stable flash version |
| Best for | Cost-effective speed | Production flash |
# Example using Qwen3.6 Flash for fast text generation
response = client.chat.completions.create(
model="qwen3.6-flash",
messages=[
{
"role": "user",
"content": "Summarize the key benefits of renewable energy in 3 bullet points.",
}
],
max_tokens=200,
extra_body={"enable_thinking": False}, # Required for non-streaming requests
)Responses API version This version uses `gpt-5.6-luna` because `qwen3.6-flash` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Summarize the key benefits of renewable energy in 3 bullet points.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Qwen3.8 Series
The series includes the managed qwen3.8-max flagship, its open-weight base qwen3.8-2.4t-a95b, the cost-efficient qwen3.8-flash alias of qwen3.8-flash-next, and the compact dense qwen3.8-27b. Choose Max for multimodal input, optional thinking, a managed 1M-token context, and built-in production features. Choose the open-weight base for text-only workloads that require its always-on reasoning behavior. Choose Flash for high-volume chat and agent workloads at the lowest Qwen3.8 cost, and choose the 27B dense model for vision-language workloads with flexible thinking control.
qwen3.8-flash
qwen3.8-flash is the managed alias of qwen3.8-flash-next, a 125B-parameter mixture-of-experts model that activates 6 billion parameters per token. Its hybrid Gated DeltaNet plus Qwen Sparse Attention (QSA) architecture compresses history into a fixed-size state and retrieves precisely across long context, while 51B additional N-gram embedding parameters expand capacity at negligible per-token computation.
| Feature | Details |
|---|---|
| Model ID | qwen3.8-flash |
| Context window | 262,144 tokens |
| Input pricing | $0.15 / 1M tokens |
| Cache creation | $0.20 / 1M tokens |
| Cached input pricing | $0.016 / 1M tokens |
| Output pricing | $0.47 / 1M tokens |
| Input modalities | Text, image, video |
| Output modalities | Text |
| Thinking mode | On by default; disable with enable_thinking per request |
| Supported endpoints | v1/chat/completions (full), v1/messages (full), v1/responses (partial) |
Key Features:
- Cost-Efficient Long Context: Hybrid GDN + QSA attention reduces long-context serving cost with up to 262K input tokens on AvalAI
- Vision-Language Understanding: Native image and video input for documents, diagrams, and hour-scale videos
- Agentic Strengths: Provider-reported 73.5 Toolathlon Verified, 73.9 CoWorkBench, and 91.7 GPQA Diamond
- Flexible Thinking:
reasoning_effortacceptslow,medium, andxhigh;preserve_thinkingretains reasoning context across turns where supported
from openai import OpenAI
client = OpenAI(
api_key="your-avalai-api-key",
base_url="https://api.avalai.ir/v1",
)
response = client.chat.completions.create(
model="qwen3.8-flash",
messages=[
{
"role": "user",
"content": "Review this migration plan and identify the three highest-risk assumptions.",
}
],
extra_body={"enable_thinking": True, "reasoning_effort": "medium"},
)
print(response.choices[0].message.content)qwen3.8-27b
qwen3.8-27b is the compact, deployment-friendly dense model of the Qwen3.8 generation. It is a native vision-language model that understands images and videos, with flexible thinking control designed to carry complex, multi-step tasks through to completion with greater reliability.
| Feature | Details |
|---|---|
| Model ID | qwen3.8-27b |
| Context window | 262,144 tokens |
| Input pricing | $0.50 / 1M tokens |
| Cache creation | $0.625 / 1M tokens |
| Cached input pricing | $0.10 / 1M tokens |
| Output pricing | $2.00 / 1M tokens |
| Input modalities | Text, image, video |
| Output modalities | Text |
| Thinking mode | On by default; disable with enable_thinking per request |
| Supported endpoints | v1/chat/completions (full), v1/messages (full), v1/responses (partial) |
Key Features:
- Compact Dense Model: 27B parameters with vision encoder for self-hosting-shaped workloads served through AvalAI
- Vision-Language Understanding: Native image and video understanding, from STEM diagrams and documents to hour-scale videos
- Agentic Execution: Provider-reported 73.0 Terminal Bench 2.1, 61.7 SWE-bench Pro, and 84.3 OSWorld-Verified
- Flexible Thinking:
reasoning_effortacceptslow,medium, andxhigh;preserve_thinkingretains reasoning context across turns where supported
from openai import OpenAI
client = OpenAI(
api_key="your-avalai-api-key",
base_url="https://api.avalai.ir/v1",
)
response = client.chat.completions.create(
model="qwen3.8-27b",
messages=[
{
"role": "user",
"content": "Plan a staged refactor of this service with tests and rollback criteria.",
}
],
extra_body={"enable_thinking": True, "reasoning_effort": "medium"},
)
print(response.choices[0].message.content)For launch details, see the August 29, 2026 update.
qwen3.8-2.4t-a95b
qwen3.8-2.4t-a95b is the open-weight base underlying qwen3.8-max. Its mixture-of-experts architecture contains 2.4 trillion total parameters and activates 95 billion per forward pass. Unlike the managed Max service, this route is text-only and thinking is mandatory.
| Feature | Details |
|---|---|
| Model ID | qwen3.8-2.4t-a95b |
| Context window | 262,144 tokens |
| Input pricing | $2.00 / 1M tokens |
| Cache creation | $2.50 / 1M tokens |
| Cached input pricing | $0.25 / 1M tokens |
| Output pricing | $6.00 / 1M tokens |
| Input modalities | Text |
| Output modalities | Text |
| Thinking mode | Mandatory; cannot be disabled |
| Supported endpoints | v1/chat/completions (full), v1/messages (full), v1/responses (partial) |
Use reasoning_effort to tune the mandatory reasoning budget. Supported values are low, medium, and xhigh; xhigh is the default. Responses begin with reasoning inside <think>...</think> before the final answer. Preserve prior thinking for multi-turn or tool workflows when the selected route supports preserve_thinking.
from openai import OpenAI
client = OpenAI(
api_key="your-avalai-api-key",
base_url="https://api.avalai.ir/v1",
)
response = client.chat.completions.create(
model="qwen3.8-2.4t-a95b",
messages=[
{
"role": "user",
"content": "Review this migration plan and identify the three highest-risk assumptions.",
}
],
extra_body={"reasoning_effort": "medium"},
)
print(response.choices[0].message.content)qwen3.8-max
qwen3.8-max is Alibaba's new 2.4-trillion-parameter mixture-of-experts flagship for long-horizon coding, professional work, multimodal understanding, and agentic execution. It can plan, implement, and verify multi-stage work across extended conversations, including projects that span more than 10 days.
| Feature | Details |
|---|---|
| Model ID | qwen3.8-max |
| Context window | 1,000,000 tokens (up to 991,000 input tokens) |
| Maximum output | 128,000 tokens |
| Input pricing | $2.00 / 1M tokens |
| Cache creation | $2.50 / 1M tokens |
| Cached input pricing | $0.25 / 1M tokens |
| Output pricing | $6.00 / 1M tokens |
| Input modalities | Text, image, video |
| Output modalities | Text |
| Supported endpoints | v1/chat/completions (full), v1/messages (full), v1/responses (partial) |
Key Features:
- Long-Horizon Coding: Plans, implements, tests, and verifies substantial multi-stage software projects
- Professional Work: Produces end-to-end deliverables across legal, financial, design, and other specialist domains
- Native Visual Understanding: Uses images and extended video throughout planning, execution, and verification
- Ultra-Long Document Analysis: Handles large repositories and extensive document collections within a 1M-token context window
- Agentic Feedback Loops: Iterates through planning, tool use, execution, and verification for complex tasks
- Developer Features: Function calling, tool choice, structured output, prompt caching, web search, and streaming
- Hybrid Thinking: Use
enable_thinkingfor deeper reasoning; follow the streaming requirements documented at the top of this page
from openai import OpenAI
client = OpenAI(
api_key="your-avalai-api-key",
base_url="https://api.avalai.ir/v1",
)
response = client.chat.completions.create(
model="qwen3.8-max",
messages=[
{
"role": "user",
"content": "Review this architecture and propose a staged implementation plan with verification gates.",
}
],
extra_body={"enable_thinking": False},
)
print(response.choices[0].message.content)For launch details, see the August 3, 2026 update.
Qwen3.7 Series
Alibaba's previous proprietary Qwen generation is designed for the agent era. Use qwen3.8-max for Alibaba's current highest-capability long-horizon work, qwen3.7-max for the previous Max generation, and qwen3.7-plus for a lower-cost option that still supports large-context coding, reasoning, and multimodal workflows.
qwen3.7-max
The previous Qwen Max flagship built for agentic workflows. It provides frontier coding capabilities, strong reasoning, and sustained autonomous execution across hundreds or thousands of tool calls; use qwen3.8-max for the latest flagship generation.
Pricing note: The table below reflects the current model metadata exposed through AvalAI. Use
GET /v1/models/qwen3.7-maxto confirm live pricing before quoting it in customer-facing workflows.
| Feature | Details |
|---|---|
| Model ID | qwen3.7-max |
| Context window | 1,000,000 tokens |
| Maximum output | 65,536 tokens |
| Input pricing | $2.50 / 1M tokens |
| Cache creation | $3.125 / 1M tokens |
| Cached input pricing | $0.25 / 1M tokens (90% cost reduction) |
| Output pricing | $7.50 / 1M tokens |
| Input modalities | Text, Image, Video |
| Output modalities | Text |
| Supported endpoints | v1/chat/completions, v1/responses (partial) |
Key Features:
- Agent Foundation: Built for the agent era — coding, office productivity, and long-horizon execution
- Frontier Coding Agent: 80.4 on SWE-Verified, 60.6 on SWE-Pro, 78.3 on SWE-Multilingual, 69.7 on Terminal-Bench 2.0
- Strong Reasoning: 92.4 on GPQA Diamond, 97.1 on HMMT 2026 Feb, 90.0 on IMOAnswerBench, 44.5 on Apex
- Agent Benchmarks: 60.8 on MCP-Mark, 76.4 on MCP-Atlas, 87.0 on SpreadSheetBench-v1, 75.0 on BFCL-V4
- Long-Horizon Execution: Demonstrated 35-hour autonomous kernel optimization with 1,158 tool calls and 10.0x speedup
- Cross-Harness Generalization: Consistent performance across Claude Code, OpenClaw, Qwen Code, and custom frameworks
- Hybrid Thinking: Optional reasoning mode via
enable_thinking(streaming only) - Preserve Thinking: Recommended for multi-turn agent workflows via
preserve_thinking
Benchmark Performance:
- SWE-Verified: 80.4 (on par with Opus-4.6 Max at 80.8)
- SWE-Pro: 60.6 (vs. K2.6 at 59.5)
- SWE-Multilingual: 78.3 (vs. Opus-4.6 at 77.5)
- Terminal-Bench 2.0: 69.7 (vs. DS-V4-Pro Max at 67.9)
- NL2Repo: 47.2
- HMMT 2026 Feb: 97.1 (best in class)
- GPQA Diamond: 92.4 (best in class)
- IMOAnswerBench: 90.0 (best in class)
- MMLU-Pro: 89.6
- MRCR-v2 128k: 90.4 (best in class)
- WMT24++: 85.8 (best in class)
# Example using Qwen3.7-Max for long-horizon agentic tasks
stream = client.chat.completions.create(
model="qwen3.7-max",
messages=[
{
"role": "user",
"content": "Build a multi-file Python CLI that downloads, validates, and merges CSV files from S3.",
}
],
stream=True,
extra_body={
"enable_thinking": True,
"preserve_thinking": True,
},
)Responses API version This version uses `gpt-5.6-luna` because `qwen3.7-max` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Build a multi-file Python CLI that downloads, validates, and merges CSV files from S3.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
qwen3.7-plus
The balanced Qwen3.7 model for high-quality general chat, agentic coding, multimodal reasoning, and long-context production workloads when qwen3.7-max is more capability than the task requires.
| Feature | Details |
|---|---|
| Model ID | qwen3.7-plus |
| Context window | Up to 1,000,000 tokens |
| Maximum output | 65,536 tokens |
| Input pricing | $0.40 / 1M tokens |
| Cache creation | $0.50 / 1M tokens |
| Cached input pricing | $0.04 / 1M tokens |
| Output pricing | $1.60 / 1M tokens |
| Input modalities | Text, Image, Video |
| Output modalities | Text |
| Supported endpoints | v1/chat/completions |
Best for:
- General-purpose Qwen3.7 workloads with lower cost than
qwen3.7-max - Coding agents, document-heavy prompts, and multimodal analysis
- High-volume applications that still need large context and tool-aware behavior
# Example using Qwen3.7-Plus for balanced agentic coding
response = client.chat.completions.create(
model="qwen3.7-plus",
messages=[
{
"role": "user",
"content": "Review this architecture plan and identify the highest-risk migration steps.",
}
],
extra_body={"enable_thinking": False},
)Responses API version This version uses `gpt-5.6-luna` because `qwen3.7-plus` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Review this architecture plan and identify the highest-risk migration steps.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Qwen3.6 Plus Series
Alibaba's flagship Qwen3.6 model with massive capability upgrades, featuring a 1M context window by default, significantly improved agentic coding capabilities, and better multimodal perception and reasoning.
qwen3.6-plus
A high-capability Qwen3.6 model with enhanced agentic coding and multimodal capabilities.
| Feature | Details |
|---|---|
| Model ID | qwen3.6-plus |
| Context window | 1,000,000 tokens (default) |
| Input pricing | $0.50 / 1M tokens |
| Input pricing (above 256K) | $2.00 / 1M tokens |
| Cache creation | $0.625 / 1M tokens |
| Cache creation (above 256K) | $2.50 / 1M tokens |
| Cached input pricing | $0.05 / 1M tokens (90% cost reduction) |
| Cached input (above 256K) | $0.20 / 1M tokens |
| Output pricing | $3.00 / 1M tokens |
| Output pricing (above 256K) | $6.00 / 1M tokens |
| Input modalities | Text, Image |
| Output modalities | Text |
| Supported endpoints | v1/chat/completions |
Key Features:
- 1M Context Window: Default million-token context for extensive documents and conversations
- SOTA Agentic Coding: From frontend web development to complex repository-level problem solving
- Enhanced Multimodal: Greater accuracy and sharper multimodal reasoning
- Coding Agent Excellence: 78.8% on SWE-bench Verified, 61.6% on Terminal-Bench 2.0
- Deep Planning: 41.5% on DeepPlanning benchmark (leading performance)
- MCP Support: 48.2% on MCPMark for Model Context Protocol integration
- Tool Decathlon: Strong performance across diverse tool-use scenarios
Benchmark Performance:
- SWE-bench Verified: 78.8%
- SWE-bench Multilingual: 73.8%
- SWE-bench Pro: 56.6%
- Terminal-Bench 2.0: 61.6%
- TAU3-Bench: 70.7%
- DeepPlanning: 41.5%
- MCPMark: 48.2%
- MMLU-Pro: 88.5%
- SuperGPQA: 71.6%
# Example using Qwen3.6-Plus for agentic coding
response = client.chat.completions.create(
model="qwen3.6-plus",
messages=[
{
"role": "user",
"content": "Analyze this codebase and implement a fix for the bug in the authentication module.",
}
],
max_tokens=4000,
extra_body={"enable_thinking": False}, # Required for non-streaming requests
)Responses API version This version uses `gpt-5.6-luna` because `qwen3.6-plus` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Analyze this codebase and implement a fix for the bug in the authentication module.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Qwen3.6 Series (Flash, 27B, 35B-A3B, Max-Preview)
Four new models from the Qwen3.6 series with significant improvements in agentic coding, STEM reasoning, spatial intelligence, and object detection over the Qwen3.5 generation. The flash/27B/35B-A3B variants are native vision-language models; the max-preview is the largest and most capable text-only variant.
qwen3.6-flash
The Qwen3.6 native vision-language Flash model with a 1M context window and significantly improved agentic coding, mathematical reasoning, and spatial intelligence over qwen3.5-flash.
| Feature | Details |
|---|---|
| Model ID | qwen3.6-flash |
| Context window | 1,000,000 tokens (256K tier-one pricing) |
| Maximum output | 64K tokens |
| Input pricing | $0.25 / 1M tokens |
| Input pricing (above 256K) | $1.00 / 1M tokens |
| Cache creation | $0.3125 / 1M tokens |
| Cache creation (above 256K) | $1.25 / 1M tokens |
| Cached input pricing | $0.025 / 1M tokens (90% cost reduction) |
| Cached input (above 256K) | $0.10 / 1M tokens |
| Output pricing | $1.50 / 1M tokens |
| Output pricing (above 128K) | $4.00 / 1M tokens |
| Input modalities | Text, Image, Video |
| Output modalities | Text |
| Supported endpoints | v1/chat/completions |
Key Features:
- Native Vision-Language: Processes text, images, and videos natively
- 1M Context Window: Extended context for long documents and conversations
- Agentic Coding: Substantially outperforms Qwen3.5-Flash on code-agent benchmarks
- Spatial Intelligence: Markedly improved object localization and detection
- Deep Thinking: Optional reasoning mode via
enable_thinking - Tool Support: Function calling, structured output, and web search
response = client.chat.completions.create(
model="qwen3.6-flash",
messages=[
{
"role": "user",
"content": "Implement a binary search tree in Python with insert, delete, and in-order traversal methods.",
}
],
extra_body={"enable_thinking": True},
)Responses API version This version uses `gpt-5.6-luna` because `qwen3.6-flash` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Implement a binary search tree in Python with insert, delete, and in-order traversal methods.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
qwen3.6-27b
The Qwen3.6 27B native vision-language dense model with key improvements in agentic coding, STEM reasoning, and visual agent capabilities.
| Feature | Details |
|---|---|
| Model ID | qwen3.6-27b |
| Context window | 256,000 tokens |
| Maximum output | 64K tokens |
| Input pricing | $0.60 / 1M tokens |
| Cached input pricing | $0.06 / 1M tokens (90% cost reduction) |
| Output pricing | $3.60 / 1M tokens |
| Input modalities | Text, Image, Video |
| Output modalities | Text |
| Supported endpoints | v1/chat/completions |
Key Features:
- Native Vision-Language: Processes text, images, and videos natively
- 256K Context Window: Extended context for complex tasks
- Enhanced STEM Reasoning: Improved mathematical and code reasoning skills
- Visual Agents: Advances in video understanding, document OCR, and visual agent capabilities
- Deep Thinking: Optional reasoning mode via
enable_thinking
response = client.chat.completions.create(
model="qwen3.6-27b",
messages=[
{
"role": "user",
"content": "Analyze this diagram and extract the workflow steps.",
}
],
max_tokens=4096,
)Responses API version This version uses `gpt-5.6-luna` because `qwen3.6-27b` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Analyze this diagram and extract the workflow steps.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
qwen3.6-35b-a3b
The Qwen3.6 35B-A3B native vision-language model with a hybrid architecture integrating linear attention and sparse mixture-of-experts for higher inference efficiency.
| Feature | Details |
|---|---|
| Model ID | qwen3.6-35b-a3b |
| Context window | 256,000 tokens |
| Maximum output | 64K tokens |
| Input pricing | $0.248 / 1M tokens |
| Cached input pricing | $0.025 / 1M tokens (90% cost reduction) |
| Output pricing | $1.485 / 1M tokens |
| Input modalities | Text, Image, Video |
| Output modalities | Text |
| Supported endpoints | v1/chat/completions |
Key Features:
- Hybrid Architecture: Linear attention combined with sparse MoE for higher efficiency
- Improved Agentic Coding: Significantly better code-agent performance
- Spatial Intelligence: Advances in object localization and detection
- Cost-Effective: Very low pricing thanks to efficient sparse activation
- Deep Thinking: Optional reasoning mode via
enable_thinking
response = client.chat.completions.create(
model="qwen3.6-35b-a3b",
messages=[
{
"role": "user",
"content": "Refactor this monolithic service into microservices.",
}
],
max_tokens=4096,
)Responses API version This version uses `gpt-5.6-luna` because `qwen3.6-35b-a3b` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Refactor this monolithic service into microservices.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
qwen3.6-max-preview
⚠️ Deprecated:
qwen3.6-max-previewis no longer in the current AvalAI catalog. Migrate toqwen3.8-max,qwen3.7-max, orqwen3.7-plus. The specifications and prices below are historical; the example uses a supported replacement.
This was the largest Qwen3.6 preview variant, with text-only capabilities, enhanced vibe coding, coding agent execution, and long-tail knowledge retention.
| Feature | Details |
|---|---|
| Model ID | qwen3.6-max-preview Deprecated |
| Context window | 256,000 tokens (128K tier-one pricing) |
| Maximum output | 64K tokens |
| Input pricing | $1.30 / 1M tokens |
| Input pricing (above 128K) | $2.00 / 1M tokens |
| Cache creation | $1.625 / 1M tokens |
| Cache creation (above 128K) | $2.50 / 1M tokens |
| Cached input pricing | $0.13 / 1M tokens (90% cost reduction) |
| Cached input (above 128K) | $0.20 / 1M tokens |
| Output pricing | $7.80 / 1M tokens |
| Output pricing (above 128K) | $12.00 / 1M tokens |
| Input modalities | Text |
| Output modalities | Text |
| Supported endpoints | v1/chat/completions |
Key Features:
- Largest Qwen3.6 Model: Most capable variant in the Qwen3.6 series
- Enhanced Vibe Coding: Stronger front-end development and coding agent execution
- Long-Tail Knowledge: Upgraded knowledge retention for specialized topics
- 256K Context Window: Extended context for complex tasks
- Deep Thinking: Optional reasoning mode via
enable_thinking
response = client.chat.completions.create(
model="qwen3.8-max",
messages=[
{
"role": "user",
"content": "Build a polished Next.js landing page for a SaaS product with hero, features, testimonials, and pricing sections.",
}
],
max_tokens=8192,
)Responses API version This version uses `gpt-5.6-luna` because `qwen3.8-max` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Build a polished Next.js landing page for a SaaS product with hero, features, testimonials, and pricing sections.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Qwen Plus Series
Balanced models for diverse tasks. qwen-plus, qwen-plus-2025-09-11, and qwen-plus-2025-07-28 are deprecated and absent from the current catalog. Other aliases and snapshots are distinct IDs. Migrate to qwen3.8-max or Qwen3.7; the example uses qwen3.7-plus.
| Feature | qwen-plus Deprecated | qwen-plus-latest | qwen-plus-2025-09-11 Deprecated | qwen-plus-2025-07-28 Deprecated | qwen-plus-2025-07-14 | qwen-plus-2025-04-28 |
|---|---|---|---|---|---|---|
| Provider | DashScope | DashScope | DashScope | DashScope | DashScope | DashScope |
| Owner | Alibaba | Alibaba | Alibaba | Alibaba | Alibaba | Alibaba |
| Context Window | 131,072 tokens | 131,072 tokens | 131,072 tokens | 131,072 tokens | 131,072 tokens | 131,072 tokens |
| Max Input Tokens | 129,024 | 129,024 | 129,024 | 129,024 | 129,024 | 129,024 |
| Max Output Tokens | 16,384 | 16,384 | 16,384 | 16,384 | 16,384 | 16,384 |
| Strengths | Balanced Performance | Latest Features | Enhanced Reasoning | Previous Stable | Stable Release | Legacy Version |
| Best for | General-purpose tasks | Cutting-edge features | Advanced analysis | Production use | Stable production | Legacy compatibility |
# Migration example using Qwen3.7 Plus for general-purpose tasks
response = client.chat.completions.create(
model="qwen3.7-plus",
messages=[
{
"role": "user",
"content": "Explain the concept of machine learning to a beginner.",
}
],
max_tokens=500,
extra_body={"enable_thinking": False}, # Required for non-streaming requests
)Responses API version This version uses `gpt-5.6-luna` because `qwen3.7-plus` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Explain the concept of machine learning to a beginner.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Qwen3 Max Series
Premium models designed for the most demanding applications, offering superior reasoning and complex problem-solving capabilities.
⚠️ Deprecation Notice:
qwen3-max,qwen3-max-2026-01-23, andqwen3-max-previeware deprecated and no longer in the current AvalAI catalog. Alibaba recommendsqwen3.8-maxor Qwen3.7. The tables below retain historical specifications, and the examples use supported replacements. The separateqwen3-max-2025-09-23snapshot remains listed. See Deprecations for the earlier upstreamqwen-maxshutdown notice; provider retirement and availability of each exact AvalAI route are distinct.
| Feature | qwen3-max Deprecated | qwen3-max-2026-01-23 Deprecated | qwen3-max-preview Deprecated |
|---|---|---|---|
| Provider | DashScope | DashScope | DashScope |
| Owner | Alibaba | Alibaba | Alibaba |
| Context Window | 262,144 tokens | 262,144 tokens | 262,144 tokens |
| Max Input Tokens | 258,048 | 258,048 | 258,048 |
| Max Output Tokens | 32,768 | 32,768 | 32,768 |
| Strengths | Enhanced Agent Programming | Latest Snapshot | 1T+ Parameters |
| Best for | Agent programming, Complex scenarios | Production stability | Most demanding tasks |
# Migration example using Qwen3.8-Max for enhanced agent programming tasks
response = client.chat.completions.create(
model="qwen3.8-max",
messages=[
{
"role": "user",
"content": "Design an intelligent agent system that can autonomously manage complex multi-step workflows with tool invocation capabilities.",
}
],
max_tokens=2000,
extra_body={"enable_thinking": False}, # Required for non-streaming requests
)
# Migration example using Qwen3.7-Max for the most demanding tasks
response = client.chat.completions.create(
model="qwen3.7-max",
messages=[
{
"role": "user",
"content": "Perform a comprehensive analysis of quantum computing's potential impact on cryptography and data security.",
}
],
max_tokens=2000,
extra_body={"enable_thinking": False}, # Required for non-streaming requests
)Responses API version This version uses `gpt-5.6-luna` because `qwen3.8-max` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Perform a comprehensive analysis of quantum computing",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Qwen 3.5 Series
Next-generation native vision-language models built on a hybrid architecture that integrates linear attention mechanisms with sparse mixture-of-experts, achieving higher inference efficiency with state-of-the-art performance.
| Feature | qwen3.5-plus | qwen3.5-plus-2026-02-15 | qwen3.5-flash | qwen3.5-397b-a17b | qwen3.5-35b-a3b |
|---|---|---|---|---|---|
| Provider | DashScope | DashScope | DashScope | DashScope | DashScope |
| Owner | Alibaba | Alibaba | Alibaba | Alibaba | Alibaba |
| Parameters | Hosted | Hosted | Hosted | 397B total, 17B activated | 35B total, 3B activated |
| Context Window | 1,000,000 tokens | 1,000,000 tokens | 1,000,000 tokens | 131,072 tokens | 131,072 tokens |
| Max Output Tokens | 32,768 | 32,768 | 16,384 | 16,384 | 16,384 |
| Input Modalities | Text, Image, Video | Text, Image, Video | Text, Image, Video | Text, Image, Video | Text, Image, Video |
| Strengths | 1M context, built-in tools | Stable version | 1M context, high efficiency | Open-weight, strong agents | Open-weight, lightweight MoE |
| Best for | Long context, multimodal agents | Production deployments | Cost-effective long context | Open-source deployments | Edge deployment, efficient inference |
Key Features:
- Hybrid Architecture: Integrates linear attention (via Gated Delta Networks) with sparse mixture-of-experts for higher inference efficiency
- Native Vision-Language: Process text, images, and videos natively
- 1M Context Window: Extended context for qwen3.5-plus and qwen3.5-flash via Alibaba Cloud Model Studio
- 201 Languages: Expanded language and dialect support from 119 to 201 languages
- Built-in Tools: Official adaptive tool use support for agentic workflows
- Deep Thinking: Advanced reasoning capabilities on par with leading frontier models
- Open-Weight Models: qwen3.5-397b-a17b and qwen3.5-35b-a3b are open-source under Apache 2.0
Pricing:
| Model | Input | Input >256K | Cache Creation | Cache Creation >256K | Cached Input | Cached Input >256K | Output | Output >256K |
|---|---|---|---|---|---|---|---|---|
| qwen3.5-plus | $0.40/1M | $1.20/1M | $0.50/1M | $1.50/1M | $0.04/1M | $0.12/1M | $2.40/1M | $7.20/1M |
| qwen3.5-flash | $0.10/1M | $0.30/1M | $0.125/1M | $0.375/1M | $0.01/1M | $0.03/1M | $0.40/1M | $1.20/1M |
| qwen3.5-397b-a17b | $0.60/1M | - | - | - | $0.06/1M | - | $3.60/1M | - |
| qwen3.5-35b-a3b | $0.25/1M | - | - | - | $0.12/1M | - | $2.00/1M | - |
# Example using Qwen3.5 Plus for multimodal agent tasks
response = client.chat.completions.create(
model="qwen3.5-plus",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "Analyze this image and describe the key elements.",
},
{
"type": "image_url",
"image_url": {"url": "https://example.com/image.png"},
},
],
}
],
max_tokens=2000,
extra_body={"enable_thinking": False}, # Required for non-streaming requests
)
# Example using Qwen3.5-397B for complex reasoning tasks
response = client.chat.completions.create(
model="qwen3.5-397b-a17b",
messages=[
{
"role": "user",
"content": "Design a comprehensive software architecture for a distributed microservices system.",
}
],
max_tokens=4000,
extra_body={"enable_thinking": False}, # Required for non-streaming requests
)
# Example using Qwen3.5-Flash for cost-effective long context processing
response = client.chat.completions.create(
model="qwen3.5-flash",
messages=[
{
"role": "user",
"content": "Summarize the key points from this lengthy document...",
}
],
max_tokens=2000,
extra_body={"enable_thinking": False}, # Required for non-streaming requests
)
# Example using Qwen3.5-35B-A3B for efficient open-weight inference
response = client.chat.completions.create(
model="qwen3.5-35b-a3b",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Describe what you see in this image."},
{
"type": "image_url",
"image_url": {"url": "https://example.com/image.jpg"},
},
],
}
],
max_tokens=1000,
extra_body={"enable_thinking": False}, # Required for non-streaming requests
)Responses API version This version uses `gpt-5.6-luna` because `qwen3.5-plus` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
input=[
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "Summarize the key points from this lengthy document...",
},
{"type": "input_image", "image_url": "https://example.com/image.png"},
],
}
],
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Web Search
The separately listed qwen3-max-2025-09-23 snapshot supports provider web search for retrieving current information. The qwen3-max base alias is deprecated and must not be used in requests.
Note
The examples below retain the supported exact snapshot for this provider-specific search integration; they do not establish that every recommended Qwen3.8 or Qwen3.7 replacement accepts the same search parameters. Verify search support before switching IDs. The search strategy must be agent for international (Singapore) regions.
How It Works
When you enable web search by passing enable_search: true, the model will:
- Analyze if the user's question requires real-time information
- If needed, perform a web search and use the results to generate a response
- If not needed, use its own knowledge to answer
Usage Example
curl -X POST https://api.avalai.ir/v1/chat/completions \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-max-2025-09-23",
"messages": [
{
"role": "user",
"content": "What is Alibaba stock price"
}
],
"enable_search": true,
"search_options": {"search_strategy": "agent"}
}'from openai import OpenAI
client = OpenAI(api_key="your-avalai-api-key", base_url="https://api.avalai.ir/v1")
response = client.chat.completions.create(
model="qwen3-max-2025-09-23",
messages=[
{
"role": "user",
"content": "What is the weather forecast for tomorrow in New York?",
}
],
extra_body={"enable_search": True, "search_options": {"search_strategy": "agent"}},
)
print(response.choices[0].message.content)import { OpenAI } from "openai";
const client = new OpenAI({
apiKey: process.env.AVALAI_API_KEY,
baseURL: "https://api.avalai.ir/v1",
});
const response = await client.chat.completions.create({
model: "qwen3-max-2025-09-23",
messages: [
{ role: "user", content: "What are the latest tech news today?" }
],
enable_search: true,
search_options: { search_strategy: "agent" }
});
console.log(response.choices[0].message.content);Text-only Responses API example using `gpt-5.6-luna`, not the `qwen3-max-2025-09-23` provider-search integration.
This example demonstrates text generation on /v1/responses; it does not enable the provider web search shown above. Do not assume that changing the endpoint preserves enable_search or search_options. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="What are the latest tech news today?",
)
print(response.output_text)import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.AVALAI_API_KEY,
baseURL: "https://api.avalai.ir/v1",
});
const response = await client.responses.create({
model: "gpt-5.6-luna",
instructions: "You are a helpful assistant.",
input: "What are the latest tech news today?",
});
console.log(response.output_text);curl https://api.avalai.ir/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-d '
{
"model": "gpt-5.6-luna",
"input": "What are the latest tech news today?",
"instructions": "You are a helpful assistant."
}'messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Parameters
| Parameter | Type | Description |
|---|---|---|
enable_search | boolean | Set to true to enable web search. The model decides if a search is needed. |
search_options.search_strategy | string | Must be set to "agent" for international regions. |
Use Cases
- Real-time stock prices: Get current market data and stock information
- Weather forecasts: Retrieve up-to-date weather predictions for any location
- Current events: Answer questions about recent news and happenings
- Sports scores: Get live or recent game results
- Product information: Find current prices and availability
Billing
Web search involves two cost components:
- Model call fees: Web search results are added to the prompt, increasing input tokens. Standard model pricing applies.
- Search policy fees: For the
agentstrategy in international regions, the fee is $10.00 per 1,000 calls.
Vision-Language Models
Multimodal models capable of understanding and processing both text and visual inputs, enabling sophisticated image analysis and description tasks.
Qwen3 VL Series
Vision-language models for images, videos, and text. qwen3-vl-32b-instruct, qwen3-vl-flash, its 2026-01-22 and 2025-10-15 snapshots, and the qwen3-vl-plus-2025-12-19 and qwen3-vl-plus-2025-09-23 snapshots are deprecated. The exact qwen3-vl-plus base route remains listed. Alibaba recommends qwen3.8-max or Qwen3.7 for migration; validate your image/video input schema and limits.
| Model | Context Window | Max Input | Max Output | Best for |
|---|---|---|---|---|
qwen3-vl-32b-instruct Deprecated | 131,072 | 129,024 | 8,192 | Open-source balanced VL tasks |
| qwen3-vl-plus | 131,072+ | 129,024+ | 8,192 | Long context, video, agent tasks |
qwen3-vl-flash Deprecated | 131,072+ | 129,024+ | 8,192 | Fast, cost-effective VL tasks |
Key Features:
- Long Document Support: Process documents with millions of tokens
- Long Video Understanding: Analyze videos up to 1 hour in length
- OCR Capabilities: Advanced text extraction from images
- Agent Capabilities: Image retrieval and tool use
- Tiered Pricing: Cost optimization based on context length
# Example using Qwen3-VL-Plus for vision-language tasks
response = client.chat.completions.create(
model="qwen3-vl-plus",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "Analyze this document and extract key information.",
},
{
"type": "image_url",
"image_url": {"url": "https://example.com/document.png"},
},
],
}
],
extra_body={"enable_thinking": False},
)Responses API version This version uses `gpt-5.6-luna` because `qwen3-vl-plus` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
input=[
{
"role": "user",
"content": [
{"type": "input_text", "text": "Describe this image."},
{"type": "input_image", "image_url": "https://example.com/image.png"},
],
}
],
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Qwen 2.5 VL Series
| Model | Context Window | Max Input | Max Output | Best for |
|---|---|---|---|---|
| qwen2.5-vl-72b-instruct | 131,072 | 129,024 | 8,192 | Complex vision tasks |
| qwen2.5-vl-32b-instruct | 131,072 | 129,024 | 8,192 | Balanced vision processing |
| qwen2.5-vl-7b-instruct | 131,072 | 129,024 | 8,192 | Efficient vision tasks |
| qwen2.5-vl-3b-instruct | 131,072 | 129,024 | 8,192 | Lightweight vision |
Qwen VL OCR
⚠️ Deprecation Notice:
qwen-vl-max,qwen-vl-plus, andqvq-maxare deprecated. The Qwen2.5 VL models above were also covered by the earlier May 2026 upstream retirement notice. Migrate toqwen3.8-maxor a suitable Qwen3.7 model and retest multimodal input handling. Do not migrate to the now-deprecatedqwen3-vl-flash. See Deprecations.
| Model | Context Window | Max Input | Max Output | Specialization |
|---|---|---|---|---|
| qwen-vl-ocr | 34,096 | 30,000 | 4,096 | Optical character recognition |
# Example using Qwen3.8-Max for image analysis
response = client.chat.completions.create(
model="qwen3.8-max",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "What objects do you see in this image and their approximate locations?",
},
{
"type": "image_url",
"image_url": {
"url": "https://dashscope.oss-cn-beijing.aliyuncs.com/images/256_1.png"
},
},
],
}
],
extra_body={"enable_thinking": False}, # Required for non-streaming requests
)Responses API version This version uses `gpt-5.6-luna` because `qwen3.8-max` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
input=[
{
"role": "user",
"content": [
{"type": "input_text", "text": "Describe this image."},
{"type": "input_image", "image_url": "https://example.com/image.png"},
],
}
],
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Qwen 3 Series
The legacy Qwen3 and Qwen3-Next entries below are retained for historical reference. The listed 32B, 14B, 8B, A3B, A22B, and Qwen3-Next exact IDs are deprecated; earlier 4B, 1.7B, and 0.6B IDs were already covered by the historical retirement notice. Migrate to qwen3.8-max or Qwen3.7. The prefixed routes groq.qwen3-32b, cf.qwen3-30b-a3b-fp8, and the qwen3-235b-a22b-fp8-tput variant are also deprecated.
Standard Qwen 3 Models
| Model | Context Window | Max Input | Max Output | Parameters |
|---|---|---|---|---|
qwen3-32b Deprecated | 131,072 | 98,304 | 16,384 | 32B |
qwen3-14b Deprecated | 131,072 | 98,304 | 8,192 | 14B |
qwen3-8b Deprecated | 131,072 | 98,304 | 8,192 | 8B |
| qwen3-4b | 131,072 | 98,304 | 8,192 | 4B |
| qwen3-1.7b | 131,072 | 98,304 | 8,192 | 1.7B |
| qwen3-0.6b | 131,072 | 98,304 | 8,192 | 0.6B |
Qwen 3 A3B Series
| Model | Context Window | Max Input | Max Output | Specialization |
|---|---|---|---|---|
qwen3-next-80b-a3b-thinking Deprecated | 131,072 | 98,304 | 32,768 | Advanced reasoning with thinking |
qwen3-next-80b-a3b-instruct Deprecated | 131,072 | 98,304 | 32,768 | Enhanced instruction following |
qwen3-30b-a3b Deprecated | 131,072 | 98,304 | 32,768 | Advanced reasoning |
qwen3-30b-a3b-thinking-2507 Deprecated | 131,072 | 98,304 | 32,768 | Thinking processes |
qwen3-30b-a3b-instruct-2507 Deprecated | 131,072 | 98,304 | 32,768 | Instruction following |
Qwen 3 A22B Series
| Model | Context Window | Max Input | Max Output | Specialization |
|---|---|---|---|---|
qwen3-235b-a22b Deprecated | 131,072 | 131,072 | 32,768 | Large-scale reasoning |
qwen3-235b-a22b-instruct-2507 Deprecated | 131,072 | 131,072 | 32,768 | Advanced instructions |
qwen3-235b-a22b-thinking-2507 Deprecated | 131,072 | 131,072 | 32,768 | Complex thinking |
Specialized Models
QWQ Plus Series (Reasoning Models)
⚠️ Deprecated: Both
qwq-plusandqwq-plus-2025-03-05are absent from the current catalog. Useqwen3.8-maxorqwen3.7-maxfor reasoning, and retest reasoning and streaming settings.
| Model | Context Window | Max Input | Max Output | Focus |
|---|---|---|---|---|
qwq-plus Deprecated | 131,072 | 131,072 | 8,192 | Advanced reasoning |
qwq-plus-2025-03-05 Deprecated | 131,072 | 131,072 | 8,192 | Stable reasoning |
Machine Translation Models
Professional translation models supporting 92 languages with bidirectional translation. qwen-mt-turbo and qwen-mt-lite are deprecated. Alibaba recommends qwen3.8-max or Qwen3.7 for migration. The dedicated qwen-mt-plus and qwen-mt-flash routes remain listed; compare their translation-specific behavior if your application depends on it.
| Model | Context Window | Max Input | Max Output | Specialization |
|---|---|---|---|---|
| qwen-mt-plus | 2,048 | 2,048 | 2,048 | Advanced translation |
qwen-mt-turbo Deprecated | 2,048 | 2,048 | 2,048 | Fast translation |
| qwen-mt-flash | 8,192 | 8,192 | 8,192 | High-quality translation |
qwen-mt-lite Deprecated | 8,192 | 8,192 | 8,192 | Fast, cost-effective |
Key Features:
- 92 Languages: Support for major world languages including European, Asian, and Middle Eastern
- Bidirectional: Translate between any pair of supported languages
- Direct Translation: Translate between non-Chinese languages without intermediate Chinese
- Persian/Farsi Support: Full support for Persian, Dari, Arabic, Urdu, Turkish, and more
Supported Languages Include: Arabic, Chinese (Simplified/Traditional), Dutch, English, French, German, Italian, Japanese, Korean, Persian, Portuguese, Russian, Spanish, Turkish, Vietnamese, and 77 more languages.
# Example using Qwen-MT for translation
response = client.chat.completions.create(
model="qwen-mt-flash",
messages=[
{"role": "system", "content": "Translate from English to Persian"},
{
"role": "user",
"content": "Artificial intelligence is transforming the way we live and work.",
},
],
extra_body={"enable_thinking": False},
)
# Output: هوش مصنوعی در حال تغییر نحوه زندگی و کار ما است.Responses API version This version uses `gpt-5.6-luna` because `qwen-mt-flash` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Artificial intelligence is transforming the way we live and work.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Character/Role-Playing Models
Specialized models for creating consistent virtual character interactions with personality preservation.
| Model | Context Window | Max Input | Max Output | Specialization |
|---|---|---|---|---|
| qwen-plus-character | 131,072 | 129,024 | 16,384 | Virtual characters, role-playing |
Key Features:
- Character Consistency: Maintain defined personalities, traits, and speech styles across conversations
- Response Variety: Avoid repetitive responses with style markers
- Relationship Memory: Preserve interaction history and relationship dynamics
- Genre Flexibility: Support for fantasy, sci-fi, romance, and modern scenarios
# Example using Qwen-Plus-Character for virtual characters
response = client.chat.completions.create(
model="qwen-plus-character",
messages=[
{
"role": "system",
"content": "You are a wise wizard named Merlin from a fantasy world. Speak with ancient wisdom and occasional riddles.",
},
{"role": "user", "content": "Merlin, how do I become a great sorcerer?"},
],
extra_body={"enable_thinking": False},
)Responses API version This version uses `gpt-5.6-luna` because `qwen-plus-character` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Merlin, how do I become a great sorcerer?",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Long Context Models
| Model | Context Window | Max Input | Max Output | Specialization |
|---|---|---|---|---|
| qwen2.5-7b-instruct-1m | 1,008,192 | 1,000,000 | 8,192 | Million-token context |
| qwen2.5-14b-instruct-1m | 1,008,192 | 1,000,000 | 8,192 | Extended context |
Coding Models
⚠️ Deprecation Notice:
qwen3-coder-480b-a35b-instruct,qwen3-coder-next,qwen3-coder-plus,qwen3-coder-plus-2025-07-22, andqwen3-coder-plus-2025-09-23are deprecated. Alibaba recommendsqwen3.8-max,qwen3.7-max, orqwen3.7-plus. The separate Coder Flash routes remain listed. The Coder Next architecture and pricing below are historical, and the examples use supported replacements.
| Model | Context Window | Max Input | Max Output | Specialization |
|---|---|---|---|---|
qwen3-coder-480b-a35b-instruct Deprecated | 262,144 | 204,800 | 65,536 | Advanced coding |
qwen3-coder-next Deprecated | 1,000,000 | 997,952 | 65,536 | Frontier coding agents (80B MoE) |
| qwen3-coder-flash | 1,000,000 | 997,952 | 65,536 | Fast coding with tiered pricing |
| qwen3-coder-flash-2025-07-28 | 1,000,000 | 997,952 | 65,536 | Stable fast coding |
qwen3-coder-plus Deprecated | 1,000,000 | 997,952 | 65,536 | Code generation |
qwen3-coder-plus-2025-07-22 Deprecated | 1,000,000 | 997,952 | 65,536 | Latest coding |
Qwen3-Coder-Next
Qwen3-Coder-Next is a frontier 80B MoE (Mixture of Experts) model optimized for coding agents, featuring 10B activated parameters for efficient inference.
Key Features:
- 80B MoE Architecture: Large-scale mixture of experts with 10B activated parameters
- 1M Context Window: Extended context for large codebase understanding
- Agentic Optimization: Designed for autonomous coding workflows
- High Efficiency: Optimized inference with sparse activation
Pricing:
| Model | Input | Cached Input | Output |
|---|---|---|---|
qwen3-coder-next Deprecated | $0.30/1M | $0.15/1M | $1.50/1M |
# Migration example using Qwen3.7-Max for agentic coding tasks
response = client.chat.completions.create(
model="qwen3.7-max",
messages=[
{
"role": "user",
"content": "Analyze this codebase and refactor the authentication module to use JWT tokens with refresh token rotation.",
}
],
max_tokens=8000,
extra_body={"enable_thinking": False}, # Required for non-streaming requests
)
# Migration example using Qwen3.7-Plus for programming tasks
response = client.chat.completions.create(
model="qwen3.7-plus",
messages=[
{
"role": "user",
"content": "Write a Python function to implement a binary search algorithm with proper error handling.",
}
],
max_tokens=1000,
extra_body={"enable_thinking": False}, # Required for non-streaming requests
)Responses API version This version uses `gpt-5.6-luna` because `qwen3.7-max` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Write a Python function to implement a binary search algorithm with proper error handling.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Image Generation Models
Image generation and editing models using the Images API. qwen-image, qwen-image-edit, qwen-image-plus, and qwen-image-max are deprecated and absent from the current catalog. Use a supported image-output model such as qwen-image-3.0 or qwen-image-3.0-pro for /v1/images/generations and /v1/images/edits. qwen3.8-max and Qwen3.7 produce text and are not Images API replacements. Retest model-specific sizes, input images, parameters, and prices; historical image specifications below do not describe the replacement models.
| Model | Specialization | Cost per Image | Resolution Options | Best for |
|---|---|---|---|---|
| qwen-image-3.0-pro | Professional generation/editing | $0.04 at ~1 MP; $0.075 at 2–4 MP | 1K to 4 MP | Production visual workflows |
| qwen-image-3.0 | General generation/editing | $0.04 at ~1 MP; $0.075 at 2–4 MP | 1K to 4 MP | General visual workflows |
| qwen-image-2.0-pro | Professional typography | $0.075 | Native 2K (2048×2048) | PPTs, posters, infographics |
| qwen-image-2.0 | Unified generation/editing | $0.035 | Native 2K (2048×2048) | General image generation |
qwen-image Deprecated | Text-to-image generation | $0.035 | 1:1, 4:3, 3:4, 16:9, 9:16 | Creative image generation |
qwen-image-edit Deprecated | Image editing and modification | $0.045 | Based on input image | Image enhancement and editing |
| z-image-turbo | Fast text-to-image | $0.015 (std) / $0.030 (thinking) | 512×512 to 2048×2048 | Fast generation, text rendering |
| qwen-image-edit-plus | Advanced image editing | $0.03 | Based on input image | Professional editing, style transfer |
qwen-image-3.0-pro and qwen-image-3.0
qwen-image-3.0-pro and qwen-image-3.0 support both new-image generation and source-image editing through the OpenAI-compatible Images API.
| Feature | Details |
|---|---|
| Model IDs | qwen-image-3.0-pro, qwen-image-3.0 |
| Output accounting rate | $40.00 / 1M output tokens |
| Output image, 1K / approximately 1 MP | $0.04 / image |
| Output image, 2–4 MP | $0.075 / image |
| Reference/input image | $0.003 / image |
| Supported endpoints | /v1/images/generations, /v1/images/edits |
from openai import OpenAI
client = OpenAI(
api_key="your-avalai-api-key",
base_url="https://api.avalai.ir/v1",
)
result = client.images.generate(
model="qwen-image-3.0-pro",
prompt="A clean editorial illustration of a renewable-energy city, with room for a headline",
size="1024x1024",
)
print(result.data[0].url)For edits, send the source image to /v1/images/edits; each reference/input image adds $0.003 to the request cost.
qwen-image-2.0-pro
Alibaba's next-generation professional image generation model with advanced typography rendering, supporting 1K-token instructions for direct generation of professional infographics including PPTs, posters, and comics.
| Feature | Details |
|---|---|
| Model ID | qwen-image-2.0-pro |
| Resolution | Native 2K (2048×2048) |
| Input pricing | $0.00 / request |
| Output pricing | $75.00 / 1M tokens ($0.075 / image) |
| Input modalities | Text, Image |
| Output modalities | Image |
| Supported endpoints | /v1/images/generations, /v1/images/edits |
Key Features:
- Professional Typography: 1K-token instruction support for PPTs, posters, and infographics
- Complex Layout: Pixel-perfect multi-script layout with sophisticated text-image composition
- Native 2K Resolution: 2048×2048 for finely detailed realistic scenes
- Unified Model: Generation and editing in a single model
- Photorealism: Microscopic detail on skin pores, fabric weave, architectural textures
- Multiple Calligraphic Styles: Support for various script styles and fonts
- Image Editing: Full support for image-to-image editing tasks
# Generate professional infographic with Qwen-Image-2.0-Pro
response = client.images.generate(
model="qwen-image-2.0-pro",
prompt="A professional business presentation slide showing Q4 revenue growth with clean typography and modern design",
size="1024x1024",
n=1,
)
print(response.data[0].url)qwen-image-2.0
The standard version of Qwen-Image-2.0, offering the same advanced capabilities at a more accessible price point.
| Feature | Details |
|---|---|
| Model ID | qwen-image-2.0 |
| Resolution | Native 2K (2048×2048) |
| Input pricing | $0.00 / request |
| Output pricing | $35.00 / 1M tokens ($0.035 / image) |
| Input modalities | Text, Image |
| Output modalities | Image |
| Supported endpoints | /v1/images/generations, /v1/images/edits |
Key Features:
- Typography Rendering: Support for professional text-in-image generation
- Native 2K Resolution: High-quality image output
- Unified Model: Generation and editing capabilities combined
- Strong Semantic Adherence: Accurate prompt following
- Lighter Architecture: Smaller model size with faster inference
- Cost-Effective: Accessible pricing for high-volume usage
# Generate image with Qwen-Image-2.0
response = client.images.generate(
model="qwen-image-2.0",
prompt="A serene mountain landscape at sunset with 'Peace' written in elegant calligraphy",
size="1024x1024",
n=1,
)
print(response.data[0].url)z-image-turbo
Fast, high-quality image generation model optimized for speed with excellent text rendering.
Key Features:
- High-Speed Generation: Optimized for fast production workflows
- Improved Text Rendering: Better character consistency and text generation
- Crown Support: Add logos or watermarks to generated images
- Flexible Sizes: 42 preset ratios plus custom sizes (512×512 to 2048×2048)
- Thinking Mode: Optional enhanced generation at $0.030 per image
# Example using z-image-turbo
response = client.images.generate(
model="z-image-turbo",
prompt="A professional logo with text 'AI TECH' in modern minimalist style",
size="1024x1024",
n=1,
)qwen-image-edit-plus
Advanced image editing model supporting complex operations including background removal, inpainting, and style transfer.
Key Features:
- Background Removal: Isolate subjects from backgrounds
- Image Inpainting: Fill or replace selected areas
- Style Transfer: Apply artistic styles to images
- Search & Recolor: Change colors in specific regions
- Control Structure: Maintain structural consistency in edits
# Example using qwen-image-edit-plus for background removal
import requests
with open("input_image.png", "rb") as image_file:
response = requests.post(
"https://api.avalai.ir/v1/images/edits",
headers={"Authorization": f"Bearer {api_key}"},
files={"image": image_file},
data={
"model": "qwen-image-edit-plus",
"prompt": "Remove the background and keep only the main subject",
},
)Key Features
- Dual SDK Support: Compatible with OpenAI SDK format and native Dashscope API
- Multiple Resolutions: Support for various aspect ratios (1328×1328, 1664×928, 1472×1140, 1140×1472, 928×1664)
- Advanced Parameters: Negative prompts, intelligent prompt rewriting, watermark control, seed support
- High Quality: Professional-grade image generation with customizable parameters
Usage Examples
# Text-to-image generation using OpenAI SDK format
from openai import OpenAI
client = OpenAI(api_key="your-avalai-api-key", base_url="https://api.avalai.ir/v1")
response = client.images.generate(
model="qwen-image-3.0",
prompt="A serene mountain landscape with a crystal clear lake reflecting snow-capped peaks",
size="1024x1024",
n=1,
response_format="url", # or b64_json
)
print(response.data[0].url)
# Image editing using OpenAI SDK format
import requests
with open("input_image.jpg", "rb") as image_file:
response = requests.post(
"https://api.avalai.ir/v1/images/edits",
headers={"Authorization": f"Bearer {api_key}"},
files={"image": image_file},
data={
"model": "qwen-image-3.0",
"prompt": "Change the sky to a dramatic sunset with orange and purple colors",
},
)
print(response.json())Native Dashscope Format
Use the OpenAI-compatible Images API examples above for supported replacement models. Do not reuse the deprecated qwen-image native request unchanged: native schemas and advanced parameters are model-specific. Confirm the replacement's supported parameters in the Images API reference and provider-specific parameter guide.
Embedding Models
Advanced embedding models for text and multimodal content, supporting semantic search, similarity calculation, and content classification.
Text Embedding Models
| Model | Vector Dimensions | Max Tokens | Specialization | Pricing (per 1M tokens) |
|---|---|---|---|---|
| text-embedding-v4 | 64-2,048 (configurable) | 8,192 | Latest generation, task instructions, sparse vectors | $0.07 |
| text-embedding-v3 | 512-1,024 (configurable) | 8,192 | Previous generation, proven performance | $0.07 |
text-embedding-v4
The latest generation text embedding model with advanced features:
Key Features:
- Configurable Dimensions: 2,048, 1,536, 1,024 (default), 768, 512, 256, 128, 64
- Task Instructions (instruct): Optimize vector quality for specific retrieval scenarios
- Text Type Differentiation: Separate embeddings for query vs document text
- Dense & Sparse Vectors: Generate both types for hybrid search
- Batch Processing: Process up to 10 texts per request
Use Cases:
- Semantic search and retrieval
- AI chat and content recommendation
- High-quality production search engines
- Classification and clustering
Example:
curl https://api.avalai.ir/v1/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-d '{
"model": "text-embedding-v4",
"input": "Machine learning is transforming technology",
"dimensions": 1024
}'from openai import OpenAI
client = OpenAI(api_key="your-avalai-api-key", base_url="https://api.avalai.ir/v1")
response = client.embeddings.create(
model="text-embedding-v4",
input="Machine learning is transforming technology",
dimensions=1024,
)
print(response.data[0].embedding)import { OpenAI } from "openai";
const client = new OpenAI({
apiKey: process.env.AVALAI_API_KEY,
baseURL: "https://api.avalai.ir/v1",
});
const response = await client.embeddings.create({
model: "text-embedding-v4",
input: "Machine learning is transforming technology",
dimensions: 1024,
});
console.log(response.data[0].embedding);Advanced Features with Native API:
# Using extra_body for advanced features
response = client.embeddings.create(
model="text-embedding-v4",
input="Research papers on machine learning",
dimensions=1024,
extra_body={
"text_type": "query", # or "document"
"instruct": "Given a research paper query, retrieve relevant research papers",
},
)text-embedding-v3
Previous generation text embedding model with proven performance:
Key Features:
- Configurable Dimensions: 1,024 (default), 768, 512
- Reliable Performance: Tested across 50+ languages
- Batch Processing: Process up to 10 texts per request
Multimodal Embedding Models
| Model | Vector Dimensions | Max Text Tokens | Image/Video Support | Pricing (per 1M tokens) |
|---|---|---|---|---|
| tongyi-embedding-vision-plus | 1,152 | 1,024 | Images & Videos | $0.09 |
| tongyi-embedding-vision-flash | 768 | 1,024 | Images & Videos | Image/Video: $0.03, Text: $0.09 |
tongyi-embedding-vision-plus
Advanced multimodal embedding model supporting text, images, and videos:
Key Features:
- Cross-Modal Retrieval: Text-to-image, image-to-video, image-to-image search
- Semantic Similarity: Calculate similarity across different modalities
- Multiple Inputs: Support up to 8 images per request
- Video Support: Process videos up to 10 MB (MP4, MPEG, AVI, MOV, MPG, WEBM, FLV, MKV)
- Image Formats: JPG, PNG, BMP (Base64 or URL)
Use Cases:
- Cross-modal semantic search
- Video classification and analysis
- Image search using text or other images
- Content classification and clustering
Example:
curl https://api.avalai.ir/v1/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-d '{
"model": "tongyi-embedding-vision-plus",
"input": {
"contents": [
{"text": "A beautiful sunset over mountains"},
{"image": "https://dashscope.oss-cn-beijing.aliyuncs.com/images/256_1.png"}
]
}
}'from openai import OpenAI
client = OpenAI(api_key="your-avalai-api-key", base_url="https://api.avalai.ir/v1")
# Using extra_body for native Alibaba format
response = client.embeddings.create(
model="tongyi-embedding-vision-plus",
input="placeholder", # Required by OpenAI SDK
extra_body={
"input": {
"contents": [
{"text": "A beautiful sunset over mountains"},
{
"image": "https://dashscope.oss-cn-beijing.aliyuncs.com/images/256_1.png"
},
]
}
},
)
print(response.data[0].embedding)import { OpenAI } from "openai";
const client = new OpenAI({
apiKey: process.env.AVALAI_API_KEY,
baseURL: "https://api.avalai.ir/v1",
});
// Note: For multimodal embeddings, use native HTTP requests
const response = await fetch("https://api.avalai.ir/v1/embeddings", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.AVALAI_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "tongyi-embedding-vision-plus",
input: {
contents: [
{ text: "A beautiful sunset over mountains" },
{ image: "https://dashscope.oss-cn-beijing.aliyuncs.com/images/256_1.png" }
]
}
})
});
const result = await response.json();
console.log(result.data[0].embedding);tongyi-embedding-vision-flash
Fast multimodal embedding model optimized for speed:
Key Features:
- High Speed: Optimized for fast processing
- Multimodal Support: Text, images, and videos
- Cost-Effective: Lower pricing for image/video processing
- Same Capabilities: Similar features to vision-plus with faster inference
Pricing:
- Image/Video tokens: $0.03 per 1M tokens
- Text tokens: $0.09 per 1M tokens
Embedding Best Practices
Dimension Selection:
- Use 1024 dimensions for optimal balance of performance and cost
- Use higher dimensions (1536, 2048) for domains requiring high precision
- Use lower dimensions (768 or below) for cost-sensitive scenarios
Text Type Differentiation (text-embedding-v4 only):
- Use
text_type: "query"for user search queries - Use
text_type: "document"for documents in your database
- Use
Task Instructions (text-embedding-v4 only):
- Provide clear English instructions to optimize vector quality
- Example: "Given a research paper query, retrieve relevant research papers"
Multimodal Embeddings:
- All modalities generate vectors in the same semantic space
- Calculate cosine similarity directly between different modalities
- Use vision-flash for high-volume applications
Batch Processing:
- Process multiple texts in a single request (up to 10)
- Each text must not exceed token limits
Related Resources
Rerank Models
Rerank models perform more accurate sorting of retrieved documents to ensure the most relevant results appear at the top, essential for RAG applications and semantic search.
| Model | Max Documents | Max Tokens per Item | Max Tokens per Request | Languages | Pricing (per 1M tokens) |
|---|---|---|---|---|---|
| qwen3-rerank | 500 | 4,000 | 30,000 | 100+ languages | $0.10 |
qwen3-rerank
A text-ranking model trained on the Qwen LLM foundation that performs relevance ranking for input queries and candidate documents. It supports over 100 languages and long-text inputs.
Key Features:
- High-Accuracy Ranking: Precise relevance scoring for documents
- Multilingual Support: 100+ languages including Chinese, English, Spanish, French, Portuguese, Indonesian, Japanese, Korean, German, and Russian
- Long Text Support: Up to 4,000 tokens per document
- RAG Optimized: Designed for Retrieval-Augmented Generation pipelines
- Prompt Caching: Supports cached input for cost savings
Use Cases:
- Text semantic retrieval
- RAG applications
- Search result re-ranking
- Document relevance scoring
Pricing:
| Type | Cost |
|---|---|
| Input Tokens | $0.10 per 1M tokens |
| Cached Input Tokens | $0.0035 per 1M tokens |
Example:
curl https://api.avalai.ir/v1/rerank \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AVALAI_API_KEY" \
-d '{
"model": "qwen3-rerank",
"query": "What is machine learning?",
"documents": [
"Machine learning is a field of study...",
"Deep learning is a subset of machine learning...",
"Apples are a type of fruit..."
]
}'from openai import OpenAI
client = OpenAI(api_key="your-avalai-api-key", base_url="https://api.avalai.ir/v1")
# Using the rerank endpoint
import requests
response = requests.post(
"https://api.avalai.ir/v1/rerank",
headers={
"Authorization": f"Bearer {client.api_key}",
"Content-Type": "application/json",
},
json={
"model": "qwen3-rerank",
"query": "What is machine learning?",
"documents": [
"Machine learning is a field of study...",
"Deep learning is a subset of machine learning...",
"Apples are a type of fruit...",
],
},
)
print(response.json())Example Response:
{
"model": "qwen3-rerank",
"results": [
{
"index": 1,
"relevance_score": 0.98,
"document": {
"text": "Deep learning is a subset of machine learning..."
}
},
{
"index": 0,
"relevance_score": 0.95,
"document": {
"text": "Machine learning is a field of study..."
}
},
{
"index": 2,
"relevance_score": 0.01,
"document": {
"text": "Apples are a type of fruit..."
}
}
],
"usage": {
"total_tokens": 45
}
}Related Resources
API Endpoints and Integration
Primary Support: Chat Completions API
Supported Alibaba chat models use v1/chat/completions. Availability and features depend on the exact model; image generation, embedding, reranking, and deprecated models must not be treated as universally supported chat routes. Where documented for the selected model, chat features include:
- Function calling and tool use
- Streaming responses
- System messages
- Temperature and other generation parameters
- Multimodal inputs (for vision models)
Model-Specific Support: Messages and Responses APIs
Check the selected model's endpoint support before changing APIs. For example, qwen3.8-max supports v1/messages fully and v1/responses partially. A Chat Completions migration does not by itself establish compatible reasoning controls, tools, or multimodal payloads on another endpoint.
Usage Examples
Basic Text Generation
from openai import OpenAI
client = OpenAI(api_key="your-avalai-api-key", base_url="https://api.avalai.ir/v1")
response = client.chat.completions.create(
model="qwen3.7-plus",
messages=[
{"role": "user", "content": "Explain quantum computing in simple terms."}
],
max_tokens=500,
extra_body={"enable_thinking": False}, # Required for non-streaming requests
)
print(response.choices[0].message.content)Responses API version This version uses `gpt-5.6-luna` because `qwen3.7-plus` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Explain quantum computing in simple terms.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Multimodal Processing
# Vision-language model example
response = client.chat.completions.create(
model="qwen3.8-max",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Describe this chart and its key insights."},
{
"type": "image_url",
"image_url": {"url": "https://example.com/chart.png"},
},
],
}
],
extra_body={"enable_thinking": False}, # Required for non-streaming requests
)Responses API version This version uses `gpt-5.6-luna` because `qwen3.8-max` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
input=[
{
"role": "user",
"content": [
{"type": "input_text", "text": "Describe this image."},
{"type": "input_image", "image_url": "https://example.com/image.png"},
],
}
],
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Streaming Response
# Streaming example (enable_thinking can be omitted or set to False for standard streaming)
stream = client.chat.completions.create(
model="qwen3.8-max",
messages=[
{
"role": "user",
"content": "Write a detailed analysis of renewable energy trends.",
}
],
stream=True,
# Optional: extra_body={"enable_thinking": True} only if you need thinking mode
)
for chunk in stream:
if chunk.choices[0].delta.content is not None:
print(chunk.choices[0].delta.content, end="")Responses API version This version uses `gpt-5.6-luna` because `qwen3.8-max` may not be enabled for `/v1/responses` in the current AvalAI model data.
Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AVALAI_API_KEY"],
base_url="https://api.avalai.ir/v1",
)
response = client.responses.create(
model="gpt-5.6-luna",
instructions="You are a helpful assistant.",
input="Write a detailed analysis of renewable energy trends.",
)
print(response.output_text)messages→input- system message →
instructionsor adeveloperitem choices[0].message.content→response.output_text- for tools and multimodal output, inspect
response.outputby itemtype.
Best Practices
Model Selection: Choose models based on your specific needs:
- Use Flash (e.g.,
qwen3.8-flash,qwen3.6-flash) for high-throughput applications requiring speed - Use
qwen3.7-plusfor balanced general-purpose, coding, and multimodal workloads - Use
qwen3.8-maxorqwen3.7-maxfor complex reasoning, coding agents, and long-horizon execution - For image understanding, choose a supported multimodal Qwen3.8 or Qwen3.7 model and validate its input modalities
- For image generation/editing, use an image-output model such as
qwen-image-3.0, not a text-output chat model
- Use Flash (e.g.,
Context Management: Be mindful of context windows when processing long documents or conversations.
API Compatibility: Check endpoint and feature support for the exact replacement model. Do not assume Chat Completions, Messages, and Responses accept identical parameters.
Version Management: Pin a supported exact version when consistency is required, but continue monitoring deprecation notices; a dated snapshot is not guaranteed indefinite availability.
Pricing Information
For current input, output, cached-input, image, and tier rate-limit prices, see Pricing and the Model Explorer. Prices retained for deprecated models on this page are historical, not current offers.