dsh-minimax-byapi 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/LICENSE +21 -0
- package/README.md +301 -2
- package/README.zh.md +302 -0
- package/SECURITY.md +39 -0
- package/assets/media.svg +10 -0
- package/cordis.patch.yml +5 -0
- package/icon.svg +10 -0
- package/lib/client.js +1340 -0
- package/locale/en.json +6 -0
- package/locale/media/en.json +6 -0
- package/locale/media/zh.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +101 -4
- package/scripts/build-client.mjs +6 -0
- package/src/adapter.js +69 -0
- package/src/catalog.js +186 -0
- package/src/client.js +1099 -0
- package/src/index.js +301 -0
- package/src/lock.js +61 -0
- package/src/media-entry.js +193 -0
- package/src/media.js +585 -0
- package/src/minimax-api.js +434 -0
- package/src/service.js +10 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `dsh-minimax-byapi` are recorded here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses [semantic versioning](https://semver.org/spec/v2.0.0.html).
|
|
4
|
+
|
|
5
|
+
## 0.1.0
|
|
6
|
+
|
|
7
|
+
First release. The plugin is renamed and reworked from the previous Grok gateway plugin to talk to the official MiniMax open platform, then corrected against the official API reference (`platform.minimax.cn/docs/api-reference`).
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Native dsh LLM provider under the route `minimax-byapi`, display name **MiniMax**, serving chat through the official pi-ai adapter.
|
|
12
|
+
- Five connection presets in `connection.plan`: `payg-global`, `payg-cn`, `coding-global`, `coding-cn` and `custom`. Each preset fills the API base URL and the chat protocol — the OpenAI-compatible `/v1` route for pay-as-you-go, the Anthropic-compatible `/anthropic` route for M Plan.
|
|
13
|
+
- Support for both MiniMax key types with one protocol: the pay-as-you-go API key and the M Plan subscription key (`sk-cp-…`) are both sent as `Authorization: Bearer <key>`. The difference is billing and model tier, not the wire format.
|
|
14
|
+
- Model discovery through `GET {root}/v1/models`, merged with the plugin's built-in model constants so media models stay listed even when the endpoint only returns chat models. Models are auto-categorized as chat, image, video, speech, music, research or unknown; only chat models enter the model picker.
|
|
15
|
+
- Built-in chat model metadata for `MiniMax-M3.1-Flash` and `MiniMax-M3` (1,000,000 context, 131,072 recommended output, image input, reasoning-effort levels for M3.1-Flash).
|
|
16
|
+
- Media tools in the `dsh-minimax-media` component: `minimax_generate_image`, `minimax_edit_image`, `minimax_generate_video`, `minimax_list_voices`, `minimax_speak`, `minimax_speak_long`, `minimax_transcribe`, `minimax_generate_music`, `minimax_media_status`, `minimax_media_retry_download`, `minimax_media_list`; plus `minimax_models` and `minimax_quota` in the `minimax-byapi` component. Thirteen tools in total.
|
|
17
|
+
- MiniMax-native media calls: image generation with aspect-ratio and `n` (1–9) control and `subject_reference` for image-to-image, the v2 video endpoint for the MiniMax-H3 family (4–15 s), the v1 video endpoint for the Hailuo family (6 s or 10 s), text-to-speech, and speech-to-text with `asr-1.0`.
|
|
18
|
+
- Durable, session-scoped media tasks: task records survive restarts, downloads are written to a `.part` file and renamed after validation, and a failed download can be retried without regenerating the result, so nothing is billed twice.
|
|
19
|
+
- Settings page with access mode, API address, API key, key verification, timeout, the chat-model table and media-model selection. The API key is written to the dsh credential service under the reference name `MINIMAX_API_KEY`; the configuration keeps only the reference.
|
|
20
|
+
- English and Chinese README, a bilingual settings page, tool result cards and media player that follow the dsh interface language.
|
|
21
|
+
- `minimax_quota` reads the M Plan remaining quota from `GET https://www.{minimax.io|minimax.cn}/v1/token_plan/remains` — the 5-hour and weekly windows with total, remaining, used, percentage and reset time, plus a per-model split when the server returns one. It reports a readable error for a pay-as-you-go key, which the endpoint refuses.
|
|
22
|
+
- Voice tooling: `minimax_list_voices` lists the `voice_id` values an account can use (`system` / `voice_cloning` / `voice_generation` / `all`), and `minimax_speak_long` runs asynchronous long-form speech through `/v1/t2a_async_v2` → `/v1/query/t2a_async_query_v2` → `/v1/files/retrieve`, up to 100,000 characters per call.
|
|
23
|
+
- `reasoning_effort` is now sent explicitly with `supportsReasoningEffort` on the Chat Completions route, and the output cap always uses `max_completion_tokens` (the deprecated `max_tokens` is never sent). Covered by a request-body test.
|
|
24
|
+
- Image parameters: `style_type` / `style_weight` for `image-01-live`, an explicit `width` / `height` pair for `image-01`, and `aigc_watermark` for images and videos. Local validation rejects a style on the wrong model, `21:9` on `image-01-live`, and an unpaired or out-of-range pixel size.
|
|
25
|
+
- Video v2 parameters: `aigc_watermark`, `prompt_expansion_mode` (MiniMax-H3-Max only), the per-model resolution and duration rules, and the ratio rules — text-to-video requires a concrete ratio, image-to-video is fixed to `adaptive`, and `MiniMax-H3-Lite` rejects `adaptive`. The v2 prompt limit is 7000 characters while v1 stays at 2000.
|
|
26
|
+
- A "Text model parameters" section in both READMEs and the parameter table in `VALIDATION.md`, listing what the plugin controls and what the adapter cannot send (`service_tier`, `reasoning_split`, disabling thinking on MiniMax-M3, text `seed`).
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- The plugin was renamed from `dsh-grok-byapi` to `dsh-minimax-byapi`; the package name, display name (`MiniMax ByAPI`), the two component ids (`minimax-byapi` and `dsh-minimax-media`) and the credential reference (`MINIMAX_API_KEY`) all follow the new provider.
|
|
31
|
+
- The credential reference renamed from `GROK_ALL_API_KEY` to `MINIMAX_API_KEY`.
|
|
32
|
+
- The default access mode is now `coding-cn` with `anthropic-messages`: a fresh install points at `https://api.minimaxi.com/anthropic`, the China M Plan route on the protocol MiniMax recommends. `connection.baseURL` and `connection.api` follow that default. Both China hosts answer identically (`api.minimaxi.com` and `api.minimax.cn`); the preset uses `api.minimaxi.com`, and switching to the other spelling is a `custom` address.
|
|
33
|
+
- The settings page puts the API protocol selector to the left of the address field, and changing it rewrites the official address path.
|
|
34
|
+
- Image width/height versus aspect ratio: the official rule is that `aspect_ratio` wins when both are given; the plugin instead honours the explicit pixel size and stops sending `aspect_ratio`, so an explicit value is never silently dropped. Documented in both READMEs.
|
|
35
|
+
- The media data directory is now `$DSH_HOME/plugins/dsh-minimax-byapi`.
|
|
36
|
+
- Documentation was rewritten for MiniMax: bilingual README, `SECURITY.md`, `VALIDATION.md` and the API research notes under `docs/`.
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
|
|
40
|
+
- **Every chat request failed with "pi-ai request header preparation failed".** The plugin applies the official pi-ai adapter to a scope of its own, and that scope did not answer the host's request-header seam: pi-ai `0.2.2-rc.1` composes every provider route's headers through `ctx.waterfall("llm-pi-ai/request-headers", …)`. The route therefore registered and the models were listed, but the first request threw a `TypeError` before any byte reached MiniMax. The scope now delegates that seam to the host context and forwards any other member the official adapter captures, so a later pi-ai release cannot break the route the same way again.
|
|
41
|
+
- **The declared peer ranges rejected the host's own versions.** `package.json` pinned `@deepseek-ai/cordis` to `~4.0.4`, `@deepseek-ai/schemastery` to `~3.18.4` and the `dsh-*` peers to `>=0.2.1-0 <0.3.0`, while the host ships cordis `4.1.0`, schemastery `3.19.0` and the `0.2.2-rc.1` line. The `dsh-*` range rejected the host outright: npm only lets a prerelease satisfy a range whose comparators mention that same `[major, minor, patch]` tuple. The ranges now match the sibling plugins — `>=4.0.4 <5.0.0`, `>=3.18.4 <4.0.0` and `>=0.2.1-0 <0.3.0-0 || >=0.2.2-0 <0.3.0-0` — and the development tree resolves to the host's versions, so the test suite exercises the same pi-ai the host runs.
|
|
42
|
+
- **The API address now follows the protocol.** On the official hosts `/v1` and `/anthropic` are paired with the OpenAI-compatible and Anthropic-compatible protocols; switching the protocol rewrites the path and re-derives the access mode from the address-plus-protocol pair, so the settings page can no longer produce "`/v1` with `anthropic-messages`". Custom endpoints are left untouched.
|
|
43
|
+
- **Text parameters on the Anthropic-compatible route.** pi-ai's default thinking form (`type: "enabled"` with `budget_tokens`) is not accepted by MiniMax; the plugin now forces adaptive thinking, so the request carries `thinking: { type: "adaptive" }` and `output_config.effort` instead. Verified by a request-body test.
|
|
44
|
+
- **Missing H3 video variants.** `MiniMax-H3-Highspeed` and `MiniMax-H3-Lite` were absent from the built-in catalog, so they could not be selected even though the v2 endpoint serves them.
|
|
45
|
+
- **`image-01-live` was described as image-to-image only.** The official OpenAPI allows it for text-to-image and gives it a `style` object; the note is corrected and the style parameters are exposed.
|
|
46
|
+
|
|
47
|
+
### Removed
|
|
48
|
+
|
|
49
|
+
- The Grok-specific gateway integration, the Grok Imagine media component and every `grok_*` tool.
|
|
50
|
+
- The video-editing and video-extension tools of the previous plugin.
|
|
51
|
+
- The Grok demo assets under `docs/assets/`, the screenshot manifest and the old planning documents.
|
|
52
|
+
|
|
53
|
+
### Known limitations
|
|
54
|
+
|
|
55
|
+
- Music generation is retired upstream: MiniMax closed the music API to new users on 2026-08-20 and lists all music models as retired. The tool stays for existing paying accounts only.
|
|
56
|
+
- Realtime voice conversation (audio-in / audio-out), voice cloning, voice design and MiniMax's server-side web search tool are not provided.
|
|
57
|
+
- Video results are snapshots: the result card does not refresh itself, the finished file has to be fetched with `minimax_media_status`.
|
|
58
|
+
- An end-to-end chat turn with a real MiniMax key has been performed (2026-11-06); media generation has not — see `VALIDATION.md`.
|
|
59
|
+
|
|
60
|
+
[Keep a Changelog]: https://keepachangelog.com/en/1.1.0/
|
|
61
|
+
[semantic versioning]: https://semver.org/spec/v2.0.0.html
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 NingYuanLee
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,302 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-minimax-byapi
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Native MiniMax for DeepSeek Harness: chat with a subscription (M Plan) key or a pay-as-you-go API key, plus image, video, speech, speech-to-text and music tools over the official MiniMax API.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/NingYuanLee/dsh-minimax-byapi/actions/workflows/ci.yml) [](LICENSE) [](#compatibility) [](#compatibility) [](https://github.com/topics/dsh-plugin)
|
|
6
|
+
|
|
7
|
+
English | [中文](README.zh.md)
|
|
8
|
+
|
|
9
|
+
> **Published on npm.** `dsh plugin add dsh-minimax-byapi` installs the released package; a git clone or a local checkout works too — see [Install](#install).
|
|
10
|
+
|
|
11
|
+
One plugin, one MiniMax connection. Chat models appear in the model picker; image, video, speech and music models stay out of it and are used through tools instead. Any chat model — MiniMax or another provider — can call those tools. The plugin talks to the official MiniMax open platform, keeps the API key in the dsh credential service, and saves generated media locally. It is not an OAuth client, does not provide an account or quota, and does not read any MiniMax CLI token.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
| Area | Current scope |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| Chat provider | Registers a native dsh LLM provider: route `minimax-byapi`, display name **MiniMax**. Streaming text and tool calls go through the official pi-ai adapter, over either the OpenAI-compatible or the Anthropic-compatible route. |
|
|
18
|
+
| Model catalog | `GET {root}/v1/models` discovery, merged with the plugin's built-in model constants, auto-categorized as chat, image, video, speech, music, research, or unknown. Only chat models enter the picker. Per-model overrides are available. |
|
|
19
|
+
| Connection presets | Five access modes: pay-as-you-go (international / China) and M Plan subscription (international / China), plus a custom endpoint. The preset fills the base URL and the chat protocol. |
|
|
20
|
+
| Settings page | Access mode, API address, API key, verification, timeout, the chat-model table (the picker's source of truth), and media-model selection. Copy follows the dsh language (English or Chinese). |
|
|
21
|
+
| Durable media tasks | Task records are per session and survive restarts. Downloads write `.part` files and are renamed after validation. A failed download can be retried without regenerating, so nothing is billed twice. |
|
|
22
|
+
| Results in chat | Tool result cards, file preview, and a sidebar player for MP4, MP3 and WAV. Tool cards and the player follow the dsh language. |
|
|
23
|
+
|
|
24
|
+
The plugin registers two components: `minimax-byapi` (chat, model catalog, settings page) and `dsh-minimax-media` (media tools). Together they register 13 tools:
|
|
25
|
+
|
|
26
|
+
| Tool | What it does |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| `minimax_models` | Refreshes the catalog and returns models grouped by capability. Optional `verify_key` checks address and key with one `GET /v1/models`. |
|
|
29
|
+
| `minimax_quota` | Reads the M Plan remaining quota and reset times (5-hour and weekly windows). Subscription key only — a pay-as-you-go key is refused. |
|
|
30
|
+
| `minimax_generate_image` | Text to image: `prompt`, optional `model`, aspect ratio, `n` (1–9, default 1), style settings for `image-01-live`. |
|
|
31
|
+
| `minimax_edit_image` | Image to image: `prompt` plus a reference image (`subject_reference`). |
|
|
32
|
+
| `minimax_generate_video` | Text to video. V2 models (MiniMax-H3 family) run 4–15 s; V1 models (Hailuo family) run 6 s or 10 s. |
|
|
33
|
+
| `minimax_list_voices` | Lists the `voice_id` values this account can use (`system` / `voice_cloning` / `voice_generation` / `all`). |
|
|
34
|
+
| `minimax_speak` | Synchronous text to speech: `text` up to 10000 characters, optional `model`, `voice_id`, speed, volume, pitch, emotion and format. |
|
|
35
|
+
| `minimax_speak_long` | Asynchronous long-form speech: `text` up to 100000 characters, returns a task id to fetch with `minimax_media_status`. |
|
|
36
|
+
| `minimax_transcribe` | Speech to text: uploads an audio file and returns the transcript. |
|
|
37
|
+
| `minimax_generate_music` | Text to music. Retired by MiniMax — see [Music](#music-is-retired). |
|
|
38
|
+
| `minimax_media_list` | Lists media tasks created in the current session. |
|
|
39
|
+
| `minimax_media_status` | Checks a task and downloads the result when ready: `task_id`. |
|
|
40
|
+
| `minimax_media_retry_download` | Retries a failed download without regenerating: `task_id`. |
|
|
41
|
+
|
|
42
|
+
Not provided: realtime voice conversation (audio-in / audio-out), voice cloning, voice design, MiniMax's server-side web search tool, and a live task dashboard. Video jobs are polled in-process after submit, but the result card is a snapshot and does not refresh itself — call `minimax_media_status` to fetch the finished file. Model classification is rule-based, not a guarantee.
|
|
43
|
+
|
|
44
|
+
## Compatibility
|
|
45
|
+
|
|
46
|
+
| Component | Requirement | Verified |
|
|
47
|
+
| --- | --- | --- |
|
|
48
|
+
| dsh | `>=0.2.1-rc.2 <0.3.0-0` via `engines.dsh` | `0.2.2-rc.1` in an isolated Web profile: install, load, both components running, settings page rendered. Chat and media calls still need a real key — see [VALIDATION.md](VALIDATION.md) |
|
|
49
|
+
| Node.js | `>=22.19.0` | CI runs Node 22.19 and 24 on Linux and Windows |
|
|
50
|
+
| MiniMax | Official open platform, international (`api.minimax.io`) or China (`api.minimaxi.com` / `api.minimax.cn`) | Documented endpoints only; no live call with a real key yet |
|
|
51
|
+
| Other dsh 0.2.x | Inside the `engines.dsh` range | Not individually verified |
|
|
52
|
+
|
|
53
|
+
`engines.dsh` is the compatibility gate; `peerDependencies` pin the SDK packages the source uses but do not decide compatibility, so rerun the integration tests after a dsh upgrade.
|
|
54
|
+
|
|
55
|
+
## Connection and the two kinds of key
|
|
56
|
+
|
|
57
|
+
MiniMax issues two kinds of credential, and the plugin treats them the same way on the wire:
|
|
58
|
+
|
|
59
|
+
| | Pay-as-you-go API key | M Plan subscription key |
|
|
60
|
+
| --- | --- | --- |
|
|
61
|
+
| Prefix | standard key | `sk-cp-…` |
|
|
62
|
+
| Header | `Authorization: Bearer <key>` | **Identical** — `Authorization: Bearer sk-cp-…` |
|
|
63
|
+
| Hosts | same hosts | same hosts |
|
|
64
|
+
| Billing | deducts account balance | deducts M Plan quota, then credits, then balance |
|
|
65
|
+
| Model tiers | all available models | plan tier decides which models you may call |
|
|
66
|
+
|
|
67
|
+
Both key types speak the same protocol; only the billing source and the available model tiers differ. The plugin stores the key in the dsh credential service under the reference name `MINIMAX_API_KEY` and never writes it into the configuration.
|
|
68
|
+
|
|
69
|
+
Both China hosts answer: `api.minimaxi.com` (the preset default) and `api.minimax.cn` (the host the current CN OpenAPI specs list). They behave identically for chat, media and quota; switch to `custom` if you need the other spelling.
|
|
70
|
+
|
|
71
|
+
### Access modes
|
|
72
|
+
|
|
73
|
+
`connection.plan` fills the base URL and the chat protocol:
|
|
74
|
+
|
|
75
|
+
| Plan | Base URL | Chat protocol |
|
|
76
|
+
| --- | --- | --- |
|
|
77
|
+
| `payg-global` — pay-as-you-go, international | `https://api.minimax.io/v1` | `openai-completions` |
|
|
78
|
+
| `payg-cn` — pay-as-you-go, China | `https://api.minimaxi.com/v1` | `openai-completions` |
|
|
79
|
+
| `coding-global` — M Plan, international | `https://api.minimax.io/anthropic` | `anthropic-messages` |
|
|
80
|
+
| `coding-cn` — M Plan, China | `https://api.minimaxi.com/anthropic` | `anthropic-messages` |
|
|
81
|
+
| `custom` — bring your own endpoint | empty | `openai-completions` |
|
|
82
|
+
|
|
83
|
+
On the official hosts the address and the protocol are paired: `/v1` speaks OpenAI-compatible, `/anthropic` speaks Anthropic-compatible. Changing the protocol in the settings page rewrites the path for you, and changing an access preset fills both. Custom endpoints are never rewritten.
|
|
84
|
+
|
|
85
|
+
The settings page defaults to **`coding-cn` with `anthropic-messages`**, so a fresh install points at `https://api.minimaxi.com/anthropic` — the China M Plan route on MiniMax's recommended protocol.
|
|
86
|
+
|
|
87
|
+
**MiniMax recommends the Anthropic-compatible route** (the docs label it "recommended" and the SDK examples lead with it). It serves the same two models with the same bearer key, and it is the only route where the thinking depth travels as `output_config.effort`. Use `coding-global` / `coding-cn` if you want that default; both key types work there.
|
|
88
|
+
|
|
89
|
+
### M Plan quota
|
|
90
|
+
|
|
91
|
+
`minimax_quota` calls `GET https://www.minimax.io/v1/token_plan/remains` (China: `https://www.minimax.cn/v1/token_plan/remains`) and returns the remaining and used quota with reset times for the 5-hour rolling window and the weekly window, plus a per-model split when the server provides one.
|
|
92
|
+
|
|
93
|
+
- **Subscription key only.** A pay-as-you-go key is refused by the service; the tool reports that instead of failing silently.
|
|
94
|
+
- Text, image, audio and other non-video capabilities are limited by both windows; video models are limited by the weekly window only, and unused quota does not carry over.
|
|
95
|
+
- The response field names are not documented upstream: `current_*_usage_count` is reported by MiniMax issue trackers as returning *remaining*, not used. The plugin reads it as remaining and falls back to treating it as used when the number exceeds the total. Treat the MiniMax console usage page as authoritative.
|
|
96
|
+
- The quota is read on demand, never polled or cached.
|
|
97
|
+
|
|
98
|
+
## Install
|
|
99
|
+
|
|
100
|
+
**From npm (recommended):**
|
|
101
|
+
|
|
102
|
+
```powershell
|
|
103
|
+
dsh --profile minimax-test --from-default-profile web --dump-config
|
|
104
|
+
dsh plugin --profile minimax-test add dsh-minimax-byapi
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**From git:**
|
|
108
|
+
|
|
109
|
+
```powershell
|
|
110
|
+
dsh --profile minimax-test --from-default-profile web --dump-config
|
|
111
|
+
dsh plugin --profile minimax-test add "git+https://github.com/NingYuanLee/dsh-minimax-byapi.git"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**From a local checkout (development):**
|
|
115
|
+
|
|
116
|
+
```powershell
|
|
117
|
+
git clone https://github.com/NingYuanLee/dsh-minimax-byapi.git
|
|
118
|
+
cd dsh-minimax-byapi
|
|
119
|
+
npm install --ignore-scripts
|
|
120
|
+
dsh --profile minimax-test --from-default-profile web --dump-config
|
|
121
|
+
dsh plugin --profile minimax-test add "$PWD" # bash/zsh: "$(pwd)"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`--dump-config` creates the profile from your default profile and prints the merged configuration without starting a server. `dsh plugin add` records the bundle in that profile — no manual YAML edit. The package has no `prepare` or `postinstall` script, so installation runs no build code and needs no `allowBuilds` entry.
|
|
125
|
+
|
|
126
|
+
Start dsh with that profile:
|
|
127
|
+
|
|
128
|
+
```powershell
|
|
129
|
+
dsh --profile minimax-test --no-open
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Keep the plugin in a dedicated profile until you are satisfied; this keeps the provider, tools and settings out of your daily environment. For a fully isolated trial, point `DSH_HOME` at a scratch directory.
|
|
133
|
+
|
|
134
|
+
## Update and uninstall
|
|
135
|
+
|
|
136
|
+
Updating a git install means removing it and adding the new commit; local installs update with `git pull` and `npm install --ignore-scripts`; an npm install picks up the new version when you remove and re-add the plugin. Restart dsh afterwards.
|
|
137
|
+
|
|
138
|
+
```powershell
|
|
139
|
+
dsh plugin --profile minimax-test remove dsh-minimax-byapi
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Removing the plugin takes its layers out of the profile: the provider, the 13 tools and the settings page are gone. Generated media and task records are **not** deleted, and the credential is **not** removed either. Delete the data directory yourself if you want the files gone:
|
|
143
|
+
|
|
144
|
+
```powershell
|
|
145
|
+
Remove-Item -Recurse -Force "$env:DSH_HOME\plugins\dsh-minimax-byapi"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Delete the credential in dsh if you no longer need it.
|
|
149
|
+
|
|
150
|
+
## Configuration
|
|
151
|
+
|
|
152
|
+
Use the plugin settings page for normal setup. Manual configuration in the profile's `cordis.patch.yml` is possible but optional:
|
|
153
|
+
|
|
154
|
+
```yaml
|
|
155
|
+
- id: minimax-byapi
|
|
156
|
+
name: dsh-minimax-byapi
|
|
157
|
+
config:
|
|
158
|
+
connection:
|
|
159
|
+
plan: coding-cn
|
|
160
|
+
baseURL: https://api.minimaxi.com/anthropic
|
|
161
|
+
api: anthropic-messages
|
|
162
|
+
apiKeyEnv: MINIMAX_API_KEY
|
|
163
|
+
verify: true
|
|
164
|
+
timeoutMs: 60000
|
|
165
|
+
media:
|
|
166
|
+
imageModel: image-01
|
|
167
|
+
videoModel: MiniMax-H3
|
|
168
|
+
speechModel: speech-2.8-hd
|
|
169
|
+
musicModel: ''
|
|
170
|
+
dataDir: ''
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
| Key | Default | Notes |
|
|
174
|
+
| --- | --- | --- |
|
|
175
|
+
| `connection.plan` | `coding-cn` | Access mode: `payg-global`, `payg-cn`, `coding-global`, `coding-cn`, `custom`. Fills `baseURL` and `api`. The default is the China M Plan route on the recommended Anthropic-compatible protocol. |
|
|
176
|
+
| `connection.baseURL` | `https://api.minimaxi.com/anthropic` | API address. Non-local addresses must be HTTPS; the path is normalized to `/v1` or `/anthropic`. |
|
|
177
|
+
| `connection.apiKey` | empty | Direct key override for local testing; takes precedence over the credential. Leave empty in normal use. |
|
|
178
|
+
| `connection.apiKeyEnv` | `MINIMAX_API_KEY` | Credential reference name in the dsh credential service. |
|
|
179
|
+
| `connection.api` | `anthropic-messages` | Chat protocol: `openai-completions`, `openai-responses` or `anthropic-messages`. |
|
|
180
|
+
| `connection.verify` | `true` | Verify `GET {root}/v1/models` with the saved key when settings are saved. |
|
|
181
|
+
| `connection.timeoutMs` | `60000` | Request timeout in milliseconds (1000–600000). |
|
|
182
|
+
| `media.imageModel` | empty | Image model used when a call omits `model`. |
|
|
183
|
+
| `media.videoModel` | empty | Video model used when a call omits `model`. |
|
|
184
|
+
| `media.speechModel` | empty | TTS model used when a call omits `model`. |
|
|
185
|
+
| `media.musicModel` | empty | Music model used when a call omits `model`. Retired upstream; only existing paying accounts can call it. |
|
|
186
|
+
| `media.dataDir` | empty | Media output directory; empty means `$DSH_HOME/plugins/dsh-minimax-byapi`. |
|
|
187
|
+
| `modelOverrides` | `[]` | Per-model overrides written by the settings page: category, display name, image support, context window, max output, reasoning efforts. Applied on the next refresh. |
|
|
188
|
+
|
|
189
|
+
`connection`, `media` and `modelOverrides` are volatile sections: after saving, dsh reloads the plugin layer and the model catalog is discovered again.
|
|
190
|
+
|
|
191
|
+
The settings page writes the API key into the dsh credential service under the reference name above; the configuration keeps only the reference. Do not hand-write a key into YAML.
|
|
192
|
+
|
|
193
|
+
## Capabilities
|
|
194
|
+
|
|
195
|
+
### Chat models
|
|
196
|
+
|
|
197
|
+
| Model | Context | Recommended output | Image input | Thinking |
|
|
198
|
+
| --- | --- | --- | --- | --- |
|
|
199
|
+
| `MiniMax-M3.1-Flash` | 1,000,000 | 131,072 | yes | Always on; depth `low` / `medium` / `high` / `xhigh` / `max` |
|
|
200
|
+
| `MiniMax-M3` | 1,000,000 | 131,072 | yes | Adaptive; no effort dial |
|
|
201
|
+
|
|
202
|
+
Retired and no longer callable: `MiniMax-M2`, `M2.1`, `M2.5`, `M2.7`, `M2.7-highspeed`, `M1`, `Text-01`, `VL-01` and `abab6.5`. M Plan users are routed to `MiniMax-M3.1-Flash` automatically.
|
|
203
|
+
|
|
204
|
+
### Text model parameters
|
|
205
|
+
|
|
206
|
+
The plugin maps MiniMax's text parameters onto the dsh surfaces that own them. Parameters are per request, so they live in dsh's model picker and the plugin settings page's model table, not in a separate form:
|
|
207
|
+
|
|
208
|
+
| MiniMax parameter | What the plugin does | Where you control it |
|
|
209
|
+
| --- | --- | --- |
|
|
210
|
+
| `max_completion_tokens` (Chat Completions) / `max_tokens` (Anthropic) / `max_output_tokens` (Responses) | Sends the request's output cap under the field that protocol expects — `max_tokens` is never sent, it is deprecated upstream | dsh picks the cap per call; the model table's max-output column is the catalog default (131,072 recommended, 524,288 hard cap) |
|
|
211
|
+
| `reasoning_effort` (Chat Completions) | Sent as `reasoning_effort` with `low` / `medium` / `high` / `xhigh` / `max`; nothing is sent when no level is chosen, so the server keeps its default (`max`) | Reasoning level in the model picker; the levels on offer come from the model table's reasoning column |
|
|
212
|
+
| `output_config.effort` (Anthropic-compatible) | Sent as `output_config.effort` with the same five levels | Same reasoning level |
|
|
213
|
+
| `thinking` | Only `adaptive` is ever sent. On the Anthropic route the plugin forces adaptive thinking, because pi-ai's default budget form (`type: "enabled"`, `budget_tokens`) is not accepted by MiniMax | Implicit: `MiniMax-M3.1-Flash` always thinks; `MiniMax-M3` thinks when a level is selected, otherwise the server default stands |
|
|
214
|
+
| `reasoning_content` | Parsed as the model's thinking channel; no switch is sent (`reasoning_split` defaults to the split form) | Read-only |
|
|
215
|
+
| `temperature` / `top_p` | Not sent as user knobs; MiniMax ignores them anyway (fixed at 1 and 0.95) | Not available — upstream ignores the value |
|
|
216
|
+
| `service_tier`, `reasoning_split`, `seed` for text | Not exposed: the adapter has no field for them | Not available |
|
|
217
|
+
|
|
218
|
+
Two route differences worth knowing: `MiniMax-M3` defaults to adaptive thinking on the OpenAI-compatible route but to no thinking on the Anthropic-compatible route, and `MiniMax-M3.1-Flash` rejects `thinking: disabled` on both. The plugin therefore never sends a disable request.
|
|
219
|
+
|
|
220
|
+
The catalog is the merge of `GET {root}/v1/models` and the plugin's built-in constants, so the media models below stay listed even when the discovery endpoint only returns chat models. The settings page's model table is what the picker shows — delete a row and save to hide that model.
|
|
221
|
+
|
|
222
|
+
### Media models
|
|
223
|
+
|
|
224
|
+
| Capability | Models |
|
|
225
|
+
| --- | --- |
|
|
226
|
+
| Image | `image-01` (text and image to image), `image-01-live` (same, plus style settings) |
|
|
227
|
+
| Video (v2 endpoint) | `MiniMax-H3` (768P / 2K, 4–15 s), `MiniMax-H3-Highspeed` (480P / 768P, 4–15 s), `MiniMax-H3-Lite` (480P / 768P, 4–15 s, no `adaptive` ratio), `MiniMax-H3-Max` (480P / 768P, 5–15 s) |
|
|
228
|
+
| Video (v1 endpoint) | `MiniMax-Hailuo-2.3`, `MiniMax-Hailuo-2.3-Fast` (image to video only), `MiniMax-Hailuo-02` — 6 s or 10 s, 512P / 720P / 768P / 1080P |
|
|
229
|
+
| Speech | `speech-2.8-hd`, `speech-2.8-turbo`, `speech-2.6-hd`, `speech-2.6-turbo`, `speech-02-hd`, `speech-02-turbo` |
|
|
230
|
+
| Speech to text | `asr-1.0` |
|
|
231
|
+
| Music | `music-3.0`, `music-2.6`, `music-cover` — retired, see below |
|
|
232
|
+
|
|
233
|
+
Each media picker in the settings page shows a one-line description of the currently selected model, and the options carry the same text as a tooltip. Image generation accepts an aspect ratio of `1:1`, `16:9`, `4:3`, `3:2`, `2:3`, `3:4`, `9:16` or `21:9` — `21:9` is `image-01` only — a prompt of at most 1500 characters and `n` between 1 and 9. `image-01` also accepts an explicit `width`/`height` pair (512–2048 px, multiples of 8, both required); when both are given the plugin honours the explicit pixel size and does not send `aspect_ratio` (upstream would otherwise ignore `width`/`height`). `image-01-live` additionally accepts a `style` object (`style_type` 漫画 / 元气 / 中世纪 / 水彩, `style_weight` in (0, 1]). Image-to-image passes the reference image as `subject_reference` (a `character` reference: a public URL or a `data:image/jpeg;base64,…` Data URL, JPG/JPEG/PNG under 10 MB).
|
|
234
|
+
|
|
235
|
+
Video generation is asynchronous in three steps: create the task, query the task, then download the file. The plugin keeps the task id, so `minimax_media_status` can fetch the finished clip without submitting a new one.
|
|
236
|
+
|
|
237
|
+
### Music is retired
|
|
238
|
+
|
|
239
|
+
MiniMax has retired the music models, and since **2026-08-20** the music API is closed to new users — only existing paying accounts can still call it. The `minimax_generate_music` tool and the `media.musicModel` setting remain in place for those accounts, but a new account will get an error from the server. Treat music as a legacy capability, not as something to plan around.
|
|
240
|
+
|
|
241
|
+
## Permissions and privacy
|
|
242
|
+
|
|
243
|
+
- **Network:** only the MiniMax endpoint you configure. Discovery calls `GET {root}/v1/models`, chat uses the configured route, and the media tools call the image, video, speech, speech-to-text and music endpoints on the same host. No telemetry, no analytics, no third-party service.
|
|
244
|
+
- **Credentials:** the key lives in the dsh credential service under the reference name `MINIMAX_API_KEY`; it is not written to YAML, to logs, to task records or to the repository. Media download requests are sent to MiniMax's own file host and carry no separate credential.
|
|
245
|
+
- **Files:** generated media goes to `$DSH_HOME/plugins/dsh-minimax-byapi` (or `media.dataDir`). Task records may contain time-limited upstream URLs; treat them as private.
|
|
246
|
+
- **Data leaves your machine:** prompts, the reference images you attach, the audio you upload for transcription and the text you synthesize are sent to MiniMax to be processed, exactly as you send them in the chat prompt. The plugin does not filter, redact or re-host that content.
|
|
247
|
+
- **Not done by this plugin:** reading or reusing a MiniMax CLI token, installing or running other plugins, fetching runtime dependencies at install time, calling the server-side web search tool, voice cloning or voice design.
|
|
248
|
+
|
|
249
|
+
Installing any dsh plugin runs third-party code with your user permissions, and tool approvals do not sandbox plugin code — review the source before installing. Please report security issues through [SECURITY.md](SECURITY.md).
|
|
250
|
+
|
|
251
|
+
## Usage
|
|
252
|
+
|
|
253
|
+
- **Chat:** choose **MiniMax** in the model picker. Only chat models are listed; the settings page's model table is what the picker shows, so delete a row and save to hide that model.
|
|
254
|
+
- **Images:** one call generates and saves; inline the result with an absolute local path — ``. dsh Web serves it through `/api/file`; the limit is 20 MiB per file.
|
|
255
|
+
- **Video:** submits a job. Call `minimax_media_status` with the returned `task_id` until the result is saved or the task failed; the status card does not refresh by itself. Do not resubmit a job whose submission status is unknown — that would be billed twice.
|
|
256
|
+
- **Speech:** `minimax_speak` writes an audio file for text up to 10000 characters; `minimax_speak_long` submits an asynchronous job for long text and returns a task id to fetch with `minimax_media_status`; `minimax_list_voices` returns the `voice_id` values to pass to either. `minimax_transcribe` uploads a local audio file and returns the transcript as text.
|
|
257
|
+
- **Display:** video and audio appear in the tool result card player. Do not inline them with Markdown image syntax — the chat does not render them and shows a broken image instead.
|
|
258
|
+
|
|
259
|
+
## Troubleshooting
|
|
260
|
+
|
|
261
|
+
Installation is successful when all four checks pass:
|
|
262
|
+
|
|
263
|
+
1. `dsh --profile minimax-test --dump-config` lists the `minimax-byapi` layer.
|
|
264
|
+
2. The Plugins page shows this plugin with both components (`minimax-byapi` and `dsh-minimax-media`) running.
|
|
265
|
+
3. `minimax_models` returns categorized model IDs.
|
|
266
|
+
4. After `dsh plugin --profile minimax-test remove dsh-minimax-byapi`, the layers and components are gone.
|
|
267
|
+
|
|
268
|
+
| Symptom | Fix |
|
|
269
|
+
| --- | --- |
|
|
270
|
+
| `dsh plugin add` fails or reports 404 | Use the git or local-checkout form above; that path does not depend on the npm registry. |
|
|
271
|
+
| Plugin is listed but does not load | Your dsh is outside `>=0.2.1-rc.2 <0.3.0-0`. Upgrade to a 0.2.x build. |
|
|
272
|
+
| 401 or 403 in settings | Wrong key or base URL. Re-save the key and check the address preset (`api.minimax.io` vs `api.minimaxi.com`). |
|
|
273
|
+
| "该地址没有开放模型列表接口" | That address does not expose `GET /v1/models`; the self-check is skipped and the built-in model constants are used. |
|
|
274
|
+
| Connection refused or timeout | The endpoint is unreachable, or the account has no balance left. `timeoutMs` caps each request. |
|
|
275
|
+
| No MiniMax models in the picker | `/v1/models` returned nothing classified as chat; refresh with `minimax_models` and add overrides. |
|
|
276
|
+
| Model not discovered or wrong category | Refresh `minimax_models`, then correct the category in the settings page. |
|
|
277
|
+
| Media call fails while chat works | The account does not have access to that model or capability — a music call on a new account fails this way by design. |
|
|
278
|
+
| Video stays generating | Query `minimax_media_status`; do not resubmit a task whose submission status is unknown. |
|
|
279
|
+
| Download failed but the task is done | Call `minimax_media_retry_download`; it retries the download only and never regenerates. |
|
|
280
|
+
|
|
281
|
+
More measured behavior and limits: [VALIDATION.md](VALIDATION.md).
|
|
282
|
+
|
|
283
|
+
## Development and testing
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
npm install --ignore-scripts
|
|
287
|
+
npm test # automated tests
|
|
288
|
+
npm run check # syntax checks for the source files
|
|
289
|
+
npm run build # rebuilds lib/client.js from src/client.js
|
|
290
|
+
npm pack --dry-run
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
CI (`.github/workflows/ci.yml`) runs on Linux and Windows with Node 22.19 and 24: install, tests, syntax checks, build, a check that `lib/client.js` matches the build output, and a pack dry run. Pushing a `v*` tag runs `.github/workflows/release.yml`, which verifies that the tag matches `package.json`, repeats the checks, attaches the packed tarball to a GitHub Release, and publishes to npm only if an `NPM_TOKEN` secret is configured.
|
|
294
|
+
|
|
295
|
+
Further reading: [docs/connection-and-keys.md](docs/connection-and-keys.md) for the access modes, key types and model status; [docs/media-workflow.md](docs/media-workflow.md) for the media task lifecycle; [docs/minimax-api-notes.md](docs/minimax-api-notes.md) for the upstream API research this plugin is built on. These pages live in the repository only — `docs/` is not part of the published package.
|
|
296
|
+
|
|
297
|
+
## Community, license and disclaimer
|
|
298
|
+
|
|
299
|
+
- Bugs and feature requests: [Issues](https://github.com/NingYuanLee/dsh-minimax-byapi/issues) (bug report and feature request templates are provided).
|
|
300
|
+
- Security: [SECURITY.md](SECURITY.md) — please use GitHub's private vulnerability reporting.
|
|
301
|
+
- License: [MIT](LICENSE). Copyright (c) 2026 NingYuanLee.
|
|
302
|
+
- Repository: <https://github.com/NingYuanLee/dsh-minimax-byapi>. This is a community plugin project, not an official DeepSeek or MiniMax product. "ByAPI" means the plugin reaches MiniMax through the official API with your own key; it does not implement every MiniMax product feature.
|