Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mulerouter.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

The CLI needs one piece of information to talk to MuleRouter: The base URL defaults to https://api.mulerouter.ai; you only need to set it when you are pointing at a self-hosted gateway or proxy.

Environment variables

The canonical way to configure the CLI. Drop these into your shell rc file (~/.zshrc, ~/.bashrc, …) or your CI secret store.
export MULEROUTER_API_KEY="sk-..."
VariableRequiredDescription
MULEROUTER_API_KEYYesAPI key for authentication
MULEROUTER_BASE_URLNoCustom API base URL — use this only for a private gateway or proxy

.env file

For project-scoped configuration, create a .env file in the directory you run the CLI from. The CLI loads MULEROUTER_* variables automatically and never overwrites variables already set in the process environment.
.env
MULEROUTER_API_KEY=sk-...
The file is read once per process. Quotes around values are stripped, lines starting with # are treated as comments, and any variable that does not begin with MULEROUTER_ is ignored.

Command-line overrides

Every command accepts ad-hoc overrides that take precedence over both the environment and the .env file. Useful when juggling multiple accounts:
mulerouter run alibaba/wan2.6-t2v \
  --api-key "sk-test..." \
  --prompt "A drone shot above a canyon"
FlagEquivalent variable
--api-key <key>MULEROUTER_API_KEY
--base-url <url>MULEROUTER_BASE_URL

Resolution order

The configuration loader resolves values in this order, stopping at the first hit:
  1. CLI flags (--api-key, --base-url)
  2. Process environment variables (MULEROUTER_*)
  3. .env file in the current working directory

Inspect the active configuration

Run mulerouter config at any time to see what the CLI thinks it is configured with. The API key is masked.
$ mulerouter config
Current Configuration:
  API Key:    sk-1..fd
  Base URL:   https://api.mulerouter.ai
  Timeout:    120000ms
  Max Retries: 3
If no key is found you will see a “No configuration found.” notice followed by the same setup help as the table above.

Troubleshooting

API key not found. Set MULEROUTER_API_KEY in the environment, write it to .env, or pass --api-key. A .env value isn’t taking effect. Existing environment variables are never overwritten — export wins over .env. Check printenv | grep MULEROUTER.