modellix-design Skill
集成 Modellix 统一 API,用于 AI 图像、视频和音频工作流。只要用户想生成或编辑图像、创建或转换视频、合成语音、转录音频、克隆声音、虚拟试穿,或调用任何 Modellix 模型 API,就使用这个技能。当用户提到 Modellix、媒体生成的模型即服务,或通过统一 API 使用 Qwen、Wan、Seedream、Seedance、Kling、Hailuo、MiniMax、Whisper、CosyVoice 等提供商,或询问 Modellix 模型的请求结构、OpenAPI 契约或必填输入字段时,也会触发。优先使用 modellix-cli。
安装方式:把技能目录放入 ~/.claude/skills/(Claude Code)或在 claude.ai 设置中启用;也可复制右侧安装命令一键添加。
技能指令原文(SKILL.md)
Modellix Skill
Modellix is a Model-as-a-Service (MaaS) platform for asynchronous image, video, and audio workflows. When the host has connected Modellix Media Generation, use that MCP for a prompt or public URL. Use the official CLI (modellix-cli) when the MCP tools are absent, the client rejects the MCP protocol, or the input is a local file. Host-specific persistent session guardrails also ship under rules/*.mdc.
After files are on disk, local trimming, concatenation, reframing, and transcoding belong to modellix-ffmpeg.
Official Docs
- AI Onboarding: https://docs.modellix.ai/get-started.md
- REST API: https://docs.modellix.ai/ways-to-use/api.md
- Full Models Index: https://docs.modellix.ai/llms.txt
- Docs Search MCP (search / read docs): https://docs.modellix.ai/mcp
- Media Generation MCP: https://tool.modellix.ai/mcp/media
- Web Tools MCP (public web search / URL fetch): https://docs.modellix.ai/tools/mcp (endpoint https://tool.modellix.ai/mcp)
- CLI package (source of truth for CLI behavior): https://www.npmjs.com/package/modellix-cli
Documentation lookup policy
This plugin exposes Modellix Docs Search (https://docs.modellix.ai/mcp). It is a read-only documentation server (search_modellix, docs filesystem query, optional feedback). It does not submit generation tasks, poll, download, or handle API keys.
Modellix Media Generation (https://tool.modellix.ai/mcp/media) is a separate server. It submits paid image, video, and audio tasks. The host attaches Authorization: Bearer from its own secret store. This repository does not put that header in mcp.json.
Modellix Web Tools (https://tool.modellix.ai/mcp) is a separate server. It searches the public web (modellix-ai/web-search) and fetches public URLs (modellix-ai/web-fetch). Calls are billed. It does not submit image, video, or audio tasks, and it does not replace Docs Search or the CLI. The host attaches Authorization: Bearer from its own secret store. This repository does not put that header in mcp.json.
When looking up product/API/install docs vs request-body schema:
- For request/response schema on the Media Generation path, call
modellix_get_schemawith the exactprovider/modelslug. On the CLI path, usemodellix-cli model get-schema(JSON is the default; the endpoint is public and needs no API key). If neither is available, use Docs Search, thendocs_urlfrommodel describeor https://docs.modellix.ai/llms.txt. - For product/install narrative, prefer Docs Search when the host has it connected (search, then read the matching page). Else use
model describe --json→docs_url, or browsellms.txtand fetch the model.md. - For CLI command syntax and flags, prefer this skill,
references/cli-playbook.md, the npm README, ormodellix-cli --help— do not trust website CLI pages over the CLI package (docs can lag).
If Docs Search exposes a skill resource, treat this SKILL.md as the execution policy source of truth (Media Generation MCP, then CLI, then REST; the user names the model; paid-submit safety).
Do not rely on the website CLI guide page for command syntax.
Execution Policy
Choose one paid path. A second submit of the same request charges again.
- Modellix Media Generation when
modellix_submit_taskis in the tool list and the input is a prompt or public URL. The remote server cannot read a path on this computer, and a protocol error or401means this host cannot use the server — both are reasons to leave the path, not to retry it. - CLI after
scripts/preflight.py --jsonresolves it. Run preflight only when this path is selected. Preflight checks public npmlatest, installs only a newer exact version before execution, and keeps an existing CLI when update infrastructure is unavailable. Use the CLI for local files, batch,task download, and private-network CDN fallback. - REST only when the MCP tools are absent and the CLI is not installed, unsuitable, or missing a needed capability.
- Prefer machine-readable output (
--jsonor--quiet) for the CLI and REST paths.
Media Generation flow (details in references/media-mcp-playbook.md):
- Use the
provider/modelslug the user named. If they did not name one, ask which model to run and wait. Do not invent a slug or pick one from a built-in list. - Call
modellix_get_schemawith that slug. - Confirm the model and input with the user.
- Call
modellix_submit_taskonce and keeptask_id. - Call
modellix_wait_taskuntil the task is terminal. A deadline withdata.wait.timed_out=trueis a snapshot, not a failure; wait again with the same id. - Save
data.result.resourcesbefore they expire (about 7 days).
If modellix_submit_task returns submission_unknown, or the connection drops before a trustworthy response, do not call modellix-cli model run or a REST POST for the same request. Continue with modellix_get_task / modellix_wait_task when a task_id came back. When no id came back, check modellix-cli task history before considering another submit.
CLI flow, only after the Media Generation path is unavailable or the input is a local file:
python3 scripts/preflight.py --json
modellix-cli doctor --json
modellix-cli model get-schema <provider/model>
modellix-cli model run \
--model-slug <provider/model> \
--body '<json>' \
--wait --timeout 5m --json
modellix-cli task download <task_id> --output-dir ./outputs --json
Skip get-schema only when the user supplied a complete body.
model invoke is a compatibility alias of model run. New commands should use model run.
Do not reinvent polling loops when CLI wait is available. Do not invent deprecated flags (for example --model-type). Use --help only when behavior is unclear.
This skill does not choose a model. A slug comes from the user. modellix_list_models or modellix-cli model list is for when they ask to see options, not a step that ends by picking one for them.
API Key Lifecycle Policy
Handle credentials as: discover -> request -> use-session -> (optional) persist.
1) Discover existing key first
Before asking the user:
- Session / process env
MODELLIX_API_KEY - Saved CLI profile (
modellix-cli auth status/doctor— key via--profileorMODELLIX_PROFILEorcurrentProfile) - If still missing, request a key from the user
Never ask again when a usable key is already discoverable. CLI key resolution order is: --api-key → MODELLIX_API_KEY → selected saved profile.
2) Request key only when missing
- Ask for a key from Modellix Console.
- Do not print or echo key values.
- Prefer session env for the current run.
3) Optional persistence
Default: do not persist automatically.
When the user explicitly asks to persist:
- Preferred:
modellix-cli auth loginormodellix-cli init(CLI validates and stores the profile securely). - Alternative: user-level
MODELLIX_API_KEYonly if they insist on env persistence. - Do not write system-level env or other agents' config files.
4) Key rotation
If the user provides a new key: update session first; if they requested persistence, replace via auth login/init (or user-level env). Re-check with modellix-cli doctor --json (or scripts/preflight.py --json) before continuing.
Preflight and Deterministic Execution
Required first-workflow check when Python 3 is available:
python3 scripts/preflight.py --json
Bundled helpers:
scripts/preflight.py— checks public npmlatest, safely updates a missing/older global CLI before paid work, pins newer local installs instead of downgrading, wrapsdoctor, and recommendscli,rest, ornone.scripts/invoke_and_poll.py— performs the same resolution before submission, pins the resolved executable for the workflow, usesmodel run --waiton CLI, and otherwise keeps the REST submit plus server-side wait fallback.
Set MODELLIX_CLI_AUTO_UPDATE=0 (also accepts false or off) only when the environment must keep its installed CLI version. A registry/install failure is non-destructive: use the existing CLI if it still passes doctor, or REST when no CLI is usable and a session API key exists. Never update or swap the CLI after a paid submission has started.
When the selected path is CLI and preflight/doctor reports missing credentials, apply the lifecycle above.
When the selected path is CLI and the CLI is unavailable:
- Use REST (
references/rest-playbook.md). - Report the preflight update warning; do not repeatedly attempt installation inside the same paid workflow.
Core Workflow
1) Ready the environment
- Discover or request API key (lifecycle above). The Media Generation server receives it only through the host's own
Authorizationheader. - On the Media Generation path, continue when
modellix_submit_taskis listed. Do not run preflight first. - On the CLI path, run
scripts/preflight.py --jsonand continue only when doctor passed. - On the REST path, continue only when
MODELLIX_API_KEYis set.
2) Select model
- If the user did not name a
provider/modelslug, ask for one before any paid submit. Do not substitute a model of your own. - If they ask to browse:
modellix_list_modelson the MCP path, otherwisemodellix-cli model list/modellix-cli model describe(catalog metadata; describe returnsdocs_url). Listing does not authorize a submit. - For request body schema:
modellix_get_schemaon the MCP path, otherwisemodellix-cli model get-schema(JSON default; public, no API key). Call this when the body needs fields beyond the documented examples, after HTTP400, or when reporting required fields. Skip when the user supplied a complete body. - If neither MCP nor CLI can provide schema or discovery: use Docs Search or browse
llms.txt, then fetch the target model.md. Do not invent slugs from filenames; decimals in a slug are significant.
3) Run and wait
On the Media Generation path, follow the flow in Execution Policy and references/media-mcp-playbook.md. Call modellix_submit_task once.
CLI path (local file, batch, or MCP unavailable):
modellix-cli model run \
--model-slug <provider/model> \
--body '<json>' \
--wait --timeout 5m --json
Split flow when useful (pipelines, concurrency):
TASK_ID=$(modellix-cli model run --model-slug ... --body '...' --output task-id)
modellix-cli task wait "$TASK_ID" --timeout 10m --json
Batch (paid guard required): modellix-cli model batch tasks.jsonl --max-tasks N [--wait].
Use CLI 0.0.11 or later with a deployed server-wait API. task get is immediate; wait commands use bounded server waits. The legacy --interval flag is unused. On exit 124, keep unfinished IDs and resume; never resubmit.
For media inputs, use file list --json to reuse URLs, then file upload only when needed (images/video/audio, maximum 16 MiB / 16777216 bytes). On quota errors, explicitly approve deletion of an unneeded file ID; never auto-delete or replay uploads.
Manual REST: references/rest-playbook.md. Optional helper: scripts/invoke_and_poll.py.
4) Download results
modellix-cli task download <task_id> --output-dir ./outputs --json
If download fails with Resource host resolves to a private or reserved network address (common when a local proxy/VPN maps CDN hosts like file.modellix.ai into 198.18.0.0/15), retry with --allow-private-network for trusted Modellix CDN hosts, or fall back to downloading the result.resources[].url with curl/wget.
Resource URLs expire in about 7 days — persist promptly. If downloading manually (REST path), name files:
modellix-{model_slug}-{timestamp}.{ext}
(replace / in the slug with -).
Example filename: modellix-provider-model-20260430-113000.png.
Body shapes
Use the slug the user named. These shapes show required fields, not a model to select. Confirm the contract with modellix_get_schema or model get-schema when the body is not already complete.
- Text-to-image:
{"prompt": "..."} - Text-to-video:
{"prompt": "..."} - Image edit:
{"prompt": "...", "image": ["https://example.com/input.jpg"]} - Image-to-video: at least one of
first_frame_image,last_frame_image, orreference_images - Video-to-video:
{"video_urls": ["https://example.com/source.mp4"]} - Text-to-speech:
textandvoicefrom that model's schema - Speech-to-text: public audio
url - Speech-to-speech: the target
model, referenceurl, and synthesistextrequired by that slug
5) Post-task CLI recommendation
If this session used REST because CLI was missing, suggest installing the CLI afterward.
Progressive Reference Routing
Read only what the task needs:
references/media-mcp-playbook.md— Media Generation tools, upload limits, unknown-submit recoveryreferences/cli-playbook.md— install, auth, run/wait/download, batch, recoveryreferences/rest-playbook.md— REST submit/wait when MCP and CLI are unavailablereferences/capability-matrix.md— Media Generation MCP ↔ CLI ↔ REST mapping and fallback rules
Bundled Assets
assets/output/task-result.schema.json
Credential and Data Egress
- Primary credential:
MODELLIX_API_KEY(also via CLI profiles). - Network egress:
https://api.modellix.aifor CLI and REST (override only with trusted--base-url/MODELLIX_BASE_URL). Media Generation useshttps://tool.modellix.ai/mcp/mediaand receives the API key only when the host attaches it. Docs Search useshttps://docs.modellix.ai/mcpand does not receive the key. Web Tools useshttps://tool.modellix.ai/mcpand receives the API key only when the host attaches it. - User prompts and media inputs may be sent to Modellix during invocation.
- Never expose API keys in logs, screenshots, transcripts, or commits.
- Default to session-only credentials; persistent writes need explicit user approval.
Error / Retry Policy
| Situation | Action |
|------|--------|
| HTTP/API 400 | Do not retry. Fix parameters or body (model get-schema when the contract is unclear). |
| 401 | Do not retry. Fix key (doctor, auth login). |
| 402 | Do not retry. Insufficient balance. |
| 404 | Do not retry. Verify task_id or model slug. |
| 429 / read-only 5xx | CLI already retries safe GETs within deadline; do not blindly re-POST paid submits. |
| Paid submit outcome unknown | Do not immediately re-run the same model run, modellix_submit_task, or REST POST. Check task history, console activity, and any printed task ID first. |
| Media Generation submission_unknown | The submit may have succeeded. Do not start a CLI or REST submit for the same request. |
| Exit 124 | Local wait timeout; remote task may still run — recover with task wait / task get, then task download. |
| Exit 2 | Argument or safety guard (e.g. batch cost limit) — fix flags. |
Verification Checklist
- [ ] Media Generation tools used when they are available and the input is not a local file; otherwise doctor/preflight passed or REST key ready
- [ ] Model slug came from the user; none was invented
- [ ] Body schema checked via
modellix_get_schemaormodel get-schemawhen non-trivial - [ ] One paid submit only (
modellix_submit_task, ormodel run --wait/task waiton the CLI path) - [ ] Results saved (
data.result.resources,task download, or manual persist before 7-day expiry) - [ ] No second path after an unknown paid submission
- [ ] REST used only when Media Generation and CLI are both unavailable