npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mmx-sdk

v1.0.5

Published

SDK for the MiniMax AI Platform

Readme


FliPPeDround

Frontend Engineer · Open Source Enthusiast · Open to Work


Features

  • Text — Multi-turn chat, streaming, system prompts, JSON output
  • Image — Text-to-image with aspect ratio and batch controls
  • Video — Async video generation with progress tracking
  • Speech — TTS with 30+ voices, speed control, streaming playback
  • Music — Text-to-music with optional lyrics
  • Vision — Image understanding and description
  • Search — Web search powered by MiniMax
  • Dual Region — Seamless Global (api.minimax.io) and CN (api.minimaxi.com) support

Install

npm install mmx-sdk

Requires Node.js 18+

Requires a MiniMax Token PlanGlobal · CN

Quick Start

import { MiniMaxSDK } from 'mmx-sdk';

const sdk = new MiniMaxSDK({ apiKey: 'sk-xxxxx' });

// Text chat
const response = await sdk.chat({ message: 'What is MiniMax?' });
console.log(response);

// Image generation
const image = await sdk.generateImage({ prompt: 'A cat in a spacesuit' });
console.log(image);

// Speech synthesis
await sdk.speech({ text: 'Hello!', out: 'hello.mp3' });

// Video generation (async)
const { taskId } = await sdk.generateVideo({ prompt: 'Ocean waves at sunset', async: true });
const task = await sdk.getVideoTask({ taskId });

// Music generation
const music = await sdk.generateMusic({ prompt: 'Upbeat pop', lyrics: '[verse] La da dee, sunny day' });

// Web search
const results = await sdk.search({ query: 'MiniMax AI latest news' });

// Image vision
const description = await sdk.describeImage({ image: 'photo.jpg' });

// Check quota
const quota = await sdk.getQuota();

API Reference

new MiniMaxSDK(options)

Initialize the SDK with options:

const sdk = new MiniMaxSDK({
  apiKey: 'sk-xxxxx',      // Your API key
  region: 'global',       // 'global' or 'cn', auto-detected by default
  baseUrl: '...',         // Custom base URL (optional)
  timeout: 60000,         // Request timeout in ms (optional)
});

sdk.chat(request)

Send a chat message with support for streaming and multi-turn conversations.

// Non-streaming
const response = await sdk.chat({ message: 'Hello!' });

// Streaming
const stream = await sdk.chat({ message: 'Hello!', stream: true });
for await (const event of stream) {
  console.log(event);
}

sdk.speech(request)

Synthesize speech from text.

// Non-streaming
await sdk.speech({ text: 'Hello!', out: 'hello.mp3' });

// Streaming
const stream = await sdk.speech({ text: 'Hello!', stream: true });
for await (const chunk of stream) {
  // process audio chunks
}

sdk.voices(language?)

Get available system voices.

const voices = await sdk.voices();
const chineseVoices = await sdk.voices('Chinese');

sdk.generateImage(request)

Generate images from text prompts.

const image = await sdk.generateImage({
  prompt: 'A cat in a spacesuit',
  n: 3,
  aspectRatio: '16:9',
});

sdk.generateVideo(request)

Generate videos from text prompts.

// Async (returns task ID)
const { taskId } = await sdk.generateVideo({
  prompt: 'Ocean waves at sunset',
  async: true,
});

// Sync (waits for completion)
const video = await sdk.generateVideo({
  prompt: 'A robot painting',
});

sdk.getVideoTask({ taskId })

Get video generation task status.

const task = await sdk.getVideoTask({ taskId: '123456' });

sdk.downloadVideo(request)

Download a generated video by file ID.

await sdk.downloadVideo({ fileId: '176844028768320', out: 'video.mp4' });

sdk.generateMusic(request)

Generate music from text prompts.

// Non-streaming
const music = await sdk.generateMusic({
  prompt: 'Upbeat pop',
  lyrics: '[verse] La da dee, sunny day',
});

// Streaming
const stream = await sdk.generateMusic({ prompt: 'Jazz', stream: true });
for await (const chunk of stream) {
  // process audio chunks
}

sdk.search({ query })

Perform a web search.

const results = await sdk.search({ query: 'MiniMax AI latest news' });

sdk.describeImage(request)

Describe or analyze an image.

const description = await sdk.describeImage({
  image: 'photo.jpg',      // file path, URL, or file ID
  prompt: 'What breed is this cat?',
});

sdk.getQuota()

Get your current API quota usage.

const quota = await sdk.getQuota();

License

MIT