# Qwen3.8-Max > Answer questions about images, video and text in one chat model, with thinking effort adjustable from fully off to maximum and a 1,000,000-token context. ## Overview - **Endpoint**: `https://queue.modelrunner.run/alibaba/qwen3.8-max/chat/completions` — synchronous, OpenAI-compatible chat completions - **Model ID**: `alibaba/qwen3.8-max` - **Category**: text-to-text (LLM) - **Kind**: inference - **Context window**: 1M tokens - **Max output**: 131.1K tokens - **Input → output**: text + image + video → text - **Features**: reasoning (thinking), tool calling, JSON mode, streaming - **Tags**: qwen, qwen3.8, qwen3.8-max, alibaba, llm, text-to-text, chat, chat-completions, openai-compatible, reasoning, thinking, chain-of-thought, vision, multimodal, image-understanding, video-understanding, visual-question-answering, agentic, agentic-coding, coding, code-generation, long-context, million-token-context, mixture-of-experts, streaming, tool-calling, json-mode ## Pricing - **Input tokens**: $2 per 1M - **Cached input tokens**: $0.25 per 1M - **Output tokens**: $6 per 1M - Billed per token from the model's reported usage; reasoning (thinking) tokens bill at the output rate unless priced separately above. ## How to call it ⚠️ This model is **not** on the asynchronous queue API. Do **not** `POST https://queue.modelrunner.run/alibaba/qwen3.8-max` — the queue submit returns HTTP 400 for this model. There is no status polling and no `response_url`: one POST returns the reply (or streams it). Connection recipe for any OpenAI SDK or OpenAI-compatible tool (they append `/chat/completions` to the base URL themselves): - `base_url`: `https://queue.modelrunner.run/alibaba/qwen3.8-max` - `model`: `alibaba/qwen3.8-max` (optional — the URL is authoritative; if present it must equal this value) - `api_key`: a ModelRunner API key, sent as `Authorization: Bearer ` (`Authorization: Key ` also works) - **Model discovery**: `GET https://queue.modelrunner.run/alibaba/qwen3.8-max/models` answers the OpenAI list shape with this model — for tools that probe `{base_url}/models` (GitHub Copilot's custom-provider flow). One provider entry for every ModelRunner LLM: `base_url` `https://queue.modelrunner.run/v1` (`GET https://queue.modelrunner.run/v1/models` lists ids; there the `model` field is required) Behaviour: - **Streaming**: `"stream": true` returns Server-Sent Events (`data:` frames, terminal `data: [DONE]`); `stream_options: {"include_usage": true}` adds a usage frame. - **Timeouts**: non-streaming calls are cut at ~290 s — use streaming for long generations. - **Body limit**: 10 MB (vision data-URIs fit). - **Reserved key**: a top-level `metadata` object (flat string map, ≤16 keys) is stored on the request and never sent to the model; filter later with `GET https://queue.modelrunner.run/requests?metadata=`. - **Errors** use the OpenAI envelope `{ "error": { "message", "type", "code" } }`: 401 `invalid_api_key`, 404 `model_not_found`, 400 `invalid_request_error`, 429 `insufficient_quota` (balance) or `rate_limit_exceeded`, 502 `upstream_error`. - **Requests**: every call is a normal request row — `GET https://queue.modelrunner.run/requests/` works read-only (the response `id` is `chatcmpl-`), and it appears in the dashboard and `list_requests`. ## Best for - Ask questions about a screenshot, chart or photo and get a written answer - Describe or summarise what happens in a video clip - Agentic coding: multi-step debugging, refactoring and terminal tasks - Turn thinking off for fast cheap answers, or dial it up for hard problems - Read a whole codebase or document set in one million-token prompt ### Request parameters - **`seed`** (`integer`, _optional_): Best-effort determinism hint. - **`stop`** (`unknown`, _optional_): Up to 4 stop sequences. - **`tools`** (`array`, _optional_): OpenAI-format tool definitions the model may call. - **`stream`** (`boolean`, _optional_): Return the reply as a Server-Sent Events stream of deltas terminated by \`data: \[DONE\]\`. - Default: `false` - **`messages`** (`array`, _required_): OpenAI-style conversation history. Each item is an object with a \`role\` (\`system\`, \`user\`, \`assistant\` or \`tool\`) and \`content\`. This model reads images and video as well as text, so \`content\` may be a plain string or an array of content parts — an image part has type \`image_url\` and carries the image URL at \`image_url.url\`, and up to 2,048 images fit in one request. - **`max_tokens`** (`integer`, _optional_): Upper bound on the generated reply, up to the documented 131,072-token output ceiling. That ceiling is the same in thinking and non-thinking mode. - Range: `1` to `"+inf"` - **`tool_choice`** (`unknown`, _optional_): \`auto\`, \`none\`, \`required\`, or a specific tool. - **`response_format`** (`object`, _optional_): Structured-output control. Set its \`type\` to \`json_object\` to force a JSON reply. Thinking is on by default and the brand documents that a thinking-mode reply may not be strictly valid JSON, so pair this with \`reasoning_effort\` set to \`none\` when the output has to parse. - **`thinking_budget`** (`integer`, _optional_): Ceiling on chain-of-thought tokens. Defaults to 262,144, the maximum chain-of-thought length published for this model; the 131,072-token reply ceiling is published as its own separate figure. When the limit is reached the model stops reasoning and responds immediately. - Default: `262144` - Range: `1` to `"+inf"` - **`reasoning_effort`** (`ReasoningEffortEnum`, _optional_): How hard the model thinks before answering. Defaults to \`xhigh\`, which is already the maximum tier: \`high\` and \`max\` resolve to the same behaviour, \`minimal\` and \`low\` to the low tier, \`medium\` is its own tier, and \`none\` switches thinking off completely. Thinking tokens bill as output tokens, so lowering this is the main cost lever. - Default: `"xhigh"` - Options: `"none"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`, `"max"` ### Response - **`id`** (`string`, _optional_): - **`model`** (`string`, _optional_): - **`usage`** (`object`, _optional_): - **`object`** (`string`, _optional_): - **`choices`** (`array`, _optional_): - **`created`** (`integer`, _optional_): ## Default Example **Input** ```json { "messages": [ { "role": "user", "content": [ { "type": "image_url", "image_url": { "url": "https://media.modelrunner.ai/RUzu91W6MnzSN2S01RjJg.png" } }, { "text": "Read the sign in this photo exactly as written, then tell me how many birds are perched on it. Answer in two short lines.", "type": "text" } ] } ], "max_tokens": 300, "reasoning_effort": "none" } ``` **Output** ```json { "id": "chatcmpl-kDI3sEJ1Sb0x0oMnSKSrs", "model": "alibaba/qwen3.8-max", "usage": { "total_tokens": 823, "prompt_tokens": 810, "completion_tokens": 13, "prompt_tokens_details": { "text_tokens": 40, "image_tokens": 770, "cached_tokens": 0 }, "completion_tokens_details": { "text_tokens": 13 } }, "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "PUFFIN COVE 3.7 km\n2", "reasoning_content": "" }, "finish_reason": "stop" } ], "created": 1788811106 } ``` ## Usage Examples ### cURL ```bash # One synchronous call — the reply is in the response body (no polling) curl https://queue.modelrunner.run/alibaba/qwen3.8-max/chat/completions \ -H "Authorization: Bearer $MODELRUNNER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this picture?" }, { "type": "image_url", "image_url": { "url": "https://example.com/photo.jpg" } } ] } ], "reasoning_effort": "medium" }' # Streaming (Server-Sent Events, ends with "data: [DONE]") curl -N https://queue.modelrunner.run/alibaba/qwen3.8-max/chat/completions \ -H "Authorization: Bearer $MODELRUNNER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What is in this picture?" }, { "type": "image_url", "image_url": { "url": "https://example.com/photo.jpg" } } ] } ], "reasoning_effort": "medium", "stream": true }' ``` ### Python (openai SDK) ```python import os from openai import OpenAI client = OpenAI( base_url="https://queue.modelrunner.run/alibaba/qwen3.8-max", api_key=os.environ["MODELRUNNER_API_KEY"], ) completion = client.chat.completions.create( model="alibaba/qwen3.8-max", messages=[ { "role": "user", "content": [ { "type": "text", "text": "What is in this picture?" }, { "type": "image_url", "image_url": { "url": "https://example.com/photo.jpg" } } ] } ], reasoning_effort="medium", # low | medium | high — thinking bills as output tokens ) print(completion.choices[0].message.content) # Streaming: add stream=True and iterate the chunks # for chunk in client.chat.completions.create(..., stream=True): # print(chunk.choices[0].delta.content or "", end="") ``` ### JavaScript (openai SDK) ```javascript import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://queue.modelrunner.run/alibaba/qwen3.8-max", apiKey: process.env.MODELRUNNER_API_KEY, }); const completion = await client.chat.completions.create({ model: "alibaba/qwen3.8-max", messages: [ { "role": "user", "content": [ { "type": "text", "text": "What is in this picture?" }, { "type": "image_url", "image_url": { "url": "https://example.com/photo.jpg" } } ] } ], reasoning_effort: "medium", // low | medium | high — thinking bills as output tokens }); const reply = completion.choices[0].message.content; // Streaming: pass stream: true and iterate the chunks // for await (const chunk of await client.chat.completions.create({ ..., stream: true })) { // process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); // } ``` More integrations (LangChain, Vercel AI SDK, LiteLLM, editor tools): https://modelrunner.ai/models/alibaba/qwen3.8-max#connect ## Additional Resources - [Playground](https://modelrunner.ai/models/alibaba/qwen3.8-max) - [OpenAPI Schema](https://modelrunner.ai/models/alibaba/qwen3.8-max/openapi.json) - [LLM Instructions](https://modelrunner.ai/models/alibaba/qwen3.8-max/llms.txt)