Qwen3 235B A22B
Qwen3 235B A22B is Alibaba Cloud's large-scale 235B mixture-of-experts model with a context window of 262.1K tokens, activating 22 billion of 235 billion parameters per inference to deliver strong reasoning, coding, and multilingual performance.
View API reference- Input and output price
- Prices from: Input $0.09, Output $0.10, Per 1M tokens
- 24h uptime
- Loading AI Gateway uptime
import { streamText } from 'ai'
const result = streamText({ model: 'alibaba/qwen-3-235b', prompt: 'Why is the sky blue?'})Copy link to headingPlayground
Try out Qwen3 235B A22B by Alibaba Cloud. Usage is billed to your team at API rates. Free users (those who haven't made a payment) get $5 of credits every 30 days.
Qwen3 235B A22B
Copy link to headingProviders
Route requests across multiple providers. Copy a provider slug to set your preference. Visit the docs for more info. Using a provider means you agree to their terms, listed under Legal.
| Provider |
|---|
Copy link to headingUptime24 hours
Direct request success rate on AI Gateway and per-provider. Visit the docs for more info.
Copy link to headingThroughput24 hours
P50 throughput on live AI Gateway traffic, in tokens per second (TPS). Visit the docs for more info.
Copy link to headingLatency24 hours
P50 time to first token (TTFT) on live AI Gateway traffic, in milliseconds. View the docs for more info.
Getting started
Call Qwen3 235B A22B through AI Gateway with the AI SDK generateText and streamText functions, or through the OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages APIs by changing the base URL. AI Gateway authenticates the request and routes it to an available provider.
Install the AI SDK (pnpm add ai dotenv), create an API key from the API Keys page, and set it as AI_GATEWAY_API_KEY in your environment. Full setup is covered in the text generation quickstart.
import { generateText } from 'ai';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'alibaba/qwen-3-235b', prompt: 'Why is the sky blue?', });
console.log(result.text);}
main().catch(console.error);Top-level parameters
The same Qwen3 235B A22B request in each API format AI Gateway supports.
import { generateText } from 'ai';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'alibaba/qwen-3-235b', system: 'You are a concise technical assistant.', prompt: 'Summarize the tradeoffs between static generation and SSR.', maxOutputTokens: 1024, temperature: 0.5, });
console.log(result.text);}
main().catch(console.error);Standard parameters like prompt, messages, temperature, and tools work as documented in the AI SDK docs. These are the parameters with model-specific behavior.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID in the form creator/model, e.g. alibaba/qwen-3-235b. AI Gateway routes the request to an available provider. |
maxOutputTokens | number | No | Hard cap on generated tokens. Qwen3 235B A22B supports up to 32,768 output tokens. |
providerOptions | Record<string, JSONValue> | No | AI Gateway routing options under gateway, plus any provider-native options under the provider’s own namespace — see the table below. |
Input limits
| Input | Formats | Sources | Max count | Max size | Limits |
|---|---|---|---|---|---|
| Text | — | — | — | — | Prompt and response share the 262K-token context window |
Provider options
Set AI Gateway routing options under providerOptions.gateway. For provider-specific options, pass them under the provider’s namespace as documented by the AI SDK.
Learn more in the AI SDK alibaba provider docs.
import { generateText } from 'ai';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'alibaba/qwen-3-235b', prompt: 'Why is the sky blue?', providerOptions: { gateway: { only: ['deepinfra', 'vertex'], }, }, });
console.log(result.text);}
main().catch(console.error);These AI Gateway routing options apply to every model. Provider-specific options pass through under the provider’s own namespace (for example providerOptions.anthropic) exactly as documented by the AI SDK.
| Parameter | Type | Required | Description |
|---|---|---|---|
providerOptions.gateway.only | string[] | No | Restrict routing to these provider slugs. Requests fail over only within the listed providers. |
providerOptions.gateway.order | string[] | No | Preferred provider order. Listed providers are tried first; unlisted providers remain available as fallbacks. |
providerOptions.gateway.sort | 'cost' | 'ttft' | 'tps' | No | Rank candidate providers by price, time to first token, or tokens per second instead of the default routing order. |
providerOptions.gateway.zeroDataRetention | boolean | No | Route only to providers with a zero-data-retention policy for this model. |
Routing across providers
AI Gateway serves the same model through multiple providers and fails over automatically. order expresses a preference while keeping every provider eligible; only is a hard allowlist — if none of the listed providers are available the request fails instead of falling back.
Options under a provider's own namespace (for example providerOptions.anthropic) are forwarded to that provider with the request. Providers ignore option namespaces that don't apply to them, so it is safe to set provider options alongside gateway routing options.
Tool calling
Expose tools the model can call. Define each tool’s inputs with a Zod schema.
import { generateText, tool } from 'ai';import { z } from 'zod';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'alibaba/qwen-3-235b', prompt: 'What is the weather in San Francisco?', tools: { getWeather: tool({ description: 'Get the current weather for a location', inputSchema: z.object({ location: z.string() }), execute: async ({ location }) => ({ location, temperatureC: 18 }), }), }, });
console.log(result.text);}
main().catch(console.error);Copy link to headingAbout Qwen3 235B A22B
Qwen3 235B A22B is the largest MoE in the Qwen3 family. Its MoE design routes each token through 8 of 128 expert layers, activating only 22 billion of the full 235 billion parameters. This sparsity keeps serving costs proportional to the activated parameter count while the full parameter space retains the breadth of knowledge needed for performance competitive with large proprietary models.
The model covers 119 languages and dialects.
On benchmark evaluations, Qwen3 235B A22B achieves results competitive with other strong reasoning models across coding, mathematics, and general capability assessments. Like all Qwen3 models, it supports a hybrid reasoning system: thinking mode activates extended computation for step-by-step problem solving, while non-thinking mode produces immediate responses when latency matters more than deliberation. You can configure a thinking budget per request to tune the cost-quality tradeoff dynamically.
The model supports tool calling and Model Context Protocol (MCP), making it suitable for multi-step workflows where the model orchestrates external tools or APIs. Alibaba Cloud recommends pairing it with the Qwen-Agent framework for complex agentic pipelines.
Copy link to headingWhat To Consider When Choosing a Provider
- Configuration: For applications with strict data sovereignty requirements, provider selection through AI Gateway lets you target infrastructure in specific regions without modifying your application's API calls.
- Zero Data Retention: Zero Data Retention is available for this model. It is offered on a per-provider and model basis. See the documentation for details.
- Authentication: AI Gateway authenticates requests using an API key or OIDC token. You do not need to manage provider credentials directly.
Copy link to headingWhen to Use Qwen3 235B A22B
Best for
- Complex reasoning tasks: When a problem genuinely requires the highest reasoning ceiling in the Qwen3 family, such as graduate-level mathematics, complex logical deduction chains, or multi-step proofs, this model is designed for it
- Competitive coding challenges and complex software engineering: The model's benchmark results in coding tasks place it alongside large proprietary models, making it appropriate for problems that smaller models consistently struggle with
- Enterprise agentic pipelines: With strong tool-calling capabilities and MCP support, Qwen3 235B A22B can serve as the planning and reasoning backbone for multi-step automated workflows where reliability matters
- Multilingual content at scale: Covering 119 languages, this model suits global-facing products that need high-quality output across many language families without running separate per-language models
- Research and evaluation baselines: As the largest-capability open-weight model in the Qwen3 Apache 2.0-licensed line, it's a useful reference point for capability assessments
Consider alternatives when
- Latency is a binding constraint: Larger models take longer to generate tokens. For interactive applications where response time outweighs peak quality, smaller Qwen3 variants or the 30B-A3B MoE model will serve users better
- Cost per query needs to be minimized: The 235B model carries higher inference costs than smaller family members. If most queries are routine instruction-following tasks, a smaller model will deliver adequate quality at lower cost
- Lighter-weight alternatives suffice: For teams that don't need the full capability ceiling of a 235B model, smaller dense variants like Qwen3-14B or Qwen3-32B handle many production workloads at lower per-token cost
Copy link to headingConclusion
Qwen3 235B A22B is the right choice when the task genuinely demands the highest capability in the Qwen3 family, complex reasoning, high-stakes coding, or multilingual generation at quality levels that smaller models can't reliably reach. Running it through AI Gateway means a single API integration covers provider failover, consolidated billing, and access to DeepInfra, Google Vertex AI, Novita AI without additional account management.
Copy link to headingFrequently Asked Questions
Why does a 235B model only activate 22B parameters per inference?
The mixture-of-experts (MoE) architecture routes each token through eight of 128 specialized expert layers rather than the full parameter set. Inference compute scales with the activated parameters (22B), not the total (235B). This keeps a 235B-capacity model economically viable to serve while retaining the broad knowledge encoded in its full parameter space.
How does Qwen3 235B A22B perform against other large language models on benchmarks?
Alibaba Cloud's benchmarks show competitive results against other strong reasoning models on coding, mathematics, and general capability evaluations. Specific numbers vary by benchmark.
What distinguishes the 235B MoE model from Qwen3-32B in the same family?
Qwen3-32B is a dense model where all 32 billion parameters activate every inference, while Qwen3 235B A22B is a sparse MoE with 10 times the total capacity but slightly fewer active parameters than the 32B. The 235B variant reaches higher benchmark ceilings on the hardest tasks while the 32B offers a simpler deployment profile.
Can I control how much reasoning compute the model uses per request?
Yes. Thinking mode and non-thinking mode are both available, and you can configure a thinking budget per request. Smaller budgets reduce latency and cost; larger budgets allow the model to work through more complex reasoning steps before responding.
What languages does this model support?
Qwen3 235B A22B supports 119 languages and dialects across Indo-European, Sino-Tibetan, Afro-Asiatic, Austronesian, Dravidian, Turkic, and other language families.
Is Zero Data Retention available for this model?
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.
Your use is subject to Alibaba Cloud's Terms & Privacy Policies.