Providers

Each provider is a plugin that connects img-cli to one AI service. Install the ones you use; the commands stay the same for all of them.

VibeToken

ImageVideoSpeech

Image, video, and speech models from many labs. Models and their parameters are read from the API. Billed in CNY.

API
https://vibetoken.cn
Install
img-cli provider add vibetoken

RouterBase

ImageVideoSpeech

VibeToken's international service: the same models with separate accounts, billed in USD.

API
https://routerbase.com
Extends
VibeToken
Install
img-cli provider add routerbase

LaoZhang API

ImageVideo

Gemini, GPT Image, and MiniMax H3 video in one account, mostly through built-in protocols.

API
https://api.laozhang.ai
Regional hosts
vip, alt
Install
img-cli provider add laozhang

Write your own provider

Any API can be added with one TOML file. No code, nothing to compile.

  1. Copy the requestPaste the request from the vendor's API docs into a template and replace the values with img-cli's fields.
  2. Point at the answerSay where the task id, status, and result files are in the response. Declare which flags each model accepts.
  3. Check and sharePreview the request with --dry-run, run one real generation, then push it to a GitHub repository as img-cli.toml. Anyone can install it with provider add owner/repo.
grsai.tomltoml
schema = 1
name = "grsai"
base_url = "https://grsaiapi.com"

[apis.generate]
submit = "POST /v1/api/generate"
poll = "GET /v1/api/result?id={{urlquery .RawID}}"
body = '''
{
  "model": {{json .Model}},
  "prompt": {{json .Prompt}},
  "aspectRatio": {{json .Aspect}},
  "imageSize": {{json .Size}},
}
'''

[apis.generate.result]
id = "id"
status = "status"
done = ["succeeded"]
failed = ["failed", "violation"]
outputs = "results[].url"

[[models]]
id = "nano-banana-2.1"
kind = "image"
api = "generate"
supports = { aspect = ["1:1", "16:9", "9:16"], size = ["1K", "2K", "4K"] }