The DailyToken

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. Three AI workflows for comparing announcements and building timelines — DEV Community — AI
  2. How to Run AI Visibility Research Directly from Claude Using MCP — DEV Community — AI
  3. How to share context between Claude Code and ChatGPT — DEV Community — AI
  4. 3 AI tools for organizing maintenance records and operating manuals — DEV Community — AI
  5. I Audited 15 Top Tech & SaaS Websites for AI Search Readiness (llms.txt & AI Crawlers) — OpenAI Scored 64/100 — DEV Community — AI
  6. How to Use ChatGPT and Claude at Work Without Leaking API Keys, Cluttering Notes, or Carrying Tracking Cookies — DEV Community — AI
  7. How to Connect Claude, ChatGPT & Cursor to Free FSRS Spaced Repetition via MCP — DEV Community — AI
  8. ChatGPT vs Gemini vs Claude: Which AI Assistant Is Worth Paying For? — DEV Community — AI

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