Skip to main content
modellix-cli is the official command-line client for Modellix. Use it to manage authentication profiles, discover and run models, wait for asynchronous tasks, download results, and produce stable output for scripts and agents. For full API behavior and response fields, see the REST API guide. Package details: npm · GitHub

Requirements

Install

Running modellix-cli with no arguments prints a local Quickstart. It does not call the API or start an interactive wizard.

Quickstart

1

Store and validate an API key

Or set MODELLIX_API_KEY for temporary and CI usage (see Authentication).
2

Check the environment

3

Discover model slugs

4

Submit a model task

5

Query the returned task ID

Authentication and profiles

Authenticated commands select a profile in this order:
  1. --profile
  2. MODELLIX_PROFILE
  3. the saved currentProfile
  4. default
They resolve the API key independently in this order:
  1. --api-key
  2. MODELLIX_API_KEY
  3. the selected saved profile
modellix-cli init is the short setup command and supports the same profile selection. Interactive prompts hide the key, and the CLI validates it before writing. Non-interactive setup:

Environment variable (CI and temporary use)

Prefer the hidden prompt or an environment variable over --api-key on the command line, which can remain in shell history. auth status, auth whoami, config show, and JSON status output never print the credential value.

Auth commands

Local configuration

Diagnose the environment

doctor checks the Node.js version, reports the API-key source without printing the key, validates API connectivity, and reads the team balance when authentication succeeds. A failed required check returns a non-zero exit status.

Discover models

Use --quiet or --output slugs to print one slug per line. Inspect one model:

Run a model

Inline JSON body

JSON file body

Pipe JSON from stdin

Common flags

  • --model-slug (required): exact provider/model value from model list
  • --body: request JSON string
  • --body-file: path to a JSON file, or - for stdin
  • --api-key: API key (overrides environment and saved profile)
  • --wait: poll until the task reaches a terminal state
  • --timeout: wait deadline (for example 5m, 30s, or bare seconds)
  • --output task-id: print only the new task ID for shell pipelines
Use either --body or --body-file, not both. The request body must be a JSON object and is capped at 64 MiB.

Submit and wait in one command

The default remains asynchronous. If waiting times out after a task ID is received, the error prints that ID and a safe task wait recovery command.
Paid POST submissions are never automatically retried. If a network or protocol failure leaves the submission outcome unknown, do not immediately repeat the same request—check task history and account activity first.

Compatibility alias

modellix-cli model invoke remains an alias of model run. New scripts should use model run. Example success response (async submit):

Batch model tasks

model batch accepts one JSON object per line (JSONL):
Batch submission requires either --max-tasks or explicit --yes, because every line can create a paid task. All slugs and JSON bodies are validated before the first POST. Concurrency is limited to 1–10, and the absolute local limit is 1000 tasks.

Query, wait, and download tasks

Get a task result

Example success response:

Wait for one or more tasks

Bare time values remain seconds. One invocation accepts at most 1000 unique IDs. Any failed terminal task exits 1. An overall timeout exits 124; JSON mode includes completed responses and unfinishedTaskIds.

Download task resources

Downloads require a successful task. Existing files are preserved by default; use --overwrite deliberately. JSON output contains local paths and byte counts, not signed source URLs.

Local task history

Successful submissions are recorded locally so task IDs remain recoverable:
History stores Task ID, profile, API origin, model slug, status, and timestamps—never an API key or request body.

Output, automation, and CI

Built-in Modellix business commands accept these common output controls: When flags overlap, quiet wins over JSON, then JSON wins over the command default. Business output uses stdout; warnings, debug details, and recovery instructions use stderr. For CI:
CI automatically disables colors, progress-capable output, and the background update check. Set MODELLIX_CLI_SKIP_NEW_VERSION_CHECK=true to disable the update check explicitly.

Exit codes

Networking and diagnostics

Override the API origin for a trusted gateway or local development server:
HTTPS is required; HTTP is accepted only for localhost, 127.0.0.1, or ::1. Sanitized request diagnostics go to stderr:
Diagnostics include method, endpoint path, retry attempt, response status, and elapsed time. They exclude API keys, request bodies, and response bodies.

Shell completion

Troubleshooting

API error codes the CLI surfaces:
  • 400: fix parameters or request body format before retrying
  • 401: API key missing, invalid, or expired
  • 402: insufficient balance
  • 404: verify task_id and --model-slug
  • 429: rate or concurrency limits
  • 500 / 503: temporary server-side issue

Help

Misspelled commands receive a nearest-command suggestion. Suggestions are never executed automatically.