muapi CLI

Official command-line interface for muapi.ai — generate images, videos, and audio directly from your terminal.
Agent-first design — every command works for both humans (colored output, tables) and AI agents (--output-json, --jq filtering, semantic exit codes, MCP server mode).
- MuAPI CLI docs — Command reference and setup guidance.
- MuAPI API reference — Underlying endpoints and prediction lifecycle.
- midjourney-api — Python SDK for Midjourney V7, V8, and Niji image generation.
- suno-api — Python SDK for Suno music, audio, and voice workflows.
- minimax-music-3-api — Python SDK for MiniMax Music 3.0 text-to-music generation on Muapi.
- awesome-minimax-music-3-prompts — Curated song prompts and lyrics-formatting guide for MiniMax Music 3.0.
- MiniMax-H3-API — Python SDK for MiniMax H3 video-generation workflows on Muapi.
- Seedance-2-Spicy-API — Python SDK and MCP server for the relaxed-moderation Seedance 2 Spicy / 2 Mini Spicy tier.
- Seedance-2.5-Spicy-API — Python SDK and MCP server for the relaxed-moderation Seedance 2.5 Spicy tier.
- Wan-3.0-Spicy-API — Python SDK and MCP server for the relaxed-moderation Wan 3.0 Spicy tier.
- awesome-minimax-h3-prompts — Prompt gallery with runnable MiniMax H3 examples for the CLI.
- Wan-3.0-API — Python SDK and MCP server for Wan 3.0-compatible AI video generation.
- Wan-3.0-Prime-API — Python SDK and MCP server for the higher-fidelity Wan 3.0 Prime tier.
- Gemini-Omni-1.1-Flash-API — Python SDK and MCP server for Google's newly announced Gemini Omni 1.1 Flash update.
- Awesome-Gemini-Omni-API-Prompts — Curated Gemini Omni prompts and REST examples.
- Open-Generative-AI — Browser-based GUI for the same models — no CLI required
- Awesome-GPT-Image-2-API-Prompts — Curated prompt library to run via this CLI
- ai-creator-academy — free curriculum teaching creators how to monetize generative AI, including running models via this CLI
- Flux-3-Dev-API — Python wrapper for Black Forest Labs' FLUX 3 (Dev variant) — text-to-image, image-to-image, text-to-video, image-to-video
- Grok-Imagine-Image-2-API — Python SDK and MCP server for Grok Imagine Image 2.0 generation and editing through MuAPI
- awesome-flux-3-api-prompts — FLUX 3 API guide, prompts, and parameters
- flux-3-video-api — Python wrapper focused on FLUX 3 Text-to-Video and Image-to-Video
- seedance-2.5-mcp — MCP server for generating Seedance 2.5 Preview videos through MuAPI.
- seedance-2-mcp — MCP server for generating Seedance 2 videos through MuAPI.
- Text-to-Speech-API — speech model comparison and raw API examples that can be run through the CLI.
- Speech-to-Text-API — transcription and audio-analysis examples for the same Muapi endpoints.
- Image-Enhancement-API — image upscaling and background-removal API examples.
- Video-Utilities-API — video enhancement and MMAudio utility examples.
- AI-3D-Model-API — Tripo3D and Meshy API comparisons and examples.
- muapi-skills — Agent skills (
npx skills add SamurAIGPT/muapi-skills) that let Claude Code, Cursor and Codex discover, price and run Muapi models through this CLI.
Install
# 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
# New user? Create an account
muapi auth register --email you@example.com --password "..."
muapi auth verify --email you@example.com --otp 123456
muapi auth login --email you@example.com --password "..."
# Or paste an existing API key
muapi auth configure --api-key "YOUR_KEY"
# Generate — pick a curated verb…
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"
# …or run any model by endpoint name (schema-driven, covers the whole catalog)
muapi run flux-dev-image -p "a cyberpunk city at night"
muapi run seedance-2-text-to-video -p "drone shot over snowy peaks" -i duration=5
muapi run <model> -h # introspects the live OpenAPI schema
# Check balance
muapi account balance
# Wait for an existing job
muapi predict wait <request_id>
Commands
muapi auth
muapi account
muapi keys
muapi image
Models: flux-dev, flux-schnell, flux-kontext-dev/pro/max, hidream-fast/dev/full, wan2.1, reve, gpt4o, midjourney, seedream, qwen
muapi video
Models: veo3, veo3-fast, kling-master, kling-std, kling-pro, wan2.1/2.2, seedance-pro/lite, hunyuan, runway, pixverse, vidu, minimax-std/pro
muapi audio
muapi enhance
muapi edit
muapi run — generic, schema-driven runner
Reaches any model in the muapi.ai catalog by endpoint name, even ones not covered by the curated image / video / audio / enhance / edit verbs. The input schema is fetched from the live OpenAPI spec, so muapi run <model> -h always reflects the real, current parameters.
<model> accepts either a real endpoint slug (flux-dev-image, nano-banana-2, seedance-2-text-to-video) or a short alias from the curated tables (flux-dev, seedream, kling-master).
Merge order for inputs (later wins): --input-file → -i k=v → -p prompt.
# Discover a model's real inputs
muapi run nano-banana-2 -h
# Run it
muapi run nano-banana-2 -p "a logo for a coffee shop" -i num_images=2 --download ./out
# Pipe-safe JSON
muapi run flux-dev-image -p "..." --output-json --jq '.outputs[0]'
muapi predict
muapi upload
muapi models
muapi config
Useful keys: output (json/human), model.image, model.video, no_color (true/false)
muapi docs
muapi mcp
Global Options
Environment Variables
Exit Codes
MCP Server
muapi supports two MCP transport modes. Both expose the same 19 tools: image generate/edit, video generate/from-image, audio create/from-text, enhance (upscale/bg-remove/face-swap/ghibli), edit lipsync/clipping, predict result, upload file, keys list/create/delete, account balance/topup.
Option 1 — Hosted (Recommended, no CLI required)
The hosted MCP server at https://api.muapi.ai/mcp uses the standard Streamable HTTP transport. Any MCP client can connect with just your API key — no CLI install needed.
Claude Code:
claude mcp add --transport http muapi \
https://api.muapi.ai/mcp \
--header "Authorization: Bearer YOUR_MUAPI_KEY"
Cursor — add to mcp.json (Cmd+Shift+P → Open MCP settings):
{
"mcpServers": {
"muapi": {
"url": "https://api.muapi.ai/mcp",
"headers": { "Authorization": "Bearer YOUR_MUAPI_KEY" }
}
}
}
Windsurf — open Settings → MCP:
{
"mcpServers": {
"muapi": {
"serverUrl": "https://api.muapi.ai/mcp",
"headers": { "Authorization": "Bearer YOUR_MUAPI_KEY" }
}
}
}
Option 2 — stdio via CLI (Claude Desktop)
Run the CLI as a local stdio MCP server. Requires the CLI to be installed.
muapi mcp serve
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"muapi": {
"command": "muapi",
"args": ["mcp", "serve"],
"env": { "MUAPI_API_KEY": "your-key-here" }
}
}
}
Any stdio-compatible client — use the command + args pattern above, substituting your client's config format.
For more details on the self-hosted MCP server see muapi-mcp-server.
Grok Build Plugin
This repository also ships a Grok Build plugin that connects Grok to Muapi's hosted MCP
server. Install the muapi plugin from the Grok Build marketplace, then set
MUAPI_API_KEY in the environment used by Grok Build:
export MUAPI_API_KEY="YOUR_MUAPI_KEY"
The plugin provides live model discovery plus image, video, audio, enhancement, editing, and
async-result tools. Generation and enhancement consume Muapi credits; account top-ups, key
management, and external publishing remain approval-gated by the plugin instructions.
For a direct project-local setup without waiting for marketplace review, add the hosted MCP
server to Grok Build with:
grok mcp add --transport http muapi \
https://api.muapi.ai/mcp \
--header "Authorization: Bearer ${MUAPI_API_KEY}"
Agentic Pipeline Examples
# Full onboarding without human intervention
muapi auth register --email agent@example.com --password "secret"
muapi auth verify --email agent@example.com --otp 123456
muapi auth login --email agent@example.com --password "secret"
muapi account balance --output-json
muapi account topup --amount 10 --output-json --no-open
# Submit async, capture request_id, poll when ready
REQUEST_ID=$(muapi video generate "a dog on a beach" \
--model kling-master --no-wait --output-json --jq '.request_id' | tr -d '"')
muapi predict wait "$REQUEST_ID" --download ./outputs
# Chain: upload → edit → download
URL=$(muapi upload file ./photo.jpg --output-json --jq '.url' | tr -d '"')
muapi image edit "make it look like a painting" --image "$URL" \
--model flux-kontext-pro --download ./outputs
# Rotate API keys programmatically
NEW_KEY=$(muapi keys create --name "ci-$(date +%Y%m%d)" --output-json --jq '.api_key' | tr -d '"')
OLD_ID=$(muapi keys list --output-json --jq '.[0].id')
muapi keys delete "$OLD_ID" --yes
# Discover available endpoints
muapi docs openapi --jq '.paths | keys[]'
Shell Completions
muapi --install-completion bash
muapi --install-completion zsh
muapi --install-completion fish