Guides
Reasoning content
deepseek-flash can think before it answers. Its reasoning is returned in reasoning_content and billed as output tokens.
DeepSeek-V4.1-Flash uses a thinking mode by default: before writing the answer, it can produce a chain of reasoning. Laras Router passes that reasoning through to you in a separate field, so your users see a clean answer and you can still inspect or log how the model got there.
Where reasoning appears
| Response type | Field |
|---|---|
| Non-streaming | choices[0].message.reasoning_content |
| Streaming | choices[0].delta.reasoning_content, in chunks before delta.content |
The answer itself is always in content. reasoning_content is absent or null when the model produced no reasoning.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.larasrouter.com/v1",
api_key=os.environ["LARAS_API_KEY"],
)
response = client.chat.completions.create(
model="deepseek-flash",
messages=[{"role": "user", "content": "Is 1,001 a prime number?"}],
max_tokens=4096,
)
message = response.choices[0].message
# The OpenAI SDK keeps fields it does not know about, such as reasoning_content.
print("Reasoning:", getattr(message, "reasoning_content", None))
print("Answer:", message.content)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.larasrouter.com/v1",
apiKey: process.env.LARAS_API_KEY,
});
const response = await client.chat.completions.create({
model: "deepseek-flash",
messages: [{ role: "user", content: "Is 1,001 a prime number?" }],
max_tokens: 4096,
});
// reasoning_content is not in the SDK's types; read it from the raw message.
const message = response.choices[0].message as {
content: string | null;
reasoning_content?: string | null;
};
console.log("Reasoning:", message.reasoning_content);
console.log("Answer:", message.content);
Cost and limits
- Reasoning is output. Reasoning tokens are included in
usage.completion_tokensand billed at the output price, $1.600 per 1M tokens. - Reasoning counts toward
max_tokens. With the default cap of 8,192 tokens, a long chain of reasoning can leave little room for the answer. If responses stop withfinish_reason: "length", raisemax_tokens(up to 384,000). - Don't show it by default. Reasoning is useful for debugging and evaluation, but it can be long and is not written for end users.
In multi-turn conversations
Laras Router forwards your messages as you send them. For the next turn, append the assistant's answer from content; see DeepSeek's API documentation for how the model treats earlier reasoning in a conversation.