MiniMax H3 (Hailuo 3) is live on EvoLinkTry it with 10 free credits
Qwen3.8 Max integration paths branching through one gateway into developer protocols and production tools
Tutorial

How to Use Qwen3.8 Max: Python, TypeScript, and cURL

Jacey
Jacey
August 3, 2026
15 min read
Quick answer: EvoLink's production route uses model ID 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 is qwen3.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.
This is an integration guide, not a pricing or release-status page. Use the Qwen3.8 Max model page for current availability, model ID, and live pricing.

The name now exists in three different contracts. Treating them as interchangeable is the fastest way to ship a broken request.

SurfaceModel IDStatus on August 3, 2026What it proves
QwenCloud production catalogqwen3.8-maxOfficial upstream flagshipQwenCloud lists the 1M context model with Thinking, Function Calling, built-in tools, and Structured Output
Qwen Token Planqwen3.8-max-previewPreview channelUseful for interactive evaluation; it does not establish the EvoLink request ID
EvoLink production routeqwen3.8-maxAvailable; account smoke test requiredChat, Responses, and Messages use one production model ID; the Docs URL retains a Preview-era slug
This guide intentionally uses 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

RequirementWhat to prepareWhy it matters
EvoLink API keyCreate a key in the API key dashboardEvery request uses Bearer authentication
Base URLhttps://direct.evolink.ai/v1 for text and long connectionsKeeps SDK configuration separate from endpoint paths
Multimodal Base URLhttps://api.evolink.ai/v1 for image, audio, or video inputEvoLink documents this as the primary multimodal endpoint
Model environment variableStart with the ID shown in your EvoLink accountPrevents a Preview-to-GA change from spreading through application code
Smoke-test promptOne short deterministic requestVerifies auth, route, response shape, and billing before larger tests
Fallback modelA verified model already available through EvoLinkKeeps 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"
The last value is deliberately configurable. Replace it with the exact model ID shown by EvoLink when the route is enabled; do not infer that Qwen's upstream 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.

ProtocolEndpointBest starting pointImportant difference
Chat Completions/v1/chat/completionsExisting OpenAI-compatible chat applicationsUses messages; thinking returns through reasoning_content
Responses/v1/responsesNew agents, built-in tools, and server-linked conversationsUses input, previous_response_id, and optional session caching
Messages/v1/messagesAnthropic SDKs and Messages-compatible agent stacksUses 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? → Messages

Choose 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.\"
      }
    ]
  }"
A successful response should contain an 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 openai
import 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 openai
import 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);
Validate that 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

EvoLink's Chat contract documents 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

Responses uses 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.\"
  }"
Store the returned response 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.\"
  }"
Treat 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 moves the system instruction outside 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.\"
      }
    ]
  }"
Do not mechanically convert Chat messages by moving a system item into the Messages array. Preserve the protocol's top-level system field, content-block format, cache fields, and streaming event types.
Developer application routing Chat, Responses, and Messages requests through one unified gateway with streaming, tools, retries, fallback, and monitoring
Developer application routing Chat, Responses, and Messages requests through one unified gateway with streaming, tools, retries, fallback, and monitoring

Add thinking, streaming, tools, and caching deliberately

These features change response parsing, latency, token use, or state. Enable them one at a time.

FeatureChat CompletionsResponsesMessagesProduction check
Thinkingenable_thinking; parse reasoning_contentreasoning.effortthinking content blocksMeasure accepted-result quality, latency, and output tokens
Streamingstream: true; OpenAI-style SSE chunksResponses eventsAnthropic-style message eventsHandle disconnects and partial output
ToolsFunction definitions in toolsBuilt-in and custom function toolsAnthropic-compatible tool blocksValidate arguments before executing side effects
CachingExplicit cache_control on supported contentSession-cache header plus documented cache behaviorcache_control content blocksInspect usage fields instead of assuming a hit
Multimodal inputUse https://api.evolink.ai/v1Use the multimodal Base URLUse supported image blocksTest 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));
}
Schema validation does not replace permission checks. A valid trafficPercent value can still be unsafe for the current tenant, environment, or change window.

Add bounded retry and fallback

Retry only timeouts, connection failures, 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.

ProtocolDocumented success evidenceActivation assertion
Chat Completionsid, resolved model, choices, usage, optional reasoning_content and tool_callsAt least one final content chunk, expected finish reason, and visible usage
ResponsesResponse id, output events/items, usage, optional server-linked stateA second call succeeds with the first previous_response_id
MessagesMessage ID, content blocks, stop reason, usage, Anthropic-style stream eventsRequired 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

SymptomLikely causeSafe next step
400 invalid_request_errorWrong protocol shape, unsupported field, or missing required valueReduce to the minimal example for the selected endpoint
401 authentication_errorMissing, expired, or malformed Bearer tokenCreate or rotate the EvoLink key and confirm the header
402 insufficient_quotaThe account lacks creditsReview account credits before retrying
404 or model not foundRoute is not enabled, the ID changed, or the endpoint is wrongCopy the exact model ID from EvoLink and verify the protocol path
429 rate_limit_errorRequest or token rate exceededRetry with exponential backoff and jitter; lower concurrency
500 or transient gateway errorUpstream or gateway failureRetry a bounded number of times, then use a configured fallback
Empty final text while thinking is enabledThe client reads only one response fieldInspect 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

  1. Copy the exact EvoLink model ID into EVOLINK_QWEN_MODEL.
  2. Run one short non-streaming text request and save the resolved model plus usage.
  3. Test streaming, tools, thinking, caching, and multimodal input separately.
  4. Replay 20–50 representative tasks against the current production baseline.
  5. Measure first-pass success, accepted-result latency, retries, output tokens, and human correction time.
  6. Start with shadow traffic, then a small canary for one workload.
  7. Keep a verified fallback behind the same EvoLink gateway.
  8. Roll back when error rate, latency, cost per accepted result, or task quality crosses its guardrail.
The Qwen3.8 benchmark guide provides an evidence framework, while Qwen3.8 vs Qwen3.7 Max covers the migration decision. For a live comparison target, see Qwen3.8 vs Kimi K3.

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.

CapabilityRoute statusEvidence to record in your account
Chat CompletionsAvailable; validateRequest ID, resolved model, HTTP status, finish reason, usage
ResponsesAvailable; validateResponse ID, output type, usage, second-turn result
MessagesAvailable; validateMessage ID, content-block parse, stop reason, usage
StreamingAvailable; validateFirst-event latency, final event, disconnect behavior
ThinkingAvailable; validateReasoning field/block, final content, token accounting
Function toolsAvailable; validateValid tool name/arguments, tool-result continuation
CacheAvailable; validateCache creation/read fields and repeated-prefix cost
Multimodal inputValidate on the target endpointSupported 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.

Your next decision

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.

  1. 01

    Released?

    Yes. Qwen3.8 Max is the production model; Preview remains historical channel context.

  2. 02

    Available?

    Yes on EvoLink. Confirm the live route and model ID on the product page.

  3. 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.

  4. 04

    How much?

    Use the live pricing module on the product page. Do not reuse upstream or Preview-plan pricing.

  5. 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

Yes. Use 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?

Use the exact ID shown by EvoLink at activation. Qwen's upstream production ID is 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?

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?

Use EvoLink's /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.

Sources

Ready to Reduce Your AI Costs by 89%?

Start using EvoLink today and experience the power of intelligent API routing.