Skip to content
Image RunAPI Developer Docs
Developer Resources
Developer Resources

CLI

Install and use every RunAPI CLI command for model actions, Tasks, files, account information, pricing, callbacks, and Harness.

The RunAPI CLI is a JSON-first terminal client for model actions and account tooling. It writes result data to standard output and operational progress to standard error, so it works equally well at a terminal, in shell scripts, CI jobs, and Harness.

Install

Install the current release on Linux or macOS:

SHELL
curl -fsSL https://runapi.ai/cli/install.sh | sh

Homebrew and Go source installations are also available:

SHELL
brew install runapi-ai/tap/runapi
go install github.com/runapi-ai/cli/cmd/runapi@latest

On Windows, download the matching windows-amd64 or windows-arm64 archive from the latest CLI release, extract runapi.exe, and add it to PATH.

Pin the installer to a version or an installation directory when a deployment requires a reproducible binary:

SHELL
curl -fsSL https://runapi.ai/cli/install.sh | sh -s -- --version v0.1.0
curl -fsSL https://runapi.ai/cli/install.sh | sh -s -- --dir "$HOME/.local/bin"

The installer also accepts RUNAPI_VERSION, RUNAPI_INSTALL_DIR, RUNAPI_INSTALL_BASE, RUNAPI_DOWNLOAD_BASE, and RUNAPI_SKIP_LIBC_CHECK=1.

Quick start

On a workstation, sign in in the browser and confirm the credential source:

SHELL
runapi login
runapi auth status

Run a model action with an inline JSON input or a JSON file:

SHELL
runapi nano-banana text-to-image --input '{"prompt":"a hummingbird drinking espresso","aspect_ratio":"1:1"}'
runapi nano-banana text-to-image --input-file request.json

Most model actions are asynchronous. They wait for a terminal result by default; add --async to return the Task immediately and use wait later:

SHELL
TASK_ID=$(runapi suno text-to-music --async --input '{"model":"suno-v5","vocal_mode":"instrumental","style":"minimal piano","title":"Short Piano Theme"}' | jq -r '.id')
runapi wait "$TASK_ID" --service suno --action text-to-music

Command conventions

Every command emits JSON on standard output unless an option explicitly requests a scalar value, such as files create --url-only or listen --print-secret. Progress and diagnostic messages stay on standard error, so JSON can safely flow to jq:

SHELL
runapi nano-banana text-to-image --input-file request.json \
  | jq -r '.images[].url' \
  | xargs -I{} curl -OL {}

Model actions accept exactly one request input source:

  • --input '<json object>' supplies inline JSON.
  • --input-file path/to/request.json loads JSON from a file.
  • --input-file - reads JSON from standard input.

Use runapi <service> <action> --help before constructing a request. The installed CLI lists the action’s current fields, accepted model identifiers, and validation constraints.

These global options apply to every command:

Option Purpose --api-key Use an API key for this invocation. It overrides RUNAPI_API_KEY. --base-url Use a different API origin for this invocation. --timeout Set the overall command timeout and the maximum Task wait. The default is 15 minutes. --poll-interval Set the interval for Task polling. The default is 3 seconds. --async Return immediately after submitting an asynchronous model action. --quiet Suppress progress on standard error without changing JSON output.

Model actions

The model command shape is runapi <service> <action>. Synchronous actions return their response immediately. For asynchronous actions, the default behavior is submit, poll, and return the terminal Task result; --async returns the creation response instead.

For top-level media URL fields, a readable local file path is uploaded before the model action runs. Existing http:// and https:// URLs are sent unchanged. Use files create when you need a reusable temporary URL, when the source is a remote URL, or when the source is Base64 data.

Audio and music actions

  • suno: add-instrumental, add-vocals, blend-lyrics, boost-style, check-voice, convert-audio, cover-audio, create-mashup, extend-music, generate-artwork, generate-lyrics, generate-midi, generate-persona, generate-voice, get-timestamped-lyrics, regenerate-validation-phrase, replace-section, separate-audio-stems, text-to-music, text-to-sound, visualize-music, voice-to-validation-phrase
  • producer: text-to-music
  • gemini-omni: create-audio, create-character, text-to-video
  • openai-tts: text-to-speech
  • fish-audio: text-to-speech
  • gemini-tts: text-to-speech
  • elevenlabs: isolate-audio, speech-to-text, text-to-dialogue, text-to-sound, text-to-speech

Image actions

  • nano-banana: edit-image, text-to-image
  • imagen-4: remix-image, text-to-image
  • seedream: edit-image, text-to-image
  • flux: remix-image, text-to-image
  • flux-2: remix-image, text-to-image
  • flux-kontext: text-to-image
  • qwen-2: edit-image, text-to-image
  • qwen-image: edit-image, remix-image, text-to-image
  • recraft: remove-background, upscale-image
  • z-image: text-to-image
  • ideogram-v3: edit-image, reframe-image, remix-image, text-to-image
  • gpt-image: edit-image, text-to-image
  • gpt-image-2: edit-image, text-to-image
  • gpt-4o-image: text-to-image
  • midjourney: edit-image, get-seed, image-to-prompt, shorten-prompt, text-to-image

Video and animation actions

  • veo-3-1: extend-video, text-to-video, upscale-video
  • seedance: text-to-video
  • runway: extend-video, text-to-video
  • runway-aleph: edit-video
  • kling: avatar, extend-video, image-to-video, motion-control, text-to-video
  • infinitetalk: audio-to-video
  • omnihuman: audio-to-video, human-identification, subject-detection
  • wan: animate, edit-video, image-to-video, speech-to-video, text-to-image, text-to-video
  • luma: modify-video
  • hailuo: image-to-video, text-to-video
  • volcengine-lip-sync: lip-sync-video
  • happyhorse: edit-video, image-to-video, text-to-video
  • grok-imagine: edit-image, extend, image-to-video, text-to-image, text-to-video, upscale-image
  • topaz: upscale-image, upscale-video
  • midjourney: extend-video, image-to-video

The list above is the complete action inventory in this CLI release. Each action’s exact request and response contract is available in the API Reference, and its local command help is the source for version-specific fields.

Task lifecycle

Use get to inspect the current state of an asynchronous Task without waiting. Use wait to poll until it completes, fails, or reaches the command timeout. Both commands require the original service and action so the CLI can select the correct Task result shape.

SHELL
runapi get "$TASK_ID" --service suno --action text-to-music
runapi wait "$TASK_ID" --service suno --action text-to-music --poll-interval 5s

Files

runapi files create uploads exactly one source and returns a temporary URL that expires after one hour. Its source can be a local path, a remote URL, or Base64 data.

SHELL
runapi files create ./reference.png --url-only
runapi files create --url https://example.test/reference.png --file-name reference.png
runapi files create --base64 "$(base64 < reference.png)" --file-name reference.png

The source choices are mutually exclusive. --url-only prints the URL alone; omit it to receive the full JSON response.

Account and pricing

Inspect the authenticated user and selected Account, then query balance and spend counters:

SHELL
runapi account info
runapi account balance

pricing list reads current Price Schedules. Filter by service, action, or model. pricing quote estimates the Task reservation for a required service and action; add --model when the action is model-specific and provide Pricing Inputs with --params or --params-file.

SHELL
runapi pricing list --service suno --action text-to-music --model suno-v4
runapi pricing quote --service suno --action text-to-music --model suno-v4 \
  --params '{"vocal_mode":"auto_lyrics","prompt":"A chill lo-fi beat"}'
runapi pricing quote --service suno --action text-to-music --params-file pricing-inputs.json

Pricing commands do not require credentials unless the quote refers to an Account-owned source Task.

Authentication and configuration

runapi login opens a browser authorization flow and saves the resulting credential. For servers and CI, auth import-token accepts an API key from standard input, verifies it by default, and saves it without exposing the value in the process list or shell history:

SHELL
printf '%s' "$RUNAPI_API_KEY" | runapi auth import-token --token -
runapi auth status
runapi logout

auth import-token --skip-verify supports offline image setup. Use it only when verification cannot run during setup; auth status verifies the active credential later.

API key precedence is --api-key, then RUNAPI_API_KEY, then the local CLI configuration file. Base URL precedence is --base-url, then RUNAPI_BASE_URL, then the saved base URL, then https://runapi.ai. The configuration file is ~/.config/runapi/config.json, or $XDG_CONFIG_HOME/runapi/config.json when XDG_CONFIG_HOME is set.

Local callback listener

runapi listen receives Task callbacks for one selected API key and optionally forwards each signed callback to a local HTTP endpoint. Browser login is required before using listener operations.

SHELL
runapi login
runapi api-keys list --json
runapi listen http://localhost:3000/webhooks/runapi --callback-api-key-id token_abc123

The positional URL and --forward-to are alternatives. The listener writes each signed callback body to standard output. A Task with callback_url continues to deliver to that URL and is also copied to the local listener.

After receiving a valid listener event, the CLI acknowledges it before attempting the local HTTP request. Each event is forwarded locally once: non-2xx responses and connection errors are reported in the terminal, but they do not make the listener replay the event. This local debugging behavior does not change delivery retries for a Task’s callback_url.

Each Account can run up to 100 active listeners per Callback Subscription Key and 1,000 active listeners in total. When a limit is reached, stop an idle listener or wait and try again. The API response identifies whether the selected key, your Account, or the overall service capacity is full.

An idle listener checks for new events about every 15 to 30 seconds. Events are normally found within about 15 seconds and are read immediately when available. If a limit is reached, stop an idle listener or wait and try again. Existing delivery and acknowledgement behavior is unchanged.

Key selection is, in order: --callback-api-key-id for one command, callback_api_key_id in the project .runapi.toml, then an interactive selector. The project configuration is saved at the Git root, or the current directory outside a Git repository, and contains only the stable ID:

TOML
callback_api_key_id = "token_abc123"

Print a selected key’s Listen Signing Secret without starting a listener, or rotate it after exposure:

SHELL
runapi listen --print-secret --callback-api-key-id token_abc123
runapi listen --rotate-secret --callback-api-key-id token_abc123

Rotation invalidates active listeners for that selected key. Update every local verifier with the newly printed secret before restarting its listener.

Harness

Install the portable RunAPI CLI skill into a supported Harness, inspect supported targets, or remove an installed skill:

SHELL
runapi agent install-skill --target codex
runapi agent list-targets
runapi agent uninstall-skill --target codex

Built-in targets are claude, codex, gemini, openclaw, and hermes. install-skill accepts --version to pin a skill release, --target-dir for a custom destination, --source for a source repository, and --force to overwrite an existing skill directory.

Shell completion and version

Generate completion scripts for Bash, Zsh, Fish, or PowerShell. For example, load Bash completion in the current shell:

SHELL
source <(runapi completion bash)
runapi completion zsh
runapi completion fish
runapi completion powershell
runapi version

Use runapi --help to list commands, runapi <command> --help for a command’s options, and runapi <service> <action> --help for a model action’s fields.

Exit codes

Commands exit with a non-zero code that scripts can handle:

Code Meaning 0 Success 2 Authentication failure or unsupported platform 3 Insufficient credits or a required local dependency is missing 4 Validation, not found, or manifest parsing error 5 Timeout, download failure, or checksum mismatch 6 Rate limited 7 Task failed

For request fields, Task status values, callback payloads, error bodies, and rate-limit handling, continue with the API Reference. Use SDKs when the same workflow belongs inside an application.