حالت reasoning
مدلهای پشتیبانیشده شدت تفکر را با reasoning_effort یا پارامتر مشابه تنظیم میکنند. سطحها برای هر مدل متفاوتاند و سطح بالاتر زمان و توکن بیشتری میخواهد.
- پشتیبانی و نام رسمی سطحها را در کاتالوگ ببینید.
- فرض نکنید همهٔ مدلها low، medium و high دارند.
- از کمترین سطح کافی شروع و usage، تأخیر و کیفیت را مقایسه کنید.
نمونههای کامل
همهٔ نمونههای قابل اجرای راهنمای اصلی در ادامه حفظ شدهاند. فقط بلوک متناسب با ابزار و سیستمعامل خود را اجرا کنید.
json
"usage": {
"prompt_tokens": 179,
"completion_tokens": 545, // total output — this is what's billed
"completion_tokens_details": {
"reasoning_tokens": 445 // of which, spent on reasoning
}
}bash
curl https://nordrouter.com/v1/chat/completions \
-H "Authorization: Bearer sk-nr-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5",
"max_tokens": 4000,
"reasoning": { "effort": "high" },
"messages": [{ "role": "user", "content": "A hard problem…" }]
}'مستندات رسمی و پیوندها
| Parameter | What it does |
|---|---|
reasoning.effort | Reasoning depth: "low" / "medium" / "high". Lower effort — fewer reasoning tokens, cheaper responses |
reasoning.max_tokens | Token budget for reasoning (Anthropic style). Must be lower than the request's max_tokens |
reasoning.enabled: false | Turn reasoning off (where the model supports it) |
reasoning.exclude: true | Hide the reasoning text from the response. Does not save money — the model still thinks and the tokens are billed |
| Model | Behavior |
|---|---|
anthropic/claude-sonnet-5 | Doesn't reason by default. effort and max_tokens enable thinking, enabled: false genuinely disables it |
anthropic/claude-fable-5 | Thinks adaptively — decides on its own how much. reasoning.* parameters are not supported (returns 400); control depth with output_config: { "effort": "low" | "medium" | "high" } |
openai/gpt-5.4, gpt-5.5 | Reason by default; reasoning_effort scales the depth |
x-ai/grok-4.3 | Reasons by default and generously (hundreds of tokens); effort: "low" cuts it down noticeably |
deepseek/deepseek-r1, z-ai/glm-5.x | Always think: "disabling" only hides the text, reasoning tokens are still billed |
راهنماهای مرتبط
ابتدا اتصال را با یک درخواست متنی کوچک بررسی کنید؛ سپس streaming، فراخوانی ابزار، تصویر و قابلیتهای پیشرفته را اضافه کنید. کلید API را در کد عمومی یا frontend مرورگر قرار ندهید.