fujc683/qwen4-max-api
حول
Qwen4 Max API: chat completions, streaming defaults and reasoning tokens.
الذكاء الاصطناعي وتعلّم الآلةالنمو المقاس للنجوم
- خلال 24 ساعة
- ٠
- خلال 7 أيام
- ٠
- خلال 15 يومًا
- جارٍ جمع السجل
- خلال شهر
- جارٍ جمع السجل
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصلQwen4 Max API — endpoint, streaming, reasoning tokens
How to call Qwen4 Max on APIMart: chat completions, streaming defaults and reasoning output.
https://gola.apimart.ai/k-SBK4VP
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
- All prompt collections: fujc683 repositories
License
CC BY 4.0
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…