Interfaze

logo

Beta

pricing

docs

blog

sign in

Get Started

Introduction

Examples

Vision

Concepts

Resources

Projects

Integrations

Reasoning

copy markdown

Reasoning allows the model to think deeply using more compute and thinking tokens to solve more complex problems like in math, science, etc.

Reasoning is turned off by default as most use cases don't require it for deterministic responses like OCR, Translation, etc. but can be turned on by setting the reasoning_effort to high.

How to use reasoning

OpenAI SDK

Vercel AI SDK

LangChain SDK

const response = await interfaze.chat.completions.create({
  model: "interfaze-beta",
  messages: [
    {
      role: "user",
      content: "Explain why renewable energy is important for combating climate change. Consider economic, environmental, and social factors."
    }
  ],
  reasoning_effort: "high",
});

console.log(response?.reasoning);
console.log(response.choices[0].message.content);

Reasoning in streaming mode

When using streaming mode with reasoning enabled, the reasoning process is delivered as it happens, wrapped between <think> and </think> tags.

OpenAI SDK

Vercel AI SDK

LangChain SDK

const stream = await interfaze.chat.completions.create({
  model: "interfaze-beta",
  messages: [
    {
      role: "user",
      content: "Explain why renewable energy is important for combating climate change. Consider economic, environmental, and social factors."
    }
  ],
  reasoning_effort: "high",
  stream: true,
});

for await (const chunk of stream) {
  const content = chunk.choices[0]?.delta?.content;
  if (content) {
    process.stdout.write(content);
  }
}

The reasoning chunks stream chunk by chunk, allowing you to display the thought process in real-time before the final answer arrives.

<think>
Reasoning chunk 1...
Reasoning chunk 2...
Reasoning chunk 3...
</think>

Final answer begins here...