Large Language Models

MiniMax Web Search with ddgr

Published 2026-02-12.
Time to read: 1 minutes.

This page is part of the llm collection.

This article describes how to set up web search for Claude Code when using MiniMax M2 as the backend model. This works when using Mini-Agent or Claude Code CLI with MiniMax M2.

The Problem

Claude Code CLI has a built-in WebSearch tool that uses Anthropic's backend services. When using MiniMax via the Anthropic-compatible API shim (https://api.minimax.io/anthropic), the web search capability does not work because MiniMax's API does not expose this functionality.

Attempting to use WebSearch with MiniMax results in:

API Error: 400 {"type":"error","error":{"type":"invalid_request_error",
"message":"invalid params, function name or parameters is empty"}}

The Solution

Use ddgr (DuckDuckGo Results in JSON) - a command-line interface to DuckDuckGo. It provides JSON output without requiring an API key, and it does not use web scraping.

Installation

Install ddgr using uv:

Shell
$ uv pip install ddgr

Now add the following to ~/.claude/CLAUDE.md:

~/.claude/CLAUDE.md
# Web Search with MiniMax
- When using MiniMax as the AI backend, the built-in `WebSearch` tool does NOT work
- Use `ddgr --json "query"` via Bash instead: `ddgr --json "search query"`
- Do NOT use the WebSearch tool with MiniMax - it will fail with an API error

Usage

Usage is transparent.

Advantages

  • No API key required - DuckDuckGo provides free JSON API
  • No script required
  • No web scraping - Uses official DuckDuckGo instant answer API
  • No Python dependency - Pure bash wrapper around ddgr
  • Works with MiniMax - Bypasses the broken Anthropic API shim
  • Simple - No MCP server to maintain
* indicates a required field.

Please select the following to receive Mike Slinn’s newsletter:

You can unsubscribe at any time by clicking the link in the footer of emails.

Mike Slinn uses Mailchimp as his marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp’s privacy practices.