Guides

Reasoning content

deepseek-flash can think before it answers. Its reasoning is returned in reasoning_content and billed as output tokens.

On this page

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 typeField
Non-streamingchoices[0].message.reasoning_content
Streamingchoices[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)

Cost and limits

  • Reasoning is output. Reasoning tokens are included in usage.completion_tokens and 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 with finish_reason: "length", raise max_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.