Skip to content
Projets

À propos

Qwen4 Max API: chat completions, streaming defaults and reasoning tokens.

IA et apprentissage automatique

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
Historique en cours
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

Qwen4 Max API — endpoint, streaming, reasoning tokens

How to call Qwen4 Max on APIMart: chat completions, streaming defaults and reasoning output.

Awesome License: CC BY 4.0

👉 Use Qwen4 Max on APIMart

https://gola.apimart.ai/k-SBK4VP

💰 Pricing · 🔑 Get an API key


Endpoint

OpenAI-compatible chat completions:

curl -X POST https://api.apimart.ai/v1/chat/completions \
  -H "Authorization: Bearer $APIMART_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"qwen4-max","messages":[{"role":"user","content":"explain vector databases"}]}'

Streaming

The endpoint streams by default. Parse data: lines, or pass "stream": false for a single JSON body.

from openai import OpenAI
client = OpenAI(base_url="https://api.apimart.ai/v1", api_key=KEY)

for chunk in client.chat.completions.create(
        model="qwen4-max",
        messages=[{"role": "user", "content": "write a haiku"}],
        stream=True):
    print(chunk.choices[0].delta.content or "", end="")

Reasoning output

Qwen4 Max can emit a separate reasoning_content field alongside content. Treat it as chain-of-thought: useful for debugging, not for showing to end users.

{"delta": {"role": "assistant", "content": "", "reasoning_content": "..."}}

usage.completion_tokens_details.reasoning_tokens tells you how many tokens were spent thinking — that part is billed as output.

Parameters that matter

Field Notes
messages standard role/content array
stream true by default on this endpoint
max_tokens cap output; reasoning tokens count toward it
temperature 0-2; lower for extraction, higher for ideation
tools function calling, OpenAI schema

Pricing

Per 1M tokens
Input $1.4286
Output $4.2857

Gotchas

  • Streaming is on unless you pass stream: false
  • Reasoning tokens are billed as output — budget for 2-3x on hard tasks
  • Very long prompts benefit from prompt caching; cached tokens are cheaper

Related

License

CC BY 4.0

Explorer des projets similaires

Chargement…