Skip to main content
modellix-cli is the official command-line tool for Modellix. It helps you call the Modellix async model API from terminal and automate workflows in scripts or AI agents. For full API behavior and response fields, see the official REST API docs.

What You Can Do

  • List supported model types
  • Create async model generation tasks
  • Query task status and final generation result

Install

npm install -g modellix-cli
modellix-cli --version

Authentication

You can provide API key in either way:
  1. Recommended: environment variable MODELLIX_API_KEY
  2. Alternative: --api-key flag in each command
# macOS / Linux
export MODELLIX_API_KEY="your_api_key"
# Windows PowerShell
$env:MODELLIX_API_KEY="your_api_key"

Supported Model Types

Use this command to get the current allowed values:
modellix-cli model types
Machine-readable output (for CI or AI agents):
modellix-cli model types --json
Current enum values:
  • text-to-image
  • text-to-video
  • image-to-image
  • image-to-video
  • video-to-video

Create a Task

Use inline JSON body

modellix-cli model invoke \
  --model-type text-to-image \
  --model-id qwen-image-plus \
  --body '{"prompt":"A cute cat playing in a garden on a sunny day"}'

Use JSON file body

modellix-cli model invoke \
  --model-type text-to-image \
  --model-id qwen-image-plus \
  --body-file ./payload.json
Example success response:
{
  "code": 0,
  "message": "success",
  "data": {
    "status": "pending",
    "task_id": "task-abc123",
    "model_id": "alibaba/qwen-image-plus"
  }
}

Query Task Result

Use the returned task_id:
modellix-cli task get task-abc123
Example success response:
{
  "code": 0,
  "message": "success",
  "data": {
    "status": "success",
    "task_id": "task-abc123",
    "result": {
      "resources": [
        {
          "url": "https://cdn.example.com/images/abc123.png",
          "type": "image"
        }
      ]
    }
  }
}
  1. Run modellix-cli model types to confirm model type.
  2. Run modellix-cli model invoke ... to create async task.
  3. Save task_id from response.
  4. Run modellix-cli task get <task_id> until status is success or failed.

Error Handling Guide

The CLI surfaces API errors directly with actionable messages.
  • 400: fix parameters or request body format
  • 401: verify API key
  • 402: recharge account or check billing status
  • 404: verify task_id, model-type, and model-id
  • 429: retry with exponential backoff
  • 500 / 503: retry up to 3 times with backoff

Help

modellix-cli --help
modellix-cli model invoke --help
modellix-cli model types --help
modellix-cli task get --help