Qwen4-Max on Vercel AI Gateway

Qwen4 · Alibaba

Serverless

Last refreshed 2026-11-16. Next refresh: weekly.

Why use Qwen4-Max on Vercel AI Gateway?

Vercel AI Gateway offers Qwen4-Max with pay-as-you-go pricing at $1.50/1M input tokens. Vercel AI Gateway is a unified AI proxy providing a single OpenAI-compatible API endpoint to 275+ models from 25+ providers including Anthropic, OpenAI, Google, Meta, Mistral, DeepSeek, xAI, Alibaba, Amazon, ByteDance, Cohere, MiniMax, MoonshotAI, KwaiPilot, Black Forest Labs, Recraft, Voyage AI, NVIDIA, and more.

Compare Qwen4-Max across 6 providers to find the best fit for your use case
Input / 1M
$1.50
Output / 1M
$4.50
Cache
read $0.075 / 5m $1.88
Batch
Not sourced

Setup recipe

Python + curl
Install
pip install openai
Auth
export AI_GATEWAY_API_KEY=...
Call
import os
from openai import OpenAI
client = OpenAI(
    api_key=os.environ["AI_GATEWAY_API_KEY"],
Model ID
alibaba/qwen4-max

Request example

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AI_GATEWAY_API_KEY"],
    base_url="https://ai-gateway.vercel.sh/v1"
)
response = client.chat.completions.create(
    model="alibaba/qwen4-max",
    messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)

Gotchas

  • Use provider model ID "alibaba/qwen4-max", not the LLMReference slug "qwen4-max".
  • creator/model-name e.g. kwaipilot/kat-coder-pro-v2
  • The examples expect AI_GATEWAY_API_KEY; rename it only if your application config maps the new variable.

Compare Qwen4-Max Across Providers

ProviderInput (per 1M)Output (per 1M)
Alibaba Cloud PAI-EAS$1.50$4.50
OpenRouter$1.50$4.50
Vercel AI Gateway$1.50$4.50
DeepInfra$1.41$4.24
Novita AI$1.41$4.24
View all 6 providers →

Pricing

TypePrice (per 1M)
Input tokens$1.50
Output tokens$4.50

Capabilities

VisionMultimodalReasoningJSON / Tool useStructured OutputsPrompt CachingVideo

About Qwen4-Max

Qwen4-Max is the first production model in Alibaba's Qwen4 series and the general-availability successor to Qwen4-Max-Preview, with pay-as-you-go API access on Alibaba Cloud Model Studio. The Qwen team describes a new sparse MoE architecture with a 2.4-trillion-parameter backbone, 71B parameters activated per token and an additional 328B N-gram embedding parameters, with native vision. It takes text, image and video input and returns text, with a 1,000,000-token context window, deep thinking at low, high and xhigh effort, parallel tool calling, web search, structured output, and explicit and implicit caching, over OpenAI- and Anthropic-compatible APIs.

Get Started