1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const axios = require('axios');
const fs = require('fs');
const path = require('path');
// helper function to help you convert your local images into base64 format
async function toB64(imgPath) {
const data = fs.readFileSync(path.resolve(imgPath));
return Buffer.from(data).toString('base64');
}
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/qwen-3.8-max";
const data = {
"messages": [
{
"role": "user",
"content" : "tell me a joke on cats"
},
{
"role": "assistant",
"content" : "here is a joke about cats..."
},
{
"role": "user",
"content" : "now a joke on dogs"
},
]
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();An array of objects containing the role and content
Could be "user", "assistant" or "system".
A string containing the user's query or the assistant's response.
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Qwen3.8 Max is the flagship large language model from Alibaba's Qwen team and the most capable model in the Qwen family to date. It is a mixture-of-experts (MoE) system with 2.4 trillion total parameters that activates roughly 95 billion parameters per request, built on the Qwen3.5 architecture. The model accepts text and image input and returns text, with a context window of up to 1 million tokens. It is designed for complex reasoning, visual understanding, coding, and long-horizon agentic workflows — the kind of work where a model has to plan, act, verify, and iterate over many steps rather than answer a single prompt.
Qwen3.8 Max shines on repository-scale coding agents, autonomous refactors, and bug-fixing loops that run across many steps. Its long context makes it strong for long-document analysis, legal and financial review, knowledge bases, and multi-step research assistants. The multimodal input supports document understanding, screenshot reasoning, and visual QA. Teams building agent frameworks can drop it into existing OpenAI/Anthropic-compatible clients.
Give the model explicit, structured, multi-part instructions — it follows numbered requirements closely. In hands-on testing, a senior-engineer coding prompt produced a correct, well-commented Kadane's-algorithm implementation with accurate complexity analysis and passing test cases, finishing cleanly without truncation. For agentic runs, break goals into checkpoints so intermediate work can be inspected. For pure text tasks, leave the image field empty; add an image only when the task is vision-grounded.
Is Qwen3.8 Max multimodal? Yes — it accepts text and image input and returns text.
What context length does it support? Up to 1 million tokens, suited to whole repositories and long documents.
What is it best at? Agentic coding, long-horizon execution, long-context reasoning, and multimodal understanding.
Who makes Qwen3.8 Max? Alibaba's Qwen team; it is the flagship of the Qwen3.8 series.
How do I call it? Send a prompt to the API endpoint using an OpenAI-style messages request and read the generated text from the response.