You send a short prompt with max_tokens: 100, the request succeeds, and choices[0].message.content is empty. Nothing is broken: the answer never started.
What happens
Reasoning models write a hidden chain of thought before the visible answer. Both share one max_tokens budget. With a small limit, the reasoning uses all of it, and in the standard chat-completions shape finish_reason is then length.
Three fixes
1. Leave room. Set max_tokens to 1,000 or more, as BroadNet’s docs advise. The max_tokens calculator for reasoning models sizes the limit for your answer length and shows the cost.
2. Reason less. Set reasoning_effort to low for simple tasks:
import os
from openai import OpenAI
client = OpenAI(base_url="https://inference.broadnet.ai/v1", api_key=os.environ["BROADNET_API_KEY"])
response = client.chat.completions.create(
model="broadnet/deepseek-v4.1-flash",
reasoning_effort="low",
max_tokens=1000,
messages=[{"role": "user", "content": "Classify: 'refund my order' -> intent?"}],
)
3. Watch the usage. When the model reports it, usage.completion_tokens_details.reasoning_tokens shows how much went to reasoning:
print(response.choices[0].finish_reason) # "length" means the budget ran out
details = response.usage.completion_tokens_details # None if the model doesn't report it
print(details.reasoning_tokens if details else "not reported")
In a stream, add stream_options={"include_usage": True} and the same usage arrives in the last chunk. See streaming chat completions.
Which models reason
| Model | Reasons first |
|---|---|
DeepSeek V4.1 Flash (broadnet/deepseek-v4.1-flash) |
Yes |
GLM 5.3 (broadnet/glm-5.3) |
Yes |
Qwen3.8 27B (broadnet/qwen3.8-27b) |
Yes |
BroadNet Gemma 4 VL 26B (broadnet/gemma-4-26b-a4b) |
Not listed |
Troubleshooting
- Empty
content,finish_reasonislength. Raisemax_tokensor setreasoning_efforttolow. - Empty
content,finish_reasonisstop. The limit was not the cause. Check your prompt and print the full response to see what came back. AttributeErroroncompletion_tokens_details. The model did not report the breakdown for that request; guard forNoneas in the example above.- A slow first token in a stream. The model is reasoning before it writes the answer. A lower
reasoning_effortcan shorten the wait.
If you run agents all day, reasoning tokens add up on pay-as-you-go. The BroadNet pricing calculator shows when a flat unlimited plan costs less.
