
How to Use Qwen3.8 Max: Python, TypeScript, and cURL
qwen3.8-max across Chat Completions, Responses, and Messages. Keep the ID in configuration, because the current documentation URL still retains the historical Preview slug. Run one real account-level smoke test before sending production traffic.Route note — August 3, 2026: The production model ID isqwen3.8-max. EvoLink Docs still use a Preview-era URL, so copy the production ID from the model page rather than from the documentation slug.
QwenCloud release and EvoLink route status
The name now exists in three different contracts. Treating them as interchangeable is the fastest way to ship a broken request.
| Surface | Model ID | Status on August 3, 2026 | What it proves |
|---|---|---|---|
| QwenCloud production catalog | qwen3.8-max | Official upstream flagship | QwenCloud lists the 1M context model with Thinking, Function Calling, built-in tools, and Structured Output |
| Qwen Token Plan | qwen3.8-max-preview | Preview channel | Useful for interactive evaluation; it does not establish the EvoLink request ID |
| EvoLink production route | qwen3.8-max | Available; account smoke test required | Chat, Responses, and Messages use one production model ID; the Docs URL retains a Preview-era slug |
EVOLINK_QWEN_MODEL in every example. Set it to qwen3.8-max, then verify the resolved model and usage in your first response. Keep the environment variable so canary and rollback changes remain auditable.What you need before the first request
| Requirement | What to prepare | Why it matters |
|---|---|---|
| EvoLink API key | Create a key in the API key dashboard | Every request uses Bearer authentication |
| Base URL | https://direct.evolink.ai/v1 for text and long connections | Keeps SDK configuration separate from endpoint paths |
| Multimodal Base URL | https://api.evolink.ai/v1 for image, audio, or video input | EvoLink documents this as the primary multimodal endpoint |
| Model environment variable | Start with the ID shown in your EvoLink account | Prevents a Preview-to-GA change from spreading through application code |
| Smoke-test prompt | One short deterministic request | Verifies auth, route, response shape, and billing before larger tests |
| Fallback model | A verified model already available through EvoLink | Keeps production traffic moving if activation or capacity changes |
Keep all three integration values outside the application code:
export EVOLINK_API_KEY="your-evolink-api-key"
export EVOLINK_BASE_URL="https://direct.evolink.ai/v1"
export EVOLINK_QWEN_MODEL="qwen3.8-max-preview"qwen3.8-max ID and the final EvoLink ID must be identical.Choose Chat, Responses, or Messages
EvoLink documents three compatible request surfaces. Choose one based on your application architecture rather than sending the same workflow through all three.
| Protocol | Endpoint | Best starting point | Important difference |
|---|---|---|---|
| Chat Completions | /v1/chat/completions | Existing OpenAI-compatible chat applications | Uses messages; thinking returns through reasoning_content |
| Responses | /v1/responses | New agents, built-in tools, and server-linked conversations | Uses input, previous_response_id, and optional session caching |
| Messages | /v1/messages | Anthropic SDKs and Messages-compatible agent stacks | Uses a top-level system field and requires max_tokens |
If you already use the OpenAI Chat Completions shape, start there. Use Responses when you need built-in tools or server-managed multi-turn state. Choose Messages when your application already stores Anthropic-style content blocks and events.
Use this decision tree:
Existing OpenAI-compatible chat application?
├─ Yes → Chat Completions
└─ No
├─ New agent needs built-in tools or server-linked turns? → Responses
└─ Existing Anthropic Messages stack? → MessagesChoose one primary protocol per workload. Maintaining three shapes for the same feature increases parsing, retry, and observability work without improving model quality.
First successful call with cURL
This request follows EvoLink's documented Chat Completions contract:
curl --request POST \
--url "${EVOLINK_BASE_URL}/chat/completions" \
--header "Authorization: Bearer ${EVOLINK_API_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"model\": \"${EVOLINK_QWEN_MODEL}\",
\"messages\": [
{
\"role\": \"system\",
\"content\": \"You are a concise software architecture assistant.\"
},
{
\"role\": \"user\",
\"content\": \"Return three checks for a safe API rollout.\"
}
]
}"id, the resolved model, at least one item in choices, and token usage. Record the returned model string during activation testing; it is useful evidence that the gateway resolved the alias you expected.Python integration with the OpenAI SDK
Install the current OpenAI Python SDK, then point it at EvoLink:
pip install openaiimport os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["EVOLINK_API_KEY"],
base_url=os.getenv("EVOLINK_BASE_URL", "https://direct.evolink.ai/v1"),
)
response = client.chat.completions.create(
model=os.environ["EVOLINK_QWEN_MODEL"],
messages=[
{
"role": "system",
"content": "You are a concise software architecture assistant.",
},
{
"role": "user",
"content": "Return three checks for a safe API rollout.",
},
],
)
print(response.choices[0].message.content)
print(response.model)The integration boundary is only the API key, Base URL, and model ID. That is also the safest migration pattern: change configuration first, then compare output and operational behavior before changing prompts or business logic.
TypeScript integration
npm install openaiimport OpenAI from "openai";
const apiKey = process.env.EVOLINK_API_KEY;
const model = process.env.EVOLINK_QWEN_MODEL;
if (!apiKey || !model) {
throw new Error("EVOLINK_API_KEY and EVOLINK_QWEN_MODEL are required");
}
const client = new OpenAI({
apiKey,
baseURL: process.env.EVOLINK_BASE_URL ?? "https://direct.evolink.ai/v1",
});
const response = await client.chat.completions.create({
model,
messages: [
{
role: "system",
content: "You are a concise software architecture assistant.",
},
{
role: "user",
content: "Return three checks for a safe API rollout.",
},
],
});
console.log(response.choices[0].message.content);
console.log(response.model);EVOLINK_QWEN_MODEL exists during application startup instead of silently falling back to another model. Explicit configuration makes rollout and rollback auditable.Stream thinking and final content separately
enable_thinking and returns thinking through reasoning_content. Streaming clients must not assume every chunk contains final answer text.import os
from openai import OpenAI
model = os.environ.get("EVOLINK_QWEN_MODEL")
if not model:
raise RuntimeError("EVOLINK_QWEN_MODEL is required")
client = OpenAI(
api_key=os.environ["EVOLINK_API_KEY"],
base_url=os.getenv("EVOLINK_BASE_URL", "https://direct.evolink.ai/v1"),
)
stream = client.chat.completions.create(
model=model,
messages=[
{"role": "user", "content": "Review this rollout plan for failure modes."}
],
stream=True,
extra_body={"enable_thinking": True},
)
for chunk in stream:
delta = chunk.choices[0].delta
reasoning = getattr(delta, "reasoning_content", None)
if reasoning:
print(reasoning, end="", flush=True)
if delta.content:
print(delta.content, end="", flush=True)Decide whether reasoning should be stored, displayed, or discarded before launch. Keep final content and reasoning in separate observability fields so a parser change does not turn hidden analysis into user-facing output.
Responses API for tools and multi-turn state
input rather than messages. EvoLink also documents previous_response_id for linking turns and the x-dashscope-session-cache: enable header for optional server-side session caching.curl --request POST \
--url "${EVOLINK_BASE_URL}/responses" \
--header "Authorization: Bearer ${EVOLINK_API_KEY}" \
--header "Content-Type: application/json" \
--header "x-dashscope-session-cache: enable" \
--data "{
\"model\": \"${EVOLINK_QWEN_MODEL}\",
\"input\": \"List the production checks for a model-route canary.\"
}"id only when your privacy, retention, and application requirements allow server-linked conversations. EvoLink's current documentation says the ID remains valid for seven days; re-check that contract before relying on it in a durable workflow.A second turn links to the first response instead of resending the full conversation:
curl --request POST \
--url "${EVOLINK_BASE_URL}/responses" \
--header "Authorization: Bearer ${EVOLINK_API_KEY}" \
--header "Content-Type: application/json" \
--header "x-dashscope-session-cache: enable" \
--data "{
\"model\": \"${EVOLINK_QWEN_MODEL}\",
\"previous_response_id\": \"resp_FROM_FIRST_CALL\",
\"input\": \"Turn those checks into a five-step canary plan.\"
}"resp_FROM_FIRST_CALL as an example response identifier, not a copy-ready constant. Log cache and usage fields from the actual response; the header requests session caching but does not prove that every call produced a billable cache hit.Messages API for Anthropic-compatible stacks
messages and requires max_tokens:curl --request POST \
--url "${EVOLINK_BASE_URL}/messages" \
--header "Authorization: Bearer ${EVOLINK_API_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"model\": \"${EVOLINK_QWEN_MODEL}\",
\"max_tokens\": 1024,
\"system\": \"You are a concise software architecture assistant.\",
\"messages\": [
{
\"role\": \"user\",
\"content\": \"Return three checks for a safe API rollout.\"
}
]
}"system item into the Messages array. Preserve the protocol's top-level system field, content-block format, cache fields, and streaming event types.
Add thinking, streaming, tools, and caching deliberately
These features change response parsing, latency, token use, or state. Enable them one at a time.
| Feature | Chat Completions | Responses | Messages | Production check |
|---|---|---|---|---|
| Thinking | enable_thinking; parse reasoning_content | reasoning.effort | thinking content blocks | Measure accepted-result quality, latency, and output tokens |
| Streaming | stream: true; OpenAI-style SSE chunks | Responses events | Anthropic-style message events | Handle disconnects and partial output |
| Tools | Function definitions in tools | Built-in and custom function tools | Anthropic-compatible tool blocks | Validate arguments before executing side effects |
| Caching | Explicit cache_control on supported content | Session-cache header plus documented cache behavior | cache_control content blocks | Inspect usage fields instead of assuming a hit |
| Multimodal input | Use https://api.evolink.ai/v1 | Use the multimodal Base URL | Use supported image blocks | Test target media format and size on the live route |
Do not copy QwenCloud pricing or cache discounts into an EvoLink cost estimate. The upstream model, Token Plan, and EvoLink gateway are different commercial channels. Use the live EvoLink pricing surface after activation.
Validate tool calls before side effects
A model-generated tool call is untrusted input. Validate the function name, parse its arguments, apply an allowlist, and require application-level authorization before executing a write.
import { z } from "zod";
const createCanarySchema = z.object({
workload: z.string().min(1).max(80),
trafficPercent: z.number().min(0.1).max(10),
});
function validateToolCall(name: string, rawArguments: string) {
if (name !== "create_canary") {
throw new Error(`Blocked unknown tool: ${name}`);
}
return createCanarySchema.parse(JSON.parse(rawArguments));
}trafficPercent value can still be unsafe for the current tenant, environment, or change window.Add bounded retry and fallback
429, and transient 5xx responses. Do not automatically retry 400, 401, or 402, and do not assume text-generation requests are idempotent if downstream tools can cause side effects.import os
import random
import time
from openai import APIConnectionError, APIStatusError, APITimeoutError, OpenAI
client = OpenAI(
api_key=os.environ["EVOLINK_API_KEY"],
base_url=os.getenv("EVOLINK_BASE_URL", "https://direct.evolink.ai/v1"),
)
def complete_with_fallback(messages):
models = [
os.environ["EVOLINK_QWEN_MODEL"],
os.environ["EVOLINK_FALLBACK_MODEL"],
]
for model in models:
for attempt in range(3):
try:
return client.chat.completions.create(
model=model,
messages=messages,
timeout=60,
)
except APIStatusError as error:
if error.status_code != 429 and error.status_code < 500:
raise
except (APIConnectionError, APITimeoutError):
pass
time.sleep((2 ** attempt) + random.random())
raise RuntimeError("Primary and fallback routes failed")Use a fallback that has already passed the same response-parser and tool-contract tests. A fallback name in an environment variable is not operational resilience until the alternate route has been exercised.
Documented response contract vs live proof
Before activation, these fields are documentation-backed expectations, not EvoLink Qwen3.8 test results.
| Protocol | Documented success evidence | Activation assertion |
|---|---|---|
| Chat Completions | id, resolved model, choices, usage, optional reasoning_content and tool_calls | At least one final content chunk, expected finish reason, and visible usage |
| Responses | Response id, output events/items, usage, optional server-linked state | A second call succeeds with the first previous_response_id |
| Messages | Message ID, content blocks, stop reason, usage, Anthropic-style stream events | Required max_tokens accepted and final text block parsed |
Do not mark a capability as supported because the request was accepted. A tool test must return a valid call, a cache test must expose usage evidence, and a streaming test must complete without losing the final event.
Troubleshoot the first integration
| Symptom | Likely cause | Safe next step |
|---|---|---|
400 invalid_request_error | Wrong protocol shape, unsupported field, or missing required value | Reduce to the minimal example for the selected endpoint |
401 authentication_error | Missing, expired, or malformed Bearer token | Create or rotate the EvoLink key and confirm the header |
402 insufficient_quota | The account lacks credits | Review account credits before retrying |
404 or model not found | Route is not enabled, the ID changed, or the endpoint is wrong | Copy the exact model ID from EvoLink and verify the protocol path |
429 rate_limit_error | Request or token rate exceeded | Retry with exponential backoff and jitter; lower concurrency |
500 or transient gateway error | Upstream or gateway failure | Retry a bounded number of times, then use a configured fallback |
| Empty final text while thinking is enabled | The client reads only one response field | Inspect reasoning and final-content fields for the selected protocol |
Never retry 400, 401, or 402 errors blindly. Fix the request, credential, or account state first. Retry 429 and transient 5xx responses only with limits; otherwise an agent loop can multiply cost and load.
Production rollout checklist
- Copy the exact EvoLink model ID into
EVOLINK_QWEN_MODEL. - Run one short non-streaming text request and save the resolved model plus usage.
- Test streaming, tools, thinking, caching, and multimodal input separately.
- Replay 20–50 representative tasks against the current production baseline.
- Measure first-pass success, accepted-result latency, retries, output tokens, and human correction time.
- Start with shadow traffic, then a small canary for one workload.
- Keep a verified fallback behind the same EvoLink gateway.
- Roll back when error rate, latency, cost per accepted result, or task quality crosses its guardrail.
Production-validation test ledger
The route is available, but this article does not invent account-level results. Replace each validation state only with a dated result from your EvoLink account.
| Capability | Route status | Evidence to record in your account |
|---|---|---|
| Chat Completions | Available; validate | Request ID, resolved model, HTTP status, finish reason, usage |
| Responses | Available; validate | Response ID, output type, usage, second-turn result |
| Messages | Available; validate | Message ID, content-block parse, stop reason, usage |
| Streaming | Available; validate | First-event latency, final event, disconnect behavior |
| Thinking | Available; validate | Reasoning field/block, final content, token accounting |
| Function tools | Available; validate | Valid tool name/arguments, tool-result continuation |
| Cache | Available; validate | Cache creation/read fields and repeated-prefix cost |
| Multimodal input | Validate on the target endpoint | Supported media type, accepted size, response parse |
The production rollout trigger is your first successful smoke test plus recorded model resolution, usage, and fallback behavior. Keep this guide URL stable as evidence is refreshed.
Verify the route before the first production call
Do not register on the strength of a release headline alone. Complete these checks first; create an API key only when the route fits your workload.
- 01
Released?
Yes. Qwen3.8 Max is the production model; Preview remains historical channel context.
- 02
Available?
Yes on EvoLink. Confirm the live route and model ID on the product page.
- 03
Right for me?
Best suited to long-context reasoning, repository-scale coding, and tool-heavy agents; lighter work should stay on a smaller route.
- 04
How much?
Use the live pricing module on the product page. Do not reuse upstream or Preview-plan pricing.
- 05
How do I call it?
Choose Chat Completions, Responses, or Messages, then follow the integration guide and parameter reference.
All five checks complete? Create an API key.
Frequently asked questions
Is Qwen3.8 Max already callable through EvoLink?
qwen3.8-max, confirm that it appears in your account, and require a successful smoke test before sending production traffic.Which model ID should I use?
qwen3.8-max, while the current EvoLink draft documentation uses qwen3.8-max-preview. Keep the value in configuration so it can be changed without a code release.Which Base URL should I use?
https://direct.evolink.ai/v1 for text and long-lived connections. EvoLink documents https://api.evolink.ai/v1 as the primary endpoint when the request contains image, audio, or video input.Should a new application use Chat or Responses?
Chat is the simplest choice for an existing OpenAI-compatible application. Responses is a better starting point when you want server-linked turns, built-in tools, or Responses event streaming.
Can I use an Anthropic SDK?
/v1/messages contract for an Anthropic-compatible application. Preserve the top-level system field, required max_tokens, content blocks, and Anthropic-style streaming events.Does the Guide contain Qwen3.8 Max pricing?
No. Pricing belongs to the Qwen3.8 Max product page and EvoLink's live pricing surface. Keeping it out of this tutorial prevents stale duplicates and keyword overlap.
How should I handle rate limits?
Cap concurrency, add exponential backoff with jitter for 429 responses, bound the number of retries, and keep a fallback route. Do not retry invalid requests or authentication failures unchanged.
What should I test before production?
Verify authentication, model resolution, response parsing, streaming, tools, thinking, caching, multimodal input, timeout behavior, retry limits, billing visibility, and fallback. Then run a workload-specific shadow and canary evaluation.


