المنزل المدونة

كيفية استخدام واجهة برمجة تطبيقات Qwen4 Max

Qwen4 Max عبر API

Nov 16, 2026

EmpirioLabs AI

إفصاح: كُتبت هذه المقالة بمساعدة الذكاء الاصطناعي وراجعتها EmpirioLabs AI.

Qwen4 Max هو الجيل القادم من عائلة Qwen من علي بابا، وتم إصداره في 16 نوفمبر 2026. يجمع بين توليد النصوص، وفهم الصور والفيديو، والتفكير العميق في نموذج واحد، وهو مصمم للبرمجة، وإنتاجية المكاتب، وتصميم الواجهة الأمامية، والمهام الوكالية المعقدة. يقرأ حتى مليون رمز من السياق، ويفكر قبل أن يجيب بشكل افتراضي، ويكشف هذا التفكير من خلال ثلاثة مستويات جهد استدلالية.

يتوفر Qwen4 Max على EmpirioLabs عبر واجهة برمجة تطبيقات متوافقة مع OpenAI، مع استدعاء للوظائف، ومخرجات منظمة صارمة لمخطط JSON، وبث، وحتى 262,144 رمز إخراج مع تفكير. جربه في playground أو من أي عميل متوافق مع OpenAI. المواصفات الكاملة والأسعار الحالية موجودة على صفحة موديل Qwen4 Max.

Watch the launch film

Every program in the film was written by Qwen4 Max in one shot through the EmpirioLabs API: a self-playing piano, a starship HUD and a weather app. The score was generated by ACE-Step on EmpirioLabs. Watch it on YouTube.

التسعير

Usage based. One flat input rate and one flat output rate apply at every prompt size, and thinking tokens bill as output tokens. Cached input. Repeated prompt prefixes are cached automatically, and cached input tokens bill at a steeply discounted rate, so long system prompts and multi-turn conversations cost less on every turn after the first. Built-in tools. Web search, text-to-image search, and image-to-image search add a small fee for each call that actually runs; the web extractor and code interpreter run at no extra cost. Current rates are on the model page and the pricing page.

Quickstart

Point any OpenAI SDK at the EmpirioLabs base URL and pass qwen4-max as the model:

from openai import OpenAI

client = OpenAI(
    base_url="https://api.empiriolabs.ai/v1",
    api_key="YOUR_EMPIRIOLABS_API_KEY",
)

resp = client.chat.completions.create(
    model="qwen4-max",
    messages=[
        {"role": "user", "content": [
            {"type": "text", "text": "Rebuild this landing page section as responsive HTML and CSS."},
            {"type": "image_url", "image_url": {"url": "https://example.com/mockup.png"}},
        ]},
    ],
    reasoning_effort="xhigh",
)

print(resp.choices[0].message.content)

The same model id works on /v1/responses, the Anthropic-shaped /v1/messages, and the Google-compatible /v1beta/models/qwen4-max:generateContent route.

Thinking and reasoning effort

Thinking is on by default and streams back as reasoning_content alongside the answer. reasoning_effort sets how much the model reasons before it answers: low, high (the default), or xhigh. Higher effort spends more reasoning tokens. For a hard token ceiling on reasoning instead, set thinking_budget (up to 262,144 tokens), which runs at the default effort. Set enable_thinking to false for short, latency-sensitive calls.

Built-in tools

Five built-in tools sit behind tool_* parameters and are all off by default: tool_web_search, tool_web_extractor, tool_code_interpreter, tool_web_search_image, and tool_image_search. The web extractor requires web search, and both the extractor and the code interpreter run only while thinking is on. When a tool runs, the response carries a usage.tool_usage map with the number of calls, so you can audit every billed call.

Structured output and function calling

For an exact response shape, pass response_format with {"type": "json_schema", ...} and "strict": true: the model returns exactly the schema's keys. Plain JSON mode with {"type": "json_object"} is also supported. Function calling works with thinking on, including tool_choice: "required" and a named function, and the model can call several functions in one turn.

Things worth knowing before your first call

  • max_tokens covers reasoning and the answer together. With thinking on, a small cap leaves little room for the answer once the model has reasoned. Leave room above the reasoning you expect, or lower reasoning_effort for short replies.
  • Choose either a reasoning effort or a thinking budget. low and xhigh cannot be combined with thinking_budget in the same request; a budget on its own runs at the default effort.
  • JSON mode needs the word "json" in your messages. A {"type": "json_object"} request is rejected unless the word appears somewhere in the conversation. JSON Schema requests have no such requirement.
  • Prompt caching is automatic. Explicit cache controls such as cache_control are not supported and return an error; send the same prefix and the cache applies on its own.

Qwen4 Max is available now in the playground and through the EmpirioLabs API.

هل أنت مستعد لاستخدام نقاط نهاية أفضل؟

استكشف نماذجنا، أو تواصل معنا بشأن استفسارات الأعمال، أو النشر المخصص، أو أي شيء آخر.