openclaw-minimax-media 0.5.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
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 ADDED
@@ -0,0 +1,361 @@
1
+ # Openclaw MiniMax Media
2
+
3
+ Openclaw MiniMax Media is an OpenClaw plugin that registers MiniMax-powered tools for media and search workflows. It currently provides image understanding through the MiniMax Coding Plan VLM API, image generation through MiniMax `image-01`, music generation through MiniMax `music-2.6`, video generation through MiniMax `MiniMax-Hailuo-2.3`, text-to-speech through MiniMax `speech-2.8-hd`, and web search through the MiniMax Coding Plan search API. All six tools use the same MiniMax Coding Plan (Token Plan) API key.
4
+
5
+ ## Naming
6
+
7
+ This package intentionally uses one consistent OpenClaw-facing identity:
8
+
9
+ | Item | Value |
10
+ | --- | --- |
11
+ | npm package | `openclaw-minimax-media` |
12
+ | installed folder | `openclaw-minimax-media` |
13
+ | plugin ID | `openclaw-minimax-media` |
14
+ | plugin name | `Openclaw MiniMax Media` |
15
+ | tool names | `minimax_image`, `minimax_image_generate`, `minimax_music_generate`, `minimax_video_generate`, `minimax_tts`, `minimax_web_search` |
16
+
17
+ ## Features
18
+
19
+ - Provides the `minimax_image` OpenClaw tool for image understanding.
20
+ - Provides the `minimax_image_generate` OpenClaw tool for MiniMax `image-01` image generation.
21
+ - Provides the `minimax_music_generate` OpenClaw tool for MiniMax `music-2.6` music generation.
22
+ - Provides the `minimax_video_generate` OpenClaw tool for MiniMax `MiniMax-Hailuo-2.3` video generation.
23
+ - Provides the `minimax_tts` OpenClaw tool for MiniMax `speech-2.8-hd` text-to-speech with `Chinese (Mandarin)_Warm_Girl`.
24
+ - Provides the `minimax_web_search` OpenClaw tool, merged from `openclaw-minimax-web-search`.
25
+ - Uses MiniMax Coding Plan APIs for all six tools (VLM, image generation, music generation, video generation, TTS, and web search).
26
+ - Reads credentials from OpenClaw plugin config, `MINIMAX_CODE_PLAN_KEY`, `MINIMAX_CODING_API_KEY`, or `MINIMAX_API_KEY`.
27
+ - Accepts HTTP/HTTPS image URLs, local image paths, `@`-prefixed local paths, and Base64 data URLs.
28
+ - Supports JPEG, PNG, and WebP image inputs.
29
+ - Supports MiniMax image generation with aspect ratio control, up to 9 outputs, and one subject-reference image.
30
+ - Supports MiniMax music generation with lyrics, instrumental mode, duration hints, and MP3 output.
31
+ - Supports MiniMax video generation with text-to-video, one first-frame reference image, duration normalization, and resolution control.
32
+ - Supports MiniMax text-to-speech with MP3 output.
33
+ - Returns normalized web search result objects: title, URL, description, published date, and site name.
34
+ - Marks image analysis and search outputs as untrusted external content.
35
+ - Does not bundle any API key, token, personal account, private path, or internal network address.
36
+
37
+ ## Installation
38
+
39
+ Use OpenClaw's plugin installer after publishing the package:
40
+
41
+ ```bash
42
+ openclaw plugins install npm:openclaw-minimax-media@0.5.0 --pin
43
+ ```
44
+
45
+ Restart the OpenClaw Gateway after installation if the CLI asks you to do so.
46
+
47
+ If `openclaw-minimax-web-search` is already installed and enabled, disable or uninstall it before enabling this package. Both plugins register `minimax_web_search`, and duplicate tool registration can conflict.
48
+
49
+ ## Configuration
50
+
51
+ Configure the plugin under its plugin ID: `openclaw-minimax-media`.
52
+
53
+ Example OpenClaw config entry:
54
+
55
+ ```json
56
+ {
57
+ "plugins": {
58
+ "entries": {
59
+ "openclaw-minimax-media": {
60
+ "enabled": true,
61
+ "config": {
62
+ "apiKey": "YOUR_MINIMAX_CODING_PLAN_API_KEY",
63
+ "vlmTimeoutMs": 30000,
64
+ "imageGenerationTimeoutMs": 180000,
65
+ "musicGenerationTimeoutMs": 120000,
66
+ "videoGenerationTimeoutMs": 1200000,
67
+ "ttsTimeoutMs": 120000,
68
+ "searchTimeoutMs": 5000
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+ ```
75
+
76
+ You can also provide the API key through an environment variable:
77
+
78
+ ```bash
79
+ export MINIMAX_API_KEY="YOUR_MINIMAX_CODING_PLAN_API_KEY"
80
+ # Optional alternatives:
81
+ export MINIMAX_CODE_PLAN_KEY="YOUR_MINIMAX_CODING_PLAN_API_KEY"
82
+ export MINIMAX_CODING_API_KEY="YOUR_MINIMAX_CODING_PLAN_API_KEY"
83
+ # Optional: route media generation through the CN endpoint when supported by your account.
84
+ export MINIMAX_API_HOST="https://api.minimaxi.com"
85
+ ```
86
+
87
+ ### Config fields
88
+
89
+ | Field | Type | Default | Description |
90
+ | --- | --- | --- | --- |
91
+ | `apiKey` | string | none | MiniMax Coding Plan (Token Plan) API key. |
92
+ | `vlmUrl` | string | `https://api.minimaxi.com/v1/coding_plan/vlm` | MiniMax Coding Plan VLM API endpoint. |
93
+ | `vlmModel` | string | `minimax-VL-01` | MiniMax VLM model name. |
94
+ | `vlmTimeoutMs` | number | `30000` | VLM request timeout in milliseconds. Valid range: 1000-120000. |
95
+ | `imageGenerationBaseUrl` | string | `https://api.minimax.io` | MiniMax image generation base URL. The tool appends `/v1/image_generation` unless a full endpoint is provided. |
96
+ | `imageGenerationTimeoutMs` | number | `180000` | Image generation request timeout in milliseconds. Valid range: 1000-600000. |
97
+ | `musicGenerationBaseUrl` | string | `https://api.minimax.io` | MiniMax music generation base URL. The tool appends `/v1/music_generation` unless a full endpoint is provided. |
98
+ | `musicGenerationTimeoutMs` | number | `120000` | Music generation request timeout in milliseconds. Valid range: 1000-600000. |
99
+ | `videoGenerationBaseUrl` | string | `https://api.minimax.io` | MiniMax video generation base URL. The tool appends `/v1/video_generation` unless a full endpoint is provided. |
100
+ | `videoGenerationTimeoutMs` | number | `1200000` | End-to-end video generation operation timeout in milliseconds. Valid range: 1000-1800000. |
101
+ | `ttsBaseUrl` | string | `https://api.minimax.io` | MiniMax T2A API base URL. The tool appends `/v1/t2a_v2` and strips trailing `/anthropic` or `/v1` suffixes. |
102
+ | `ttsTimeoutMs` | number | `120000` | TTS request timeout in milliseconds. Valid range: 1000-600000. |
103
+ | `ttsSpeed` | number | `1` | MiniMax TTS playback speed. Valid range: 0.5-2.0. |
104
+ | `ttsVolume` | number | `1` | MiniMax TTS volume. Valid range: 0.01-10. |
105
+ | `ttsPitch` | number | `0` | MiniMax TTS integer pitch shift. Valid range: -12 to 12. |
106
+ | `searchUrl` | string | `https://api.minimaxi.com/v1/coding_plan/search` | MiniMax Coding Plan search API endpoint. |
107
+ | `searchTimeoutMs` | number | `5000` | Search request timeout in milliseconds. Valid range: 1000-60000. |
108
+
109
+ ## Tool: `minimax_image`
110
+
111
+ Parameters:
112
+
113
+ | Parameter | Type | Required | Description |
114
+ | --- | --- | --- | --- |
115
+ | `prompt` | string | yes | Text instruction describing what to analyze or extract from the image. |
116
+ | `image_source` | string | yes | HTTP/HTTPS image URL, local file path, `@`-prefixed local file path, or Base64 data URL. |
117
+
118
+ Example tool result shape:
119
+
120
+ ```json
121
+ {
122
+ "content": "The image shows...",
123
+ "provider": "openclaw-minimax-media",
124
+ "model": "minimax-VL-01",
125
+ "sourceType": "url",
126
+ "externalContent": {
127
+ "untrusted": true,
128
+ "source": "image_analysis",
129
+ "provider": "minimax"
130
+ }
131
+ }
132
+ ```
133
+
134
+ ## Tool: `minimax_image_generate`
135
+
136
+ Parameters:
137
+
138
+ | Parameter | Type | Required | Description |
139
+ | --- | --- | --- | --- |
140
+ | `action` | `"generate"` or `"list"` | no | Defaults to `generate`. Use `list` to inspect MiniMax image generation capabilities. |
141
+ | `prompt` | string | yes for generate | Image generation prompt. |
142
+ | `image` | string | no | Single subject-reference image path, URL, `@`-prefixed local path, or Base64 data URL. |
143
+ | `images` | string[] | no | Reference images. MiniMax `image-01` supports one reference image; extra entries are ignored. |
144
+ | `aspectRatio` | string | no | Supported values: `1:1`, `16:9`, `4:3`, `3:2`, `2:3`, `3:4`, `9:16`, `21:9`. |
145
+ | `count` | integer | no | Number of images to generate, from 1 to 9. Defaults to 1. |
146
+ | `timeoutMs` | integer | no | Per-call timeout in milliseconds. Valid range: 1000-600000. |
147
+ | `filename` | string | no | Output filename hint in returned image metadata. |
148
+
149
+ MiniMax `image-01` uses the dedicated image endpoint: `{imageGenerationBaseUrl}/v1/image_generation`. The request body uses `response_format: "base64"` and returns PNG data URLs in the tool result.
150
+
151
+ Example tool result shape:
152
+
153
+ ```json
154
+ {
155
+ "provider": "openclaw-minimax-media",
156
+ "model": "image-01",
157
+ "count": 1,
158
+ "images": [
159
+ {
160
+ "url": "data:image/png;base64,...",
161
+ "mimeType": "image/png",
162
+ "filename": "image-1.png"
163
+ }
164
+ ],
165
+ "externalContent": {
166
+ "untrusted": true,
167
+ "source": "image_generation",
168
+ "provider": "minimax"
169
+ }
170
+ }
171
+ ```
172
+
173
+ ## Tool: `minimax_music_generate`
174
+
175
+ Parameters:
176
+
177
+ | Parameter | Type | Required | Description |
178
+ | --- | --- | --- | --- |
179
+ | `action` | `"generate"` or `"list"` | no | Defaults to `generate`. Use `list` to inspect MiniMax music generation capabilities. |
180
+ | `prompt` | string | yes for generate | Music generation prompt. |
181
+ | `lyrics` | string | no | Optional lyrics text. Cannot be used with `instrumental=true`. |
182
+ | `instrumental` | boolean | no | Request instrumental-only music. |
183
+ | `durationSeconds` | number | no | Target duration hint in seconds. MiniMax receives this as part of the prompt. |
184
+ | `format` | `"mp3"` | no | Output format. MiniMax music generation currently supports MP3 only. |
185
+ | `timeoutMs` | integer | no | Per-call timeout in milliseconds. Valid range: 1000-600000. |
186
+ | `filename` | string | no | Output filename hint in returned track metadata. |
187
+
188
+ MiniMax `music-2.6` uses the dedicated music endpoint: `{musicGenerationBaseUrl}/v1/music_generation`. The request body uses `output_format: "url"` and MP3 audio settings. The tool accepts both URL and inline audio responses from MiniMax and returns MP3 data URLs in the tool result.
189
+
190
+ Example tool result shape:
191
+
192
+ ```json
193
+ {
194
+ "provider": "openclaw-minimax-media",
195
+ "model": "music-2.6",
196
+ "count": 1,
197
+ "tracks": [
198
+ {
199
+ "url": "data:audio/mpeg;base64,...",
200
+ "mimeType": "audio/mpeg",
201
+ "filename": "track-1.mp3"
202
+ }
203
+ ],
204
+ "lyrics": ["Generated or returned lyrics..."],
205
+ "externalContent": {
206
+ "untrusted": true,
207
+ "source": "music_generation",
208
+ "provider": "minimax"
209
+ }
210
+ }
211
+ ```
212
+
213
+ ## Tool: `minimax_video_generate`
214
+
215
+ Parameters:
216
+
217
+ | Parameter | Type | Required | Description |
218
+ | --- | --- | --- | --- |
219
+ | `action` | `"generate"` or `"list"` | no | Defaults to `generate`. Use `list` to inspect MiniMax video generation capabilities. |
220
+ | `prompt` | string | yes for generate | Video generation prompt. |
221
+ | `image` | string | no | Single first-frame reference image path, URL, `@`-prefixed local path, or Base64 data URL. |
222
+ | `images` | string[] | no | Reference images. MiniMax video generation supports one first-frame image; extra entries are ignored. |
223
+ | `durationSeconds` | number | no | Target duration. `MiniMax-Hailuo-2.3` supports 6 or 10 seconds; the nearest supported value is used. |
224
+ | `resolution` | `"768P"` or `"1080P"` | no | MiniMax-supported output resolution. |
225
+ | `timeoutMs` | integer | no | End-to-end operation timeout in milliseconds. Valid range: 1000-1800000. |
226
+ | `filename` | string | no | Output filename hint in returned video metadata. |
227
+
228
+ MiniMax `MiniMax-Hailuo-2.3` uses the dedicated video endpoint: `{videoGenerationBaseUrl}/v1/video_generation`. The initial request returns a `task_id`; the tool polls `/v1/query/video_generation`, then downloads the completed `video_url` or resolves `file_id` through `/v1/files/retrieve`. Returned videos are MP4 data URLs.
229
+
230
+ Example tool result shape:
231
+
232
+ ```json
233
+ {
234
+ "provider": "openclaw-minimax-media",
235
+ "model": "MiniMax-Hailuo-2.3",
236
+ "count": 1,
237
+ "videos": [
238
+ {
239
+ "url": "data:video/mp4;base64,...",
240
+ "mimeType": "video/mp4",
241
+ "filename": "video-1.mp4"
242
+ }
243
+ ],
244
+ "metadata": {
245
+ "taskId": "example-task-id",
246
+ "status": "Success"
247
+ },
248
+ "externalContent": {
249
+ "untrusted": true,
250
+ "source": "video_generation",
251
+ "provider": "minimax"
252
+ }
253
+ }
254
+ ```
255
+
256
+ ## Tool: `minimax_tts`
257
+
258
+ Parameters:
259
+
260
+ | Parameter | Type | Required | Description |
261
+ | --- | --- | --- | --- |
262
+ | `text` | string | yes | Text to convert to speech. |
263
+ | `timeoutMs` | integer | no | Request timeout in milliseconds. Valid range: 1000-600000. |
264
+ | `filename` | string | no | Output filename hint in returned audio metadata. |
265
+
266
+ This tool intentionally implements text-to-speech only. It always uses MiniMax `speech-2.8-hd` with voice `Chinese (Mandarin)_Warm_Girl`, calls `{ttsBaseUrl}/v1/t2a_v2`, decodes MiniMax's hex audio payload, and returns MP3 data URLs.
267
+
268
+ Example tool result shape:
269
+
270
+ ```json
271
+ {
272
+ "provider": "openclaw-minimax-media",
273
+ "model": "speech-2.8-hd",
274
+ "voiceId": "Chinese (Mandarin)_Warm_Girl",
275
+ "audio": {
276
+ "url": "data:audio/mpeg;base64,...",
277
+ "mimeType": "audio/mpeg",
278
+ "filename": "tts-1.mp3"
279
+ },
280
+ "externalContent": {
281
+ "untrusted": true,
282
+ "source": "tts",
283
+ "provider": "minimax"
284
+ }
285
+ }
286
+ ```
287
+
288
+ ## Tool: `minimax_web_search`
289
+
290
+ Parameters:
291
+
292
+ | Parameter | Type | Required | Description |
293
+ | --- | --- | --- | --- |
294
+ | `query` | string | yes | Search query string. Must not be empty. |
295
+ | `count` | integer | no | Number of results to return, from 1 to 10. Defaults to 5. |
296
+
297
+ Example tool result shape:
298
+
299
+ ```json
300
+ {
301
+ "query": "OpenClaw AI agent framework",
302
+ "provider": "openclaw-minimax-media",
303
+ "count": 3,
304
+ "results": [
305
+ {
306
+ "title": "Example result",
307
+ "url": "https://example.com/article",
308
+ "description": "Short snippet...",
309
+ "published": "2026-01-01 12:00:00",
310
+ "siteName": "example.com"
311
+ }
312
+ ],
313
+ "externalContent": {
314
+ "untrusted": true,
315
+ "source": "web_search",
316
+ "provider": "minimax"
317
+ }
318
+ }
319
+ ```
320
+
321
+ ## Operational notes and limitations
322
+
323
+ - This package registers direct OpenClaw tools. It does not register OpenClaw's built-in `imageGenerationProviders`, `musicGenerationProviders`, or `videoGenerationProviders` contracts, so it does not participate in built-in provider fallback routing.
324
+ - Generated images, music, videos, and TTS audio are returned as Base64 data URLs in the tool result. This is simple and npm-friendly, but large videos or long audio can make tool results very large compared with OpenClaw-managed media attachments.
325
+ - Long video generation runs are handled inside one tool call by polling MiniMax. If the host or channel imposes a shorter tool execution timeout, prefer a shorter `timeoutMs` or move this implementation to a provider/background-task integration later.
326
+ - Only JPEG, PNG, and WebP image inputs are accepted for image understanding, image generation references, and video first-frame references.
327
+
328
+ ## Safety and privacy
329
+
330
+ - Do **not** publish real API keys in this package, README, examples, or OpenClaw config files.
331
+ - This package does not include any bundled credentials.
332
+ - Remote image URLs, search results, and model responses are external, untrusted content; agents should treat them accordingly.
333
+ - Local image paths are read from the machine running OpenClaw. Only use local paths that are intended to be analyzed.
334
+ - Input images are converted to Base64 data URLs before being sent to MiniMax VLM or image generation APIs.
335
+ - Generated images are returned as PNG Base64 data URLs in the tool result.
336
+ - Generated tracks are returned as MP3 Base64 data URLs in the tool result.
337
+ - Generated videos are returned as MP4 Base64 data URLs in the tool result.
338
+ - TTS audio is returned as an MP3 Base64 data URL in the tool result.
339
+ - MiniMax API calls may consume your MiniMax Token Plan quota.
340
+ - Avoid using `minimax_web_search` for sensitive queries, including political, religious, private, credential, or otherwise restricted content.
341
+
342
+ ## Development
343
+
344
+ ```bash
345
+ npm install
346
+ npm test
347
+ npm pack --dry-run
348
+ ```
349
+
350
+ The package publishes only these files:
351
+
352
+ - `dist/`
353
+ - `openclaw.plugin.json`
354
+ - `README.md`
355
+ - `LICENSE`
356
+
357
+ Source files, local lockfiles, `node_modules`, backups, generated tarballs, and local workspace paths are excluded from the npm package.
358
+
359
+ ## License
360
+
361
+ MIT