# Qwen 3.8 Max

Qwen 3.8 Max opens the Qwen 3.8 generation as Alibaba Cloud's most capable model. One endpoint covers text-only and vision-language work, from multi-file software engineering to turning a screenshot into a working page.

- **Model ID:** `alibaba/qwen3.8-max`
- **Type:** chat
- **Providers:** alibaba, fireworks
- **Context window:** 1,000,000
- **Maximum output tokens:** 128,000
- **Pricing:** $2/1M input tokens, $6/1M output tokens
- **Canonical page:** https://vercel.com/ai-gateway/models/qwen3.8-max

## Supported parameters

Detailed capability metadata has not been reported for this model.

## Example

```ts
import { streamText } from 'ai'

const result = streamText({
  model: 'alibaba/qwen3.8-max',
  prompt: 'Why is the sky blue?'
})
```

## About

Qwen 3.8 Max is the Max-tier release in Alibaba Cloud's Qwen 3.8 generation, released August 2, 2026 and available through Alibaba Cloud, Fireworks on AI Gateway. Qwen 3.8 Max uses a Mixture-of-Experts architecture with 2.4 trillion parameters, accepts text, images, and video, and works within a context window of 1M tokens with up to 128K tokens per response.

Alibaba Cloud positions Qwen 3.8 Max as its most capable Qwen model to date, with significant gains over the Qwen 3.7 series. Handling text-only and vision-language work in a single endpoint removes the usual split between a text flagship and a separate vision model. Target workloads include software engineering and office productivity, plus visual tasks: turning screenshots or design files into working pages, captioning video, and answering questions grounded in an image.

Hybrid thinking mode is enabled by default. Turn thinking off per request for short lookups, or cap the thinking budget when latency and token spend matter more than reasoning depth. Reasoning traces can carry across turns, so long agent loops keep their chain of thought through repeated tool calls. Qwen 3.8 Max supports function calling and structured output, and Alibaba Cloud also documents built-in web search and code execution tools for the model.

Qwen 3.8 Max accepts up to 2,048 image URLs or 250 base64 images per request, video up to two hours or 2 GB, and as many as 64 videos. Each image consumes tokens in proportion to its resolution, so downscale assets that don't need full detail.

You can integrate Qwen 3.8 Max through AI SDK, Chat Completions API, Responses API, Messages API, or other API formats, from TypeScript or Python. To drive a coding agent with Qwen 3.8 Max, run `vercel ai-gateway setup` to connect Claude Code, Codex, OpenCode, or Pi, then select `alibaba/qwen3.8-max` inside the agent.

## What to consider

Qwen 3.8 Max sits at the top of the Qwen lineup, so per-token cost is the highest in the family. Send the requests that need flagship reasoning here and route bulk classification or extraction to a Flash-tier model. See the pricing panel on this page for current rates.

Thinking is enabled by default, which adds reasoning tokens to every response. Long agent loops that chain many tool calls multiply that overhead, so tune the thinking budget before running production traffic at scale.

## When to use

### Best For

- **Multi-file software engineering** covering refactoring, diff editing, and repository-wide changes with flagship reasoning
- **Screenshot and design to code** work that turns screenshots or design files into working pages
- **Video and visual Q&A** covering captioning for long clips and answering questions grounded in an image
- **Office productivity automation** across document, spreadsheet, and workflow tasks that mix text with visual input
- **Unified text and vision pipelines** served by one endpoint instead of separate text and vision models

### Consider Alternatives When

- **Cost-sensitive bulk work** dominates, where Qwen3.7-Flash handles high-volume classification and extraction for less
- **Balanced quality and cost** fits the workload, where Qwen3.7-Plus covers most multimodal tasks below the Max tier
- **Previous-generation parity** is enough, where Qwen3.7-Max already handles long-horizon agent loops
- **Image or video generation** is required, which calls for a generation-class model rather than a multimodal understanding model

## Best for

- **Multi-File Software Engineering:** Refactoring, diff editing, and repository-wide changes with flagship reasoning
- **Screenshot And Design To Code:** Turning screenshots or design files into working pages
- **Video And Visual Q&A:** Captioning long clips and answering questions grounded in an image
- **Office Productivity Automation:** Document, spreadsheet, and workflow tasks that mix text with visual input
- **Unified Text And Vision Pipelines:** One endpoint for both text-only and vision-language requests

## Consider alternatives

- **Cost-Sensitive Bulk Work:** Qwen3.7-Flash handles high-volume classification and extraction for less
- **Balanced Quality And Cost:** Qwen3.7-Plus covers most multimodal tasks below the Max tier
- **Previous-Generation Parity:** Qwen3.7-Max already handles long-horizon agent loops in the 3.7 line
- **Image Or Video Generation:** A generation-class model fits tasks that produce pixels rather than read them

## Frequently asked questions

### How does Qwen 3.8 Max compare to the Qwen 3.7 series?

Alibaba Cloud positions Qwen 3.8 Max as its most capable Qwen model, with significant improvements over the 3.7 series. Qwen 3.8 Max pairs a Mixture-of-Experts architecture at 2.4 trillion parameters with a context window of 1M tokens and handles text-only and vision-language work in the same endpoint.

### What inputs does Qwen 3.8 Max accept?

Text, images, and video. Qwen 3.8 Max returns text, so pair it with a generation-class model when you need images or video as output.

### What is the context window for Qwen 3.8 Max?

The context window is 1M tokens, with up to 128K tokens per response.

### Is thinking mode enabled by default on Qwen 3.8 Max?

Yes. Qwen 3.8 Max uses hybrid thinking mode with thinking enabled by default. Turn it off per request for simple queries, or cap the thinking budget to limit reasoning tokens.

### Does Qwen 3.8 Max support function calling and structured output?

Yes. Qwen 3.8 Max supports function calling and structured output, and Alibaba Cloud also documents built-in web search and code execution tools for the model.

### How many images and videos can Qwen 3.8 Max handle per request?

Up to 2,048 image URLs or 250 base64 images, plus as many as 64 videos, with each video up to two hours or 2 GB. Images are capped at 16 million pixels each, and higher resolution consumes more tokens.

### Can I use Qwen 3.8 Max inside a coding agent?

Yes. Run `vercel ai-gateway setup` to connect Claude Code, Codex, OpenCode, or Pi, then select `alibaba/qwen3.8-max` inside the agent.

### How do I access Qwen 3.8 Max through AI Gateway?

Authenticate with an AI Gateway API key or OIDC token and reference `alibaba/qwen3.8-max` as the model. You can call Qwen 3.8 Max through AI SDK, Chat Completions API, Responses API, Messages API, or other API formats, from TypeScript or Python.

### What does Qwen 3.8 Max cost?

See the pricing section on this page for today's rates. AI Gateway reflects each provider's pricing for Qwen 3.8 Max with no markup and no platform fee on inference.

### Does Qwen 3.8 Max support zero data retention?

Yes, Zero Data Retention is available for this model. Zero Data Retention is offered on a per-provider basis. See https://vercel.com/docs/ai-gateway/capabilities/zdr for details.

## Links

- [Model page](https://vercel.com/ai-gateway/models/qwen3.8-max)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://qwen.ai/blog?id=qwen3.8)


If you encounter incorrect information, can’t find what you need, need a capability Vercel doesn’t currently offer, or have any other feedback to report, please do it by following the instructions at https://vercel.com/feedback.md.
