# vibetoken-cli: the CLI for VibeToken > Generate images, video, 3D models, and speech with VibeToken from your terminal. Built for scripts and AI agents. # Installation ## macOS and Linux ```sh curl -fsSL https://vt-cli.lutaonan.com/install.sh | bash ``` This installs `vibetoken` into `~/.local/bin`. Run it again to upgrade. Optional environment variables: | Variable | Effect | | - | - | | `VIBETOKEN_VERSION` | Install a specific version, such as `v0.1.0` | | `VIBETOKEN_INSTALL_DIR` | Install into another directory | | `VIBETOKEN_DOWNLOAD_URL` | Download from a mirror | ## Windows In PowerShell: ```powershell irm https://vt-cli.lutaonan.com/install.ps1 | iex ``` It picks the build for your CPU (x64 or ARM), checks its SHA-256, installs it to `%LOCALAPPDATA%\Programs\vibetoken`, and adds that folder to your `PATH`. The same `VIBETOKEN_*` variables as above choose the version, folder, or mirror. You can also download the zip from [Releases](https://github.com/djyde/vibetoken-cli/releases) and put `vibetoken.exe` anywhere on your `PATH`. ## From source ```sh go install github.com/djyde/vibetoken-cli/cmd/vibetoken@latest ``` # Quickstart Go from a fresh install to your first generated image in about a minute. You need `vibetoken` [installed](https://vt-cli.lutaonan.com/docs/installation/) and a VibeToken account. ## 1. Log in Create an API key at , then save it: ```sh vibetoken auth login ``` Paste the key when asked. It is stored in your system keychain, so you only do this once. See [Authentication](https://vt-cli.lutaonan.com/docs/authentication/) for CI and other options. ## 2. Pick a model ```console $ vibetoken models list --modality image ID MODALITY PROVIDER PRICE (CNY) bytedance/seedream-4.0 image ByteDance 0.2000 / generation bytedance/seedream-5.0-flash image ByteDance 0.1200 / generation … ``` The `ID` column is what you pass to `-m`. ## 3. Generate ```console $ vibetoken image create -m bytedance/seedream-5.0-flash "a red apple on a white table" --dir ./out success 9s saved out/88f86396-34fa-4641-9b25-3905f452ec1a-0.jpg id: 88f86396-34fa-4641-9b25-3905f452ec1a status: success model: bytedance/seedream-5.0-flash cost: 0.084 https://vibetoken-media.oss-cn-beijing.aliyuncs.com/…/0.jpg -> out/88f86396-…-0.jpg ``` The command submits the task, waits for it to finish, and downloads the result into `./out`. ## Next steps - [Models and parameters](https://vt-cli.lutaonan.com/docs/models/): set size, aspect ratio, duration, and any other option a model accepts. - [Generating](https://vt-cli.lutaonan.com/docs/generating/): video, 3D, speech, and tasks that take minutes. - [AI agents and scripts](https://vt-cli.lutaonan.com/docs/ai-agents/): JSON output, exit codes, and safe retries. # Authentication Every command except `models` needs a VibeToken API key. Create one at ; keys start with `sk-rb-`. ## Save your key ```sh vibetoken auth login ``` Paste the key and press Enter. `vibetoken` checks it, then stores it in the system keychain: macOS Keychain, Windows Credential Manager, or Secret Service on Linux. On systems without a keychain, it is saved to a config file that only you can read. If `VIBETOKEN_API_KEY` is already set, press Enter without typing to save that key. | Option | Effect | | - | - | | `--storage` | `auto` (default: keychain, else file), `keyring`, or `file` | | `--no-verify` | Save the key without checking it | The key can also come from stdin, for example `pbpaste | vibetoken auth login`. ## Use a key without saving it In CI, containers, and agent sandboxes, set an environment variable instead: ```sh export VIBETOKEN_API_KEY=sk-rb-... ``` `vibetoken` uses the first key it finds, in this order: 1. `--api-key` flag 2. `VIBETOKEN_API_KEY` environment variable 3. System keychain 4. Config file ## Check or remove the key | Command | Does | | - | - | | `vibetoken auth status` | Show which key is in use, where it came from, and its spending and limit | | `vibetoken auth logout` | Remove the saved key from the keychain and config file | `auth status` exits with code 3 when no key is configured, so scripts can check for one before doing any work. # Models and parameters Each model accepts its own set of options. This page shows how to find a model, look up what it accepts, and pass those options. > Chat completion models are not supported yet. ## Find a model ```sh vibetoken models list --modality image ``` The `ID` column is what you pass to `-m`. | Option | Effect | | - | - | | `--modality` | Only `image`, `video`, `audio`, or `3d` models | | `--provider` | Only one provider, such as `ByteDance` or `Kuaishou` | | `--search` | Only models whose id, name, or alias contains every word | `vibetoken models popular` lists recommended models. ## See what a model accepts ```console $ vibetoken models schema bytedance/seedream-4.0 FIELD TYPE REQUIRED DEFAULT ALLOWED prompt text required max length 2000 aspect_ratio enum optional "auto" auto|1:1|4:3|3:4|16:9|9:16|3:2|2:3|21:9 n number optional 1 1..15; integer size enum optional "2K" 1K|2K|4K ``` `models get ` shows the model's catalog entry, and `models pricing ` shows its full price. ## Pass options Common options have their own flags on `create`. Everything else goes through `-P` or `--body`. | Option | Sets | Example | | - | - | - | | `--aspect-ratio` | `aspect_ratio` | `--aspect-ratio 16:9` | | `--resolution` | `resolution` (image, video) | `--resolution 1080p` | | `--duration` | `duration` in seconds (video) | `--duration 5` | | `-n` | `n`, the number of images | `-n 4` | | `--negative-prompt` | `negative_prompt` | `--negative-prompt "text, watermark"` | | `-P field=value` | Any field; repeatable | `-P size=4K -P seed=42` | | `--body` | A whole JSON body: inline, `@file`, or `-` for stdin | `--body @request.json` | When the same field is set more than once, the dedicated flag wins over `-P`, and `-P` wins over `--body`. `-P` values are read as JSON when they parse, so `n=2` is a number and `watermark=false` is a boolean. Dotted names build nested objects: `-P provider.options.minimax.emotion=happy`. ## Use an input image Image-to-image, image-to-video, and image-to-3D models take `--image`, with a URL or a local file. Repeat it for models that take several images: ```sh vibetoken image create -m bytedance/seedream-4.0-edit "make it watercolor" --image ./photo.jpg ``` # Generating Images, video, and 3D models all work the same way. `create` submits a task, waits for it, and prints the result. Speech returns an audio file directly. ## Images, video, and 3D ```sh vibetoken image create -m bytedance/seedream-5.0-flash "a red apple on a white table" --dir ./out vibetoken video create -m bytedance/seedance-2-t2v "a cat playing piano" --duration 5 --dir ./out vibetoken 3d create -m tripo/h3.1-text-to-3d "a ceramic teapot" --dir ./models ``` | Option | Effect | | - | - | | `-m`, `--model` | Model id (required); see [Models and parameters](https://vt-cli.lutaonan.com/docs/models/) | | `-p`, `--prompt` | The prompt; or pass it as the trailing arguments, as above | | `-i`, `--image` | Input image: URL or local file; repeatable | | `-d`, `--dir` | Download every result file into this directory, as `-` | | `--no-wait` | Return the task id right after submitting | | `--timeout` | How long to wait (default `20m`) | | `--poll-interval` | Time between status checks (default `3s` for images, `5s` for video and 3D) | | `--client-request-id` | Idempotency key; see [Retry without paying twice](https://vt-cli.lutaonan.com/docs/ai-agents/#retry-without-paying-twice) | | `--callback-url` | HTTPS URL that receives the result when the task finishes | Model options such as size, aspect ratio, and duration are covered in [Models and parameters](https://vt-cli.lutaonan.com/docs/models/#pass-options). Without `--dir`, only the result URLs are printed. They expire after 7 days, so download anything you want to keep. ## Long-running tasks Images take seconds; video and 3D can take several minutes. While `create` waits, you can stop waiting at any time without losing the task. | Command | Does | Options | | - | - | - | | `video create … --no-wait` | Submit, print the task id, and return | | | `video get ` | Show the status once | `--dir` downloads it if finished | | `video wait ` | Wait until it finishes | `--dir`, `--timeout`, `--poll-interval` | | `video find ` | Find a task by its `--client-request-id` | | Ctrl-C only stops waiting; the task keeps running, and is charged if it succeeds. The CLI prints the `wait` command to pick it up again. The same applies when `--timeout` (default 20 minutes) runs out. Replace `video` with `image` or `3d` for those tasks. ## Speech ```sh vibetoken audio speech -m minimax/speech-2.8-turbo --voice English_Trustworthy_Man "Hello, world!" ``` The audio is saved as `speech.mp3`. | Option | Effect | | - | - | | `-m`, `--model` | Speech model id (required), such as `minimax/speech-2.8-turbo` | | `--voice` | Voice id; see [MiniMax system voices](https://platform.minimaxi.com/docs/faq/system-voice-id) | | `-O`, `--out` | Output file (default `speech.`); `-` writes to stdout | | `-f`, `--format` | `mp3` (default), `wav`, `flac`, `pcm`, or `opus` | | `--speed` | Speaking speed, `0.5` to `2` (default `1`) | | `-P field=value` | Any other field, such as `-P provider.options.minimax.emotion=happy` | With no text arguments, the text is read from stdin: ```sh cat script.txt | vibetoken audio speech -m minimax/speech-2.8-hd --voice English_Trustworthy_Man -O narration.mp3 ``` # Costs and balance All amounts are in CNY. Failed generations are not charged. ## Before you generate ```sh vibetoken models list --modality video # price per generation, next to each model vibetoken models pricing # the full price of one model ``` To check a request without paying for it, add `--dry-run`. It prints the request instead of sending it. ## After you generate `create`, `get`, and `wait` print the cost of a finished task. To look one up later, including speech: ```sh vibetoken generation ``` ## Your balance | Command | Shows | | - | - | | `vibetoken billing balance` | Available credits, and any amount held for running tasks | | `vibetoken billing transactions` | Top-ups and charges | | `vibetoken auth status` | This key's spending and limit | `billing transactions` takes these options: | Option | Effect | | - | - | | `--source` | `all` (default), `topup`, `usage`, or `other` | | `--page` | Page number (default `1`) | | `--per-page` | Results per page (default `20`) | Insufficient balance fails with exit code 6. Top up at . # AI agents and scripts `vibetoken` is designed to be driven by programs. This page is the contract: what goes where, what the output looks like, and how to retry without paying twice. ## Give your agent the CLI Paste this into your agent's instructions, such as `AGENTS.md` or `CLAUDE.md`: ```markdown ## Generating media with vibetoken Use the `vibetoken` CLI to generate images, video, 3D models, and speech. - Always pass `--json -q`. Results are JSON on stdout; errors are JSON on stderr. - Find a model with `vibetoken models list --modality --json`, then read its options with `vibetoken models schema --json`. - Pass model options as `-P field=value`. Preview a paid request with `--dry-run`. - Generate a UUID and pass it as `--client-request-id` on every `create`. If the command fails with exit code 9 (network) or 5 (rate limited), rerun it with the same id; it is never charged twice. - For video and 3D, use `--no-wait`, then `vibetoken wait --json -q`. Exit code 8 means the task is still running: run `wait` again. - Add `--dir ` to download results; the JSON then lists local paths in `downloaded`. - Run `vibetoken commands --json` for every command and flag. ``` The full English docs are also available as one file at . ## Output | Stream | Without `--json` | With `--json` | | - | - | - | | stdout | Results as text | Results as one JSON value | | stderr | Progress and errors | Progress and `{"error": {...}}` | Add `-q` to silence progress. Set `VIBETOKEN_OUTPUT=json` to make JSON the default. A finished generation, with `--dir`: ```json { "id": "88f86396-34fa-4641-9b25-3905f452ec1a", "object": "image.generation", "status": "success", "model": "bytedance/seedream-5.0-flash", "data": [{ "url": "https://…/0.jpg", "output_format": "jpeg", "size": "1024x1024" }], "usage": { "cost": 0.084 }, "downloaded": ["out/88f86396-34fa-4641-9b25-3905f452ec1a-0.jpg"] } ``` `status` is `pending`, `success`, or `failed`. `downloaded` appears only when files were saved. An error: ```json {"error": {"exit_code": 4, "status": 404, "message": "HTTP 404: Generation not found (request_id …)", "request_id": "…"}} ``` `status` and `request_id` are present when the API returned the error. ## Exit codes | Code | Meaning | What to do | | - | - | - | | 0 | Success | | | 1 | Other error | Read the message | | 2 | Invalid arguments or parameters | Fix the command; check `models schema` | | 3 | Missing or invalid API key | See [Authentication](https://vt-cli.lutaonan.com/docs/authentication/) | | 4 | Not found | Check the id or model | | 5 | Rate limited | Wait, then retry with the same `--client-request-id` | | 6 | Insufficient balance or credit limit | Top up; retrying won't help | | 7 | Generation failed | Not charged; change the prompt or options | | 8 | Timed out waiting | The task is still running; run `wait ` | | 9 | Network error | Retry with the same `--client-request-id` | | 130 | Interrupted | The task is still running; run `wait ` | ## Retry without paying twice Every `create` and `audio speech` sends an idempotency key. Reusing the key returns the original task instead of starting a new one, so a retry is never charged twice. Choose the key yourself so you still have it if the connection drops before you get a task id: ```sh key=$(uuidgen) vibetoken video create -m bytedance/seedance-2-t2v "a cat" --client-request-id "$key" --no-wait --json -q ``` To recover the task later: ```sh vibetoken video find "$key" --json ``` If `find` exits with code 4, the request never arrived; run `create` again with the same key. ## Discover commands ```sh vibetoken commands --json # every command, flag, and example vibetoken models schema --json # the options a model accepts vibetoken --help # one command, as text ``` For an endpoint without a dedicated command, `vibetoken api ` sends an authenticated request and prints the response. # Reference Options and settings that apply to every command. For one command's own flags, run `vibetoken --help`. ## Commands | Command | Does | | - | - | | `image`, `video`, `3d` | `create`, `get`, `wait`, and `find` generations | | `audio speech` | Turn text into an audio file | | `generation ` | Show what a generation cost | | `models` | `list`, `get`, `schema`, `pricing`, and `popular` | | `billing` | `balance` and `transactions` | | `auth` | `login`, `logout`, and `status` | | `config` | `list`, `get`, `set`, `unset`, and `path` | | `api ` | Send a raw request to any endpoint | | `commands` | List every command and flag | | `completion ` | Print a shell completion script | | `version` | Print the version | ## Global options | Option | Effect | | - | - | | `--json` | Print JSON; same as `-o json` | | `-q`, `--quiet` | Hide progress on stderr | | `--dry-run` | Print the request instead of sending it | | `--api-key` | Use this API key | | `-v`, `--verbose` | Log HTTP requests to stderr | | `--max-retries` | Retries for rate limits and transient errors (default 3) | | `--http-timeout` | Timeout for one HTTP request (default 10m) | | `--base-url` | API origin (default `https://vibetoken.cn`) | ## Settings Each setting can come from a flag, an environment variable, or the config file, in that order of precedence. | Setting | Flag | Environment variable | Config key | | - | - | - | - | | API key | `--api-key` | `VIBETOKEN_API_KEY` | (use `auth login`) | | Output format | `-o`, `--json` | `VIBETOKEN_OUTPUT` | `output` | | API origin | `--base-url` | `VIBETOKEN_BASE_URL` | `base_url` | ```sh vibetoken config set output json # print JSON by default vibetoken config list # every setting and where its value comes from vibetoken config path # where the config file is ``` `VIBETOKEN_CONFIG_DIR` moves the config directory. ## Shell completion ```sh vibetoken completion zsh > "${fpath[1]}/_vibetoken" # zsh vibetoken completion bash > /etc/bash_completion.d/vibetoken vibetoken completion fish > ~/.config/fish/completions/vibetoken.fish ``` ## Exit codes See [AI agents and scripts](https://vt-cli.lutaonan.com/docs/ai-agents/#exit-codes).