AINewsnow

Calling Qwen 4 Max from Python: streaming, real token usage, cost per request, and why it times out

This story is from 2026-11-17. It is preserved in the archive; the latest stories are on the live feed.

Qwen 4 Max is Alibaba's flagship language model (model ID qwen4-max ): a one-million-token context, text, image and video input, and thinking switched on by default. This tutorial shows how to call it with the OpenAI SDK, read real token usage from a stream, estimate what a request costs, and avoid…

Read the full story at DEV Community — AI ↗

Timeline · 3 reports

  1. 2026-11-17 12:06 · DEV Community — AI
    Cost per task, not per token: a Python calculator for Qwen 4 Max vs GPT-6 Sol, including the 272K-token price step
  2. 2026-11-17 12:04 · DEV Community — AI
    A/B test two LLMs with one Python script: Qwen 4 Max vs Claude Opus 5.5 on score, latency, tokens and cost
  3. 2026-11-17 12:03 · DEV Community — AI
    Calling Qwen 4 Max from Python: streaming, real token usage, cost per request, and why it times out

More stories

  1. ChatGPT, Claude, Gemini and Grok helped plan terror attacks in US government test — The Independent Tech
  2. Harvard Study Finds US Hyperscale Data Centers Emit Carbon on Par With Denmark — CNET AI
  3. Claude, ChatGPT, Gemini, and Grok produced viable terror plans in test, per GAO — FedScoop
  4. The AI Access Audit: every AI tool that can read your Google Workspace data, in 15 minutes — DEV Community — AI
  5. Claude Code AGENTS.md vs CLAUDE.md: one shared instruction file — DEV Community — AI
  6. Where Repository Packing needs over MCP — DEV Community — AI
  7. What I learned building a read-only bank MCP server for Claude and ChatGPT — DEV Community — AI
  8. When an AI Realizes It's Taking a Test (GPT-6.2 Astra Explained) — DEV Community — AI

Read the Daily Brief: the day's most important AI stories →