Skip to content

feat: Add MiniMax API support for Reddit search#129

Open
wjrzm wants to merge 3 commits intomvanhorn:mainfrom
wjrzm:main
Open

feat: Add MiniMax API support for Reddit search#129
wjrzm wants to merge 3 commits intomvanhorn:mainfrom
wjrzm:main

Conversation

@wjrzm
Copy link
Copy Markdown

@wjrzm wjrzm commented Mar 30, 2026

Summary

This PR adds support for using MiniMax API as a Reddit search backend, enabling users who already have a MiniMax API key to use the skill without needing a separate OpenAI API key.

Changes

1. Config support (scripts/lib/env.py)

  • Add MINIMAX_API_KEY, MINIMAX_API_BASE, MINIMAX_MODEL_POLICY, MINIMAX_MODEL_PIN to the config keys
  • Update is_reddit_available() and get_reddit_source() to recognize MiniMax as a valid Reddit backend

2. Model selection (scripts/lib/models.py)

  • Add select_minimax_model() function with OpenAI-compatible model auto-selection
  • Update get_models() to return minimax model when configured

3. New MiniMax Reddit module (scripts/lib/minimax_reddit.py)

  • Uses MiniMax Chat Completions API (OpenAI-compatible endpoint: https://api.minimax.chat/v1/chat/completions)
  • Falls back to free public Reddit JSON endpoint if MiniMax API call fails
  • Model: MiniMax-M2.7 (verified working via API test)

4. Routing logic (scripts/last30days.py)

  • Add MiniMax as Tier 2 in Reddit search hierarchy: ScrapeCreators > MiniMax > Public JSON > OpenAI Responses API

5. SKILL.md

  • Add MINIMAX_API_KEY and MINIMAX_API_BASE to optionalEnv

Usage

Users can now add their MiniMax API key to ~/.config/last30days/.env:

MINIMAX_API_KEY=your_minimax_api_key
MINIMAX_API_BASE=https://api.minimax.chat/v1  # optional, this is the default

The skill will automatically use MiniMax for Reddit search when OpenAI and ScrapeCreators keys are not available.

⚠️ Important Note

MiniMax-M2.7 is a general-purpose chat model and does not have real-time web browsing capability. When used as a Reddit backend, it will answer honestly that it cannot search the internet. The implementation includes automatic fallback to the free public Reddit JSON endpoint when this occurs, so users always get results.

For production-quality Reddit research with real web search, consider using:

  • ScrapeCreators API (recommended): SCRAPECREATORS_API_KEY — has real Reddit/TikTok/Instagram access
  • OpenAI Responses API (legacy): OPENAI_API_KEY — has built-in web search tool with domain filtering

This PR provides MiniMax as a free alternative for users who already have MiniMax API credits.

Testing

  • ✅ MiniMax API key authentication verified (MiniMax-M2.7 model)
  • ✅ MiniMax path correctly selected when MINIMAX_API_KEY is set
  • ✅ Falls back to public Reddit JSON on API errors
  • ✅ All imports and type hints work correctly on Python 3.8+
  • ✅ Routing logic verified via --diagnose flag

Fixes: #128

wjrzm added 3 commits March 30, 2026 11:45
- Add MINIMAX_API_KEY, MINIMAX_API_BASE, MINIMAX_MODEL_POLICY, MINIMAX_MODEL_PIN to config
- Add select_minimax_model() in models.py with OpenAI-compatible endpoint
- Add MiniMax as Reddit search backend priority: ScrapeCreators > MiniMax > OpenAI > Public JSON
- Create scripts/lib/minimax_reddit.py using MiniMax Chat Completions API
  (falls back to public Reddit JSON if API fails)
- Add MiniMax env vars to SKILL.md optionalEnv
- Add from __future__ import annotations to env.py and ui.py for Python 3.8 compatibility
…a search

When a search topic contains home decor, interior design, fashion, or related keywords, Exa search automatically appends 'site:pinterest.com' to the query. Pinterest is well-indexed by Exa and returns high-quality visual content for these topics.

Topics that trigger Pinterest filter:
- home decor, interior design, room decor, house decor
- fashion, outfit, clothing, style, accessories
- diy, craft, art, and more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant