> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Reasoning Models

> Deep dive into advanced reasoning models

## Overview

Reasoning models use explicit step-by-step thinking to solve complex problems. Unlike standard models that generate immediate responses, reasoning models "think" through problems methodically, making them ideal for analytical tasks.

## What Are Reasoning Models?

Reasoning models employ a different approach:

1. **Explicit Thinking** - Show their thought process
2. **Multi-Step Analysis** - Break problems into steps
3. **Self-Correction** - Refine answers progressively
4. **Higher Token Usage** - Require more tokens (2000+ minimum)
5. **Slower Response** - Take longer but more accurate

> [!NOTE]
>
> Think of reasoning models as "showing their work" like in math class - they explain how they reached the answer, not just what the answer is.

## Available Reasoning Models

A reasoning model spends tokens thinking before it answers, so it needs a higher `max_reply_tokens`
than a standard model — each one below declares its own minimum. Credits are charged per step.

### OpenAI

> [card] GPT-6 Astra
>
> **39 credits** • OpenAI's most capable model, with state-of-the-art coding, computer use and reasoning.
>
> * 1.05M context window
> * Needs at least 3000 completion tokens
> * Speed: Medium • Cost: High
> * Vision: images supported
> * Model id: `gpt-6-astra`

> [card] GPT-6.1 Sol
>
> **8 credits** • Near-Astra performance for complex work at a lower cost.
>
> * 1.05M context window
> * Needs at least 3000 completion tokens
> * Speed: Medium • Cost: Medium
> * Vision: images supported
> * Model id: `gpt-6.1-sol`

> [card] GPT-6 Sol
>
> **8 credits** • GPT-6 reasoning at half the cost of GPT-5.6 Sol, for coding and complex professional work.
>
> * 1.05M context window
> * Needs at least 3000 completion tokens
> * Speed: Medium • Cost: Medium
> * Vision: images supported
> * Model id: `gpt-6-sol`

> [card] GPT-6 Luna
>
> **1 credit** • The fastest, most affordable GPT-6 model, for high-volume tasks with a clear goal.
>
> * 1.05M context window
> * Needs at least 2000 completion tokens
> * Speed: Fast • Cost: Low
> * Vision: images supported
> * Model id: `gpt-6-luna`

> [card] GPT-5.6 Sol
>
> **16 credits** • Previous-generation frontier model, built for complex professional work requiring deep reasoning.
>
> * 1.05M context window
> * Needs at least 3000 completion tokens
> * Speed: Medium • Cost: High
> * Vision: images supported
> * Model id: `gpt-5.6-sol`

> [card] GPT-5.6 Terra
>
> **8 credits** • Previous-generation balanced tier offering strong reasoning and multimodal input at moderate cost.
>
> * 1.05M context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: Medium
> * Vision: images supported
> * Model id: `gpt-5.6-terra`

> [card] GPT-5.6 Luna
>
> **1 credit** • Previous-generation cost-efficient tier, designed for high-volume, cost-sensitive workloads.
>
> * 1.05M context window
> * Needs at least 2000 completion tokens
> * Speed: Fast • Cost: Low
> * Vision: images supported
> * Model id: `gpt-5.6-luna`

> [card] GPT-5.5
>
> **20 credits** • Previous-generation frontier GPT model with strong reasoning and a 1M+ context window.
>
> * 1.05M context window
> * Needs at least 3000 completion tokens
> * Speed: Medium • Cost: High
> * Vision: images supported
> * Model id: `gpt-5.5`

> [card] GPT-5.4
>
> **10 credits** • Previous-generation flagship GPT model with strong reasoning, creativity, and contextual understanding.
>
> * 1M context window
> * Needs at least 3000 completion tokens
> * Speed: Medium • Cost: High
> * Vision: images supported
> * Model id: `gpt-5.4`

> [card] GPT-5.2
>
> **8 credits** • The model for coding and agentic tasks across industries.
>
> * 400K context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: High
> * Vision: images supported
> * Model id: `gpt-5.2`

> [card] GPT-5
>
> **6 credits** • The flagship GPT-5 model offering state-of-the-art performance in reasoning, creativity, and contextual understanding for the most demanding applications.
>
> * 200K context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: High
> * Vision: images supported
> * Model id: `gpt-5`

> [card] GPT-5.4 Mini
>
> **3 credits** • The mid-size GPT-5.4 tier: strong reasoning with a 400K context at a fraction of the flagship cost.
>
> * 400K context window
> * Needs at least 2000 completion tokens
> * Speed: Fast • Cost: Medium
> * Vision: images supported
> * Model id: `gpt-5.4-mini`

> [card] GPT-5 Mini
>
> **2 credits** • A faster and more affordable GPT-5 variant optimized for everyday use while maintaining strong reasoning and contextual understanding.
>
> * 200K context window
> * Needs at least 2000 completion tokens
> * Speed: Fast • Cost: Medium
> * Vision: images supported
> * Model id: `gpt-5-mini`

> [card] GPT-5 Nano
>
> **1 credit** • Ultra-lightweight GPT-5 optimized for speed and scale. Perfect for simple tasks, prototyping, and high-volume applications.
>
> * 128K context window
> * Needs at least 2000 completion tokens
> * Speed: Very\_fast • Cost: Low
> * Vision: images supported
> * Model id: `gpt-5-nano`

### Google

> [card] Gemini 3.7 Flash
>
> **3 credits** • The newest Gemini Flash model, with a 1M-token context window and native multimodal input.
>
> * 1.05M context window
> * Needs at least 2000 completion tokens
> * Speed: Fast • Cost: Medium
> * Vision: images supported
> * Model id: `gemini-3.7-flash`

> [card] Gemini 3.6 Flash
>
> **3 credits** • Balances speed with intelligence for strong performance on agentic and multimodal tasks.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Fast • Cost: Medium
> * Vision: images supported
> * Model id: `gemini-3.6-flash`

> [card] Gemini 3.5 Flash
>
> **6 credits** • Most intelligent Gemini model for sustained frontier performance on agentic and coding tasks.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Fast • Cost: Medium
> * Vision: images supported
> * Model id: `gemini-3.5-flash`

> [card] Gemini 3.5 Flash Lite
>
> **2 credits** • The fastest, most cost-effective Gemini 3.5 model for high-throughput execution.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Very\_fast • Cost: Very\_low
> * Vision: images supported
> * Model id: `gemini-3.5-flash-lite`

> [card] Gemini 3.1 Pro
>
> **8 credits** • Reasoning-first Gemini model for complex agentic workflows and coding, with adaptive thinking.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: High
> * Vision: images supported
> * Model id: `gemini-3.1-pro-preview`

> [card] Gemini 2.5 Flash
>
> **2 credits** • A fast and capable model in the Gemini 2.5 series, balancing speed and reasoning performance for production use.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Fast • Cost: Medium
> * Vision: images supported
> * Model id: `gemini-2.5-flash`

> [card] Gemini 2.5 Flash Lite
>
> **1 credit** • A lightweight, cost-efficient variant of Gemini 2.5 Flash, optimized for low latency and basic tasks.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Very\_fast • Cost: Very\_low
> * Vision: images supported
> * Model id: `gemini-2.5-flash-lite`

### Anthropic

> [card] Claude Fable 5.1
>
> **35 credits** • Anthropic's most capable model, with cheaper cache reads than Fable 5 for long agentic work.
>
> * 1M context window
> * Needs at least 3000 completion tokens
> * Speed: Slow • Cost: High
> * Vision: images supported
> * Model id: `claude-fable-5-1`

> [card] Claude Opus 5.5
>
> **15 credits** • Anthropic's recommended model for most work: long-running agentic coding and knowledge work, near Fable 5.1 at a lower cost.
>
> * 1M context window
> * Needs at least 3000 completion tokens
> * Speed: Medium • Cost: High
> * Vision: images supported
> * Model id: `claude-opus-5-5`

> [card] Claude Fable 5
>
> **39 credits** • Anthropic's most capable model, for the most demanding reasoning and long-running agentic work.
>
> * 1M context window
> * Needs at least 3000 completion tokens
> * Speed: Slow • Cost: High
> * Vision: images supported
> * Model id: `claude-fable-5`

> [card] Claude Opus 5
>
> **20 credits** • Previous-generation Opus model for complex agentic coding and enterprise work, with a 1M-token context window.
>
> * 1M context window
> * Needs at least 3000 completion tokens
> * Speed: Medium • Cost: High
> * Vision: images supported
> * Model id: `claude-opus-5`

> [card] Claude Opus 4.8
>
> **20 credits** • The most capable Claude model, built for complex agentic coding and enterprise work.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: High
> * Vision: images supported
> * Model id: `claude-opus-4-8`

> [card] Claude Sonnet 5.5
>
> **8 credits** • The best combination of speed and intelligence in the current Claude lineup.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Fast • Cost: Medium
> * Vision: images supported
> * Model id: `claude-sonnet-5-5`

> [card] Claude Sonnet 5
>
> **8 credits** • The best combination of speed and intelligence, with near-Opus quality on coding and agentic work.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Fast • Cost: Medium
> * Vision: images supported
> * Model id: `claude-sonnet-5`

> [card] Claude Opus 4.7
>
> **20 credits** • Highly autonomous Claude Opus model, strong on long-horizon agentic work, vision, and memory.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: High
> * Vision: images supported
> * Model id: `claude-opus-4-7`

> [card] Claude Opus 4.6
>
> **20 credits** • Claude Opus model with superior reasoning, creativity, tool use, and contextual understanding.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: High
> * Vision: images supported
> * Model id: `claude-opus-4-6`

> [card] Claude Sonnet 4.6
>
> **12 credits** • Fast Claude Sonnet model with strong reasoning, creativity, tool use, and contextual understanding.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Fast • Cost: Medium
> * Vision: images supported
> * Model id: `claude-sonnet-4-6`

### xAI

> [card] Grok 4.7
>
> **9 credits** • xAI's most capable model for coding and knowledge work, with a 500K context window.
>
> * 500K context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: Medium
> * Vision: images supported
> * Model id: `grok-4.7`

> [card] Grok 4.6
>
> **9 credits** • Previous-generation Grok model, with a 500K context window and strong multimodal reasoning.
>
> * 500K context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: Medium
> * Vision: images supported
> * Model id: `grok-4.6`

> [card] Grok 4.5
>
> **8 credits** • The flagship Grok model, with native video input and strong multimodal reasoning.
>
> * 500K context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: Medium
> * Vision: images supported
> * Model id: `grok-4.5`

> [card] Grok 4.3
>
> **5 credits** • A versatile 1M-context model offering strong language and reasoning capabilities at low cost.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: Low
> * Vision: images supported
> * Model id: `grok-4.3`

> [card] Grok 4.20 Reasoning
>
> **5 credits** • Grok 4.20 in reasoning mode, with enhanced analytical and problem-solving capabilities.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: Low
> * Vision: images supported
> * Model id: `grok-4.20-0309-reasoning`

### Zhipu AI

> [card] GLM-5.3
>
> **6 credits** • Zhipu's flagship for complex software engineering and long-horizon agent work, with a 1M-token context window.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: Low
> * Model id: `glm-5.3`

> [card] GLM-5.3 Flash
>
> **1 credit** • The fast, low-cost GLM-5.3 tier, keeping the 1M-token context window.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Fast • Cost: Low
> * Model id: `glm-5.3-flash`

> [card] GLM-5.2
>
> **6 credits** • The previous GLM flagship, with a 1M-token context window and strong long-horizon performance.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: Low
> * Model id: `glm-5.2`

> [card] GLM-4.7
>
> **3 credits** • Newer GLM-4 generation model with adaptive reasoning for complex agentic and coding tasks.
>
> * 200K context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: Low
> * Model id: `glm-4.7`

> [card] GLM-5.1
>
> **6 credits** • Zhipu's frontier GLM-5 model, a large MoE for the most demanding reasoning and agentic work.
>
> * 200K context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: Low
> * Model id: `glm-5.1`

### MiniMax

> [card] MiniMax M2.7 Highspeed
>
> **3 credits** • The accelerated M2.7 tier — roughly 100 tokens/sec against the standard 60.
>
> * 205K context window
> * Needs at least 2000 completion tokens
> * Speed: Very fast • Cost: Low
> * Model id: `MiniMax-M2.7-highspeed`

> [card] MiniMax M2.5 Highspeed
>
> **3 credits** • The accelerated M2.5 tier — roughly 100 tokens/sec against the standard 60.
>
> * 205K context window
> * Needs at least 2000 completion tokens
> * Speed: Very fast • Cost: Low
> * Model id: `MiniMax-M2.5-highspeed`

> [card] MiniMax M3
>
> **2 credits** • MiniMax's flagship model with a 1M-token context window and native multimodal (image) input.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: Low
> * Vision: images supported
> * Model id: `MiniMax-M3`

> [card] MiniMax M2.7
>
> **2 credits** • Agentic MiniMax M2 model tuned for coding and reasoning, with a 205K context window.
>
> * 205K context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: Low
> * Model id: `MiniMax-M2.7`

> [card] MiniMax M2.5
>
> **2 credits** • Cost-efficient MiniMax M2 tier for general-purpose tasks, with a 205K context window.
>
> * 205K context window
> * Needs at least 2000 completion tokens
> * Speed: Fast • Cost: Very\_low
> * Model id: `MiniMax-M2.5`

### DeepSeek

> [card] DeepSeek V4 Flash
>
> **2 credits** • Fast, low-cost general-purpose model with a 1M context window. Good for everyday conversations and high-volume tasks.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Fast • Cost: Low
> * Model id: `deepseek-v4-flash`

> [card] DeepSeek V4 Flash Vision
>
> **2 credits** • Experimental vision variant of V4 Flash. Same 1M context and pricing; images are billed as input tokens.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Fast • Cost: Low
> * Vision: images supported
> * Model id: `deepseek-v4-flash-vision-exp`

> [card] DeepSeek V4 Pro
>
> **5 credits** • Higher-performance tier for complex reasoning, with enhanced logical and analytical capabilities.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: Low
> * Model id: `deepseek-v4-pro`

### Moonshot AI

> [card] Kimi K3
>
> **12 credits** • Moonshot AI's flagship multimodal reasoning model with a one-million-token context window.
>
> * 1M context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: High
> * Vision: images supported
> * Model id: `kimi-k3`

> [card] Kimi K2.7 Code
>
> **5 credits** • A reasoning-first Kimi model optimized for agentic software engineering and complex coding work.
>
> * 256K context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: Medium
> * Model id: `kimi-k2.7-code`

> [card] Kimi K2.7 Code Highspeed
>
> **9 credits** • The high-throughput Kimi K2.7 Code variant for latency-sensitive coding and agent workflows.
>
> * 256K context window
> * Needs at least 2000 completion tokens
> * Speed: Fast • Cost: High
> * Model id: `kimi-k2.7-code-highspeed`

> [card] Kimi K2.6
>
> **4 credits** • A multimodal Kimi model for general reasoning, tool use, and long-context tasks.
>
> * 256K context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: Medium
> * Vision: images supported
> * Model id: `kimi-k2.6`

### Fireworks AI

> [card] DeepSeek R1
>
> **25 credits** • Specialized reasoning model. Enhanced analytical capabilities.
>
> * 64K context window
> * Needs at least 2000 completion tokens
> * Speed: Medium • Cost: Low
> * Model id: `deepseek-r1`

## Reasoning Model Comparison

| Model | Credits | Context | Speed | Reasoning Depth | Best For |
| - | - | - | - | - | - |
| **Claude Fable 5.1** | 35 | 1M | Slow | ⭐⭐⭐⭐⭐ | Long-horizon agentic work |
| **GPT-6 Astra** | 39 | 1.05M | Medium | ⭐⭐⭐⭐⭐ | Hardest problems |
| **Claude Opus 5.5** | 15 | 1M | Medium | ⭐⭐⭐⭐⭐ | Long-running coding |
| **GPT-6.1 Sol** | 8 | 1.05M | Medium | ⭐⭐⭐⭐ | Complex work at lower cost |
| **Claude Sonnet 5.5** | 8 | 1M | Fast | ⭐⭐⭐⭐ | Speed + intelligence |
| **DeepSeek V4 Pro** | 5 | 1M | Medium | ⭐⭐⭐⭐ | Budget reasoning |
| **Gemini 3.8 Flash** | 3 | 1.05M | Fast | ⭐⭐⭐⭐ | Large context reasoning |
| **GPT-6 Luna** | 1 | 1.05M | Fast | ⭐⭐⭐ | High-volume reasoning |

## When to Use Reasoning Models

### Perfect For

> [accordion] Mathematical Problems
>
> Solving complex math, physics, or engineering problems that require step-by-step work.
>
> ```javascript theme={null}
> const response = await client.chat({
>   bot_id: 'math-bot',
>   model: 'gpt-5.4-mini',
>   message: 'Solve: If f(x) = x^2 + 3x - 4, find where f(x) = 0',
>   max_reply_tokens: 2000
> });
> ```

> [accordion] Code Debugging
>
> Analyzing code to find bugs, understand logic, and suggest improvements.
>
> ```javascript theme={null}
> const response = await client.chat({
>   bot_id: 'debug-bot',
>   message: `Debug this function:\n\n${codeSnippet}`,
>   reasoning_mode: 'agent', // Autonomous multi-step analysis
>   max_reply_tokens: 2500
> });
> ```

> [accordion] Strategic Planning
>
> Business analysis, market research, competitive analysis.
>
> Best models: Claude Opus 5.5, GPT-6.1 Sol

> [accordion] Scientific Analysis
>
> Research paper analysis, experimental design, data interpretation.
>
> Best models: GPT-6 Astra, Gemini 3.8 Flash

> [accordion] Logic Puzzles
>
> Solving riddles, logic games, complex reasoning challenges.
>
> Best models: GPT-6 Luna, DeepSeek V4 Pro (budget option)

### Not Ideal For

> [!WARNING]
>
> Reasoning models are overkill for these tasks. Use standard models instead:

* Simple conversations
* Quick factual questions
* Creative writing (use GPT-5 or Claude Opus instead)
* High-volume simple queries (too slow and expensive)
* Real-time chat applications (too slow)

## Usage Examples

### GPT-5.4 - Deep Analysis

```javascript theme={null}
import { BoostGPT } from 'boostgpt';

const client = new BoostGPT({
  project_id: process.env.BOOSTGPT_PROJECT_ID,
  key: process.env.BOOSTGPT_API_KEY
});

// Create bot with a reasoning model
const botResponse = await client.createBot({
  name: 'Deep Thinker',
  model: 'gpt-5.4',
  instruction: 'You are a logical analyst.',
  max_reply_tokens: 3000, // reasoning models need room to think
  status: 'active'
});

// Use for complex analysis
const analysisResponse = await client.chat({
  bot_id: botResponse.response.id,
  message: 'Analyze the pros and cons of different database architectures for a high-traffic social media platform',
  max_reply_tokens: 3000
});

if (analysisResponse.err) {
  console.error('Error:', analysisResponse.err);
} else {
  console.log('Analysis:', analysisResponse.response.chat.reply);
}
```

### DeepSeek V4 Pro - Budget Reasoning

```javascript theme={null}
// Most affordable reasoning model
const budgetBot = await client.createBot({
  name: 'Budget Reasoner',
  model: 'deepseek-v4-pro',
  instruction: 'You solve problems step-by-step.',
  max_reply_tokens: 2000,
  status: 'active'
});

const response = await client.chat({
  bot_id: budgetBot.response.id,
  message: 'Debug this Python function and explain the issue',
  max_reply_tokens: 2000
});
```

### Gemini 3.5 Flash Lite - Large Context

```javascript theme={null}
// Use Gemini for reasoning with large context
const geminiBot = await client.createBot({
  name: 'Context Reasoner',
  model: 'gemini-3.5-flash-lite',
  instruction: 'Analyze documents thoroughly.',
  max_reply_tokens: 2000,
  status: 'active'
});

// Can handle large documents with reasoning
const docAnalysis = await client.chat({
  bot_id: geminiBot.response.id,
  message: `Analyze this entire document:\n\n${largeDocument}`,
  max_reply_tokens: 2000
});
```

### Override Reasoning Mode

All reasoning models support these modes:

| Mode | Description | Credit Multiplier |
| - | - | - |
| `auto` | Automatically selects best approach | Varies |
| `standard` | Quick, straightforward answers | 1x |
| `agent` | Autonomous multi-step reasoning with tool use | Up to 10x |

```javascript theme={null}
// Use reasoning model with different modes
const reasoningBot = await client.createBot({
  name: 'Deep Thinker',
  model: 'gpt-5.4',
  instruction: 'You solve complex problems.',
  max_reply_tokens: 3000,
  status: 'active'
});

// Override reasoning mode per request
const quickAnswer = await client.chat({
  bot_id: reasoningBot.response.id,
  message: 'What is 2+2?',
  reasoning_mode: 'standard' // Quick mode (1x credit)
});

const agentMode = await client.chat({
  bot_id: reasoningBot.response.id,
  message: 'Research current market trends and develop a strategy',
  reasoning_mode: 'agent' // Autonomous multi-step with tools (up to 10x credit)
});
```

## Best Practices

### Set Appropriate Token Limits

```javascript theme={null}
// Reasoning models need higher limits
const config = {
  'o1': { min: 3000, recommended: 4000 },
  'gpt-5.6-luna': { min: 2000, recommended: 3000 },
  'deepseek-v4-pro': { min: 2000, recommended: 2500 },
  'gemini-3.5-flash-lite': { min: 2000, recommended: 3000 },
  'claude-3-opus-extended-thinking': { min: 2500, recommended: 3000 }
};
```

### Handle Longer Wait Times

```javascript theme={null}
// Add loading indicators for reasoning models
router.onMessage(async (message, context) => {
  if (message.content.includes('analyze')) {
    // Send initial message
    await context.adapter.sendMessage(
      message.userId,
      'Thinking deeply about this... ⏳'
    );

    // Return null - let router handle with reasoning bot
    return null;
  }

  return null;
});
```

### Cost Optimization

```javascript theme={null}
// Use cheaper models for simple tasks, reasoning for complex
const isComplexQuery = (message) => {
  const keywords = ['analyze', 'debug', 'solve', 'explain why', 'compare'];
  return keywords.some(kw => message.toLowerCase().includes(kw));
};

// Choose bot based on complexity
const botId = isComplexQuery(userMessage) 
  ? reasoningBotId  // 3-6 credits
  : standardBotId;  // 1-2 credits

const response = await client.chat({
  bot_id: botId,
  message: userMessage
});
```

### Cache Common Analyses

```javascript theme={null}
// Cache reasoning results for common queries
const cache = new Map();

const getAnalysis = async (query) => {
  if (cache.has(query)) {
    return cache.get(query);
  }

  const response = await client.chat({
    bot_id: reasoningBotId,
    message: query,
    max_reply_tokens: 2000
  });

  const result = response.response.chat.reply;
  cache.set(query, result);
  return result;
};
```

## Performance Comparison

### Speed vs Accuracy Tradeoff

| Model | Avg Response Time | Accuracy | Cost Efficiency |
| - | - | - | - |
| **O1 Mini** | 5-10s | ⭐⭐⭐⭐ | Medium (3 credits) |
| **DeepSeek R1** | 5-8s | ⭐⭐⭐ | High (2 credits) |
| **Gemini Flash Thinking** | 4-6s | ⭐⭐⭐⭐ | High (3 credits) |
| **Groq DeepSeek Llama** | 2-4s | ⭐⭐⭐ | Very High (2 credits) |

> [!TIP]
>
> **Best Value**: DeepSeek R1 (2 credits) or Gemini 2.0 Flash Thinking (3 credits) offer the best balance of cost and capability.

## Troubleshooting

> [accordion] Responses too slow
>
> **Expected:** Reasoning models take longer
>
> **Solutions:**
>
> * Use O1 Mini instead of O1
> * Use DeepSeek R1 for faster reasoning
> * Try Groq's reasoning models for ultra-fast
> * Add progress indicators for users

> [accordion] High costs
>
> **Cause:** Reasoning models use more tokens and credits
>
> **Solutions:**
>
> * Use only for complex tasks
> * Try DeepSeek R1 (2 credits)
> * Cache results for common queries
> * Use standard models for simple tasks

> [accordion] Not showing thinking process
>
> **Note:** Some models show thinking, others don't
>
> **Details:**
>
> * O1 series: Shows detailed thinking
> * DeepSeek R1: Shows reasoning steps
> * Claude Extended: Implicit thinking
> * Gemini Thinking: Shows analysis process

> [accordion] Token limit errors
>
> **Cause:** Insufficient max\_reply\_tokens
>
> **Solutions:**
>
> * Set minimum 2000 tokens
> * Use 3000+ for O1
> * Use 2500+ for Claude Extended
> * Check model-specific requirements

## Real-World Use Cases

### Code Review Assistant

```javascript theme={null}
// Automated code review with O1 Mini
const reviewCode = async (pullRequestDiff) => {
  const response = await client.chat({
    bot_id: 'code-reviewer-bot',
    message: `Review this code change:\n\n${pullRequestDiff}\n\nProvide:\n1. Bug detection\n2. Performance issues\n3. Best practice violations\n4. Security concerns`,
    max_reply_tokens: 3000
  });

  return response.response.chat.reply;
};
```

### Business Strategy Advisor

```javascript theme={null}
// Strategic planning with deep thinking
const strategize = async (businessData) => {
  const response = await client.chat({
    bot_id: 'strategy-bot',
    message: `Given this data:\n${businessData}\n\nDevelop a comprehensive strategy`,
    reasoning_mode: 'agent', // Autonomous multi-step with tools (up to 10x credit)
    max_reply_tokens: 3000
  });

  return response.response.chat.reply;
};
```

### Math Tutor

```javascript theme={null}
// Step-by-step math solutions with DeepSeek R1
const solveMath = async (problem) => {
  const response = await client.chat({
    bot_id: 'math-tutor-bot',
    message: `Solve this step-by-step:\n${problem}`,
    max_reply_tokens: 2000
  });

  return response.response.chat.reply;
};
```

## Next Steps

> [card] [Model Comparison](/docs/providers/model-comparison.md)
>
> Compare all models

> [card] [Provider Overview](/docs/providers/overview.md)
>
> See all providers

> [card] [OpenAI O-Series](/docs/providers/openai.md)
>
> Learn about O1 models

> [card] [DeepSeek R1](/docs/providers/deepseek.md)
>
> Budget reasoning option


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.