Qwen4-35B-A3B Lands on AI Gateway: Open-Source MoE Model Supports 1M Context

Qwen4's first open-weight model Qwen4-35B-A3B lands on AI Gateway, balancing capability and cost with 1M context and MoE.
Alibaba's Qwen4-35B-A3B, the first open-weight model in the Qwen4 series, is released under Apache 2.0 and available on AI Gateway via a unified API. With 35B total parameters and ~3B activated per token, it shares the flagship Qwen4-Max architecture, supports text, image, and video inputs with 1M-token context, and uses hybrid linear and sparse attention to compress KV cache. It targets long-horizon agent tasks and visual coding, and is accessible with the model name alibaba/qwen4-35b-a3b at no markup.
Alibaba's Qwen family has released Qwen4-35B-A3B, its first open-weight model, now officially available on AI Gateway under the Apache 2.0 license. This means developers can call this mixture-of-experts (MoE) model directly through a unified API without deploying or managing infrastructure themselves.
Model Architecture: MoE Combined with Hybrid Attention
Qwen4-35B-A3B is an MoE model with 35B total parameters and roughly 3B activated per token. It shares the same architecture and training techniques as Qwen4-Max—a design choice worth noting: the open-source version is not a downgraded product but follows the same technical path as the flagship closed model.
The model accepts text, image, and video inputs, with a context window of 1M tokens. What really makes long context "usable" is its hybrid linear and sparse attention mechanism—it processes long inputs faster while significantly compressing KV cache usage. For scenarios involving long documents, large codebases, or long-running agent sessions, this cache efficiency optimization matters more in practice than raw window size alone.
Mixture of Experts (MoE) is an architecture that splits a model into multiple "expert" subnetworks: each token is routed to only a few of them during inference, so total parameter count can far exceed the parameters actually involved in computation. In the name Qwen4-35B-A3B, "35B" refers to total parameters and "A3B" to roughly 3B activated per token—the gap between the two is exactly the sparsity benefit of MoE: the model has greater knowledge capacity, but the cost of a single forward pass is close to that of a dense 3B-class model. The trade-off is that MoE is more sensitive to memory capacity and expert routing load balancing, and deployment still requires reserving space for all expert weights.
KV cache is the mechanism in autoregressive generation that caches the Key/Value tensors of historical tokens to avoid recomputing attention results. Its memory footprint grows linearly with context length, and at windows on the order of 1M tokens it often becomes the real bottleneck for long-context inference—not compute itself. Linear attention processes sequences with near-linear complexity, sparse attention lets only some tokens participate in full attention computation, and combining the two keeps long-range modeling capability while bringing KV cache down to an acceptable range. This is the technical background behind the emphasis that "cache efficiency matters more in practice than window size."
Capability Upgrades: Agents and Visual Coding in Focus
Official capability comparisons show that, compared with previous Qwen open-source models, Qwen4-35B-A3B performs better on long-horizon multi-step agent tasks and professional-domain knowledge work. Another targeted improvement is "visual-output-oriented coding"—front-end development, 3D modeling, and game development, scenarios that require code to generate visual results, are singled out in this round's capability description.
On inference efficiency, the model is described as "thinking more concisely," requiring fewer tokens to complete tasks. For token-billed API calls, this directly affects cost—especially in agent loops with repeated reasoning, where token savings compound with each step.
How to Access: From SDK to Coding Agents
On AI Gateway, the model name is alibaba/qwen4-35b-a3b. Calling it with the AI SDK takes just a few lines:
import { streamText } from 'ai';
const result = streamText({
model: 'alibaba/qwen4-35b-a3b',
prompt: 'Write a Python function to merge two sorted linked lists.',
});
for await (const text of result.textStream) {
process.stdout.write(text);
}
Besides the AI SDK, the Chat Completions interface is also available. To use it in coding agents like Claude Code, Codex, or Cursor, install the latest Vercel CLI and run npx vercel ai-gateway setup, then select the model in your agent. An official model playground is also available for direct trial.
The Chat Completions interface is the most widely used request format for LLM APIs today: it describes conversation history as a messages array and returns the model's reply. OpenAI's API specification has become the de facto standard, and most gateways and inference services are compatible with it. Compared with higher-level abstractions like the AI SDK—which wraps streaming output, tool calls, and type hints—calling Chat Completions directly suits teams with existing custom calling stacks or those reusing existing OpenAI-compatible clients. On AI Gateway, both access methods point to the same model endpoint, so switching requires no changes to model-side configuration.
The Value of AI Gateway: Unified Entry Point and Transparent Costs
The significance of this launch goes beyond having one more available model. AI Gateway itself provides a unified model-calling API and supports usage and cost tracking, retry and failover configuration to achieve higher availability than a single provider. Built-in features also include custom reports, Zero Data Retention support, API key budget management, and routing rules.
On pricing, AI Gateway passes through provider prices with no markup and charges no platform fee for inference; BYOK (bring your own key) requests qualify as well. For teams using multiple models, this no-markup aggregation layer lowers the hidden costs of switching between options.
BYOK (Bring Your Own Key) means developers use API keys they obtained from the model provider and forward requests through the gateway, rather than having the gateway platform hold the keys and resell quota. For teams, the benefit of BYOK is that billing still settles directly with the provider, existing enterprise contracts and quotas carry over, and they still get the gateway layer's unified logging, retries, and routing. The mention that BYOK requests also enjoy no-markup pass-through means the gateway positions itself as a pure control plane in these scenarios, not a billing intermediary.
A Signal Worth Noting
By open-sourcing its first weight model under Apache 2.0 with the same architecture and training method as the flagship model, the Qwen4 series continues Tongyi Qianwen's consistent commitment to open source. The 35B-total, 3B-activated configuration strikes a pragmatic balance between capability and inference cost, while the 1M context plus hybrid-attention cache optimization points to agents and long-document processing—the two deployment scenarios that currently consume the most context budget. For developers, the barrier to entry is now down to one model name and one CLI command.
One-line Summary
Qwen4's first open-weight model Qwen4-35B-A3B lands on AI Gateway, balancing capability and cost with 1M context and MoE architecture.
Paragraph Summary
Alibaba's Qwen4-35B-A3B, the first open-weight model in the Qwen4 series, is released under Apache 2.0 and available on AI Gateway, callable directly through a unified API. It has 35B total parameters with roughly 3B activated per token, shares the architecture and training techniques of the flagship Qwen4-Max, supports text, image, and video inputs with a 1M-token context, and its hybrid linear and sparse attention significantly compresses KV cache and speeds up long-input processing. It focuses on improving long-horizon multi-step agent tasks and visual coding scenarios such as front-end, 3D modeling, and games, with more concise reasoning and lower token consumption. Access requires only the model name alibaba/qwen4-35b-a3b; AI Gateway passes through provider pricing with no markup and offers usage tracking, retries, and failover.
Related articles

AI Teams Up with Mathematician to Claim Proof of the Riemann Hypothesis? A One-Stop Guide to the 167-Year-Old Problem
A mathematician claims a six-week collaboration with Claude produced a proof of the 167-year-old Riemann Hypothesis, released in Lean at over 250,000 pages and independently compiled. This guide starts from prime counting and explains how the zeta function, the critical line, and the zeros determine prime distribution.

AI Cheating Forces South Korea's Education Minister Out, OpenAI Proposes AI Speed Limit
South Korea's education minister resigns over AI anti-cheating chaos; OpenAI proposes a perplexity-based common red line for AI. Plus: A-share margin cut to 80%, Riemann machine proof.

Open-Weight Model Explosion: Alibaba Qwen 4, Amazon Ergo and MiniMax M4 Launch Together
Qwen 4 35B, Amazon's trillion-parameter Ergo and MiniMax M4 all go open in one week, DeepSuite scores up to 74; Anthropic delays next-gen training six weeks as the open-closed gap narrows to 64 days.