MuAPI CLI

The official command-line interface for MuAPI allows you to generate images, videos, and audio directly from your terminal.

It is built with an Agent-first design — every command works perfectly for both humans (colored output, tables) and AI agents (--output-json, semantic exit codes, MCP server mode).

Installation

# npm (recommended — no Python required)
npm install -g muapi-cli

# pip
pip install muapi-cli

# or run without installing
npx muapi-cli --help

Quick Start

# Authenticate
muapi auth login --email you@example.com --password "..."

# Or configure an existing API key
muapi auth configure --api-key "YOUR_KEY"

# Generate Media
muapi image generate "a cyberpunk city at night" --model flux-dev
muapi video generate "a dog running on a beach" --model kling-master
muapi audio create "upbeat lo-fi hip hop for studying"

Core Commands

Authentication & Account

Manage your session and billing from the terminal.

  • muapi auth login: Log in and save API key.
  • muapi auth configure: Manually save an API key.
  • muapi account balance: Show current credit balance.

Media Generation

Generate content using our 100+ integrated AI models.

  • muapi image generate <prompt>: Text-to-image generation.
  • muapi video generate <prompt>: Text-to-video generation.
  • muapi audio create <prompt>: Create music with Suno.

Media Enhancement & Editing

Process existing images and videos.

  • muapi enhance upscale <url>: AI image upscaling.
  • muapi enhance face-swap --source <url> --target <url>: Face swap image/video.
  • muapi edit lipsync --video <url> --audio <url>: Lip sync to audio.

Workflow Orchestration

Build and run multi-node intelligent pipelines.

  • muapi workflow discover: Fetch a catalog of available workflows for LLM matching.
  • muapi workflow create <prompt>: Architect a new workflow using natural language.
  • muapi workflow run-interactive <id>: Guided CLI sequence for workflow execution.

Agentic Integration

The MuAPI CLI is designed to be the ultimate tool for AI coding assistants.

Global Options for Agents

  • --output-json / -j: Print raw JSON response (disables tables/colors).
  • --jq <expr>: Filter JSON output directly (e.g., '.outputs[0]').
  • --no-wait: Submit work asynchronously and return a request_id.

MCP Server

muapi exposes tools via the Model Context Protocol. The hosted server has 19 tools; the local stdio server (muapi mcp serve) has 24 — it adds muapi_upload_file and 5 social publishing tools, but omits search_models. There are two ways to connect:

Option 1 — Hosted (no install needed): Use the hosted server at https://api.muapi.ai/mcp with Streamable HTTP transport.

# Claude Code — one command setup
claude mcp add --transport http muapi \
  https://api.muapi.ai/mcp \
  --header "Authorization: Bearer YOUR_MUAPI_KEY"

For Cursor, Windsurf, and other clients, see the full MCP Server docs.

Option 2 — stdio (Claude Desktop): Run the CLI as a local stdio MCP server.

muapi mcp serve

Claude Desktop config (claude_desktop_config.json):

{
  "mcpServers": {
    "muapi": {
      "command": "muapi",
      "args": ["mcp", "serve"],
      "env": { "MUAPI_API_KEY": "your-key-here" }
    }
  }
}

Shell Completions

Enable autocomplete for a faster workflow:

muapi --install-completion bash
muapi --install-completion zsh
muapi --install-completion fish