Skip to main content

Overview

The Models API provides endpoints to query available AI models configured in DeerFlow. Models are configured in the application’s configuration file and include metadata about their capabilities.

List All Models

GET /api/models

Retrieve a list of all available AI models configured in the system

Response

models
array
List of all configured models with their metadata

Example Request

curl http://localhost:8001/api/models

Example Response

{
  "models": [
    {
      "name": "gpt-4",
      "display_name": "GPT-4",
      "description": "OpenAI GPT-4 model",
      "supports_thinking": false,
      "supports_reasoning_effort": false
    },
    {
      "name": "claude-3-opus",
      "display_name": "Claude 3 Opus",
      "description": "Anthropic Claude 3 Opus model",
      "supports_thinking": true,
      "supports_reasoning_effort": false
    },
    {
      "name": "o1",
      "display_name": "OpenAI o1",
      "description": "OpenAI o1 reasoning model",
      "supports_thinking": false,
      "supports_reasoning_effort": true
    }
  ]
}

Get Model Details

GET /api/models/{model_name}

Retrieve detailed information about a specific AI model by its name

Path Parameters

model_name
string
required
The unique name of the model to retrieve (e.g., gpt-4, claude-3-opus)

Response

name
string
required
Unique identifier for the model
display_name
string
Human-readable name
description
string
Model description
supports_thinking
boolean
default:"false"
Whether model supports thinking mode
supports_reasoning_effort
boolean
default:"false"
Whether model supports reasoning effort

Example Request

curl http://localhost:8001/api/models/gpt-4

Example Response

{
  "name": "gpt-4",
  "display_name": "GPT-4",
  "description": "OpenAI GPT-4 model",
  "supports_thinking": false,
  "supports_reasoning_effort": false
}

Error Responses

404
Not Found
Model not found
{
  "detail": "Model 'invalid-model' not found"
}

Model Capabilities

Thinking Mode

Models with supports_thinking: true can use extended thinking/reasoning capabilities. This is typically available in Claude models.

Reasoning Effort

Models with supports_reasoning_effort: true support configurable reasoning effort levels (e.g., OpenAI’s o1 series). This allows you to control how much computational effort the model applies to reasoning.

Use Cases

Frontend Model Selection

Use the /api/models endpoint to populate model selection dropdowns:
const response = await fetch('http://localhost:8001/api/models');
const { models } = await response.json();

// Filter models with specific capabilities
const thinkingModels = models.filter(m => m.supports_thinking);
const reasoningModels = models.filter(m => m.supports_reasoning_effort);

Capability Detection

Check if a specific model supports certain features:
const response = await fetch(`http://localhost:8001/api/models/${modelName}`);
const model = await response.json();

if (model.supports_thinking) {
  // Show thinking mode toggle
}

Gateway Overview

Learn about the Gateway API

Configuration

Configure AI models

Build docs developers (and LLMs) love