@sinamtz/pi-minimax-provider

Pi coding agent provider for MiniMax AI - supports MiniMax M2 series models with Anthropic API compatibility

Package details

extension

Install @sinamtz/pi-minimax-provider from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@sinamtz/pi-minimax-provider
Package
@sinamtz/pi-minimax-provider
Version
1.0.14
Published
Apr 16, 2026
Downloads
1,230/mo · 95/wk
Author
sinamtz
License
MIT
Types
extension
Size
26.2 KB
Dependencies
0 dependencies · 0 peers
Pi manifest JSON
{
  "extensions": [
    "./dist/index.js"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

Pi Provider - MiniMax

npm version License: MIT

Note: This is an unofficial, community-built provider. It is not affiliated with, endorsed by, or connected to MiniMax.

A Pi coding agent provider extension for MiniMax AI's M2 series models.

Features

  • Anthropic API Compatible: Uses MiniMax's Anthropic-compatible endpoint for seamless integration
  • Full Model Support: All MiniMax M2 series models including highspeed variants
  • Extended Context: Up to 204,800 token context window
  • Thinking Support: Built-in reasoning/thinking capabilities
  • Cost Tracking: Accurate token pricing for all models

Supported Models

Model Context Speed Description
MiniMax-M2.7 204,800 ~60 tps Latest flagship with recursive self-improvement
MiniMax-M2.7-highspeed 204,800 ~100 tps Same as M2.7 but faster output
MiniMax-M2.5 204,800 ~60 tps Peak performance, ultimate value
MiniMax-M2.5-highspeed 204,800 ~100 tps Same as M2.5 but faster output
MiniMax-M2.1 204,800 ~60 tps Powerful multi-language programming
MiniMax-M2.1-highspeed 204,800 ~100 tps Same as M2.1 but faster output
MiniMax-M2 204,800 ~60 tps Agentic capabilities, advanced reasoning

Installation

Option 1: Using pi install (npm)

pi install npm:@sinamtz/pi-minimax-provider

Option 2: Using pi install (git)

pi install git:https://github.com/sinamtz/pi-minimax-provider

Option 3: Install globally via npm

npm install -g @sinamtz/pi-minimax-provider

Option 4: Clone locally

git clone https://github.com/sinamtz/pi-minimax-provider.git
cd pi-minimax-provider

Usage

Set your API key

Get your API key from the MiniMax Platform.

There are three ways to set your API key (in order of priority):

Option 1: Using /login (Recommended)

The easiest way is to use pi's built-in login command:

pi -e ./pi-minimax-provider
/login

This will prompt you to enter your API key, which is then securely stored in ~/.pi/agent/auth.json.

Option 2: Edit auth.json manually

Add your API key directly to the auth file:

{
  "providers": {
    "minimax": {
      "access": "your-api-key-here",
      "expires": 1935753600000
    }
  }
}

Option 3: Environment variable

export MINIMAX_API_KEY=your-api-key-here
pi -e ./pi-minimax-provider

Run pi with the extension

# Using local path
pi -e ./path/to/pi-provider-minimax

# Using global install
pi -e $(npm root -g)/pi-provider-minimax

Select a model

In pi's interactive mode:

/model MiniMax-M2.7

Or use the model selector UI.

Pricing

Pricing is approximate and in USD per million tokens:

Model Input Output Cache Read Cache Write
M2.7 $0.77 $3.08 $0.077 $0.96
M2.5 $0.50 $2.00 $0.05 $0.625
M2.1 $0.20 $0.80 $0.02 $0.25
M2 $0.30 $1.20 $0.03 $0.375

Note: Highspeed variants have the same pricing as their standard counterparts.

For the most current pricing, see the MiniMax pricing page.

API Details

  • Base URL: https://api.minimax.io/anthropic
  • Protocol: Anthropic Messages API compatible
  • Authentication: Bearer token
    • Priority: auth.json (via /login) > environment variable MINIMAX_API_KEY
  • Streaming: Full streaming support

Troubleshooting

"Model not found" error

  • Ensure you've set up authentication (see Set your API key)
  • Verify the extension path is correct when using -e

Authentication errors

  • Check your MiniMax API key is valid
  • Ensure you have credits/quota available in your MiniMax account
  • If using /login, try re-authenticating: /logout -> MiniMax then /login -> MiniMax

Changelog

v1.0.8

  • Fix: Strip oauth: prefix from API keys to prevent 401 authentication errors
  • Add vitest unit tests for API key cleaning

v1.0.7

  • Add ESLint with TypeScript support
  • Add lint script to npm run commands

v1.0.6

  • Add auth.json support via /login minimax command

v1.0.3

  • Initial release

License

MIT

Contributing

Contributions welcome! Please open an issue or PR on GitHub.