pollo-generate
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesepollo-generate
pollo-generate
pollo-cliinputpollo-cliinputSetup (once per session)
设置(每个会话只需执行一次)
- If isn't on
pollo, install the released binary — don't build from source:$PATHWithout Node (macOS / Linux only), fall back to the standalone installer:bashnpm i -g @pollo-ai/clibashcurl -fsSL https://raw.githubusercontent.com/polloaiofficial/cli/main/install.sh | sh - Run . An
pollo account statusnumber means you're already logged in to prod (availableCredits, profilepollo.ai). A missing/expired token error means:defaultThe CLI owns its own credential storage and refreshes the short-lived token before each request, so you won't need to log in again mid-session. Never read, print, or copy the stored credentials — every command below authenticates on its own.bashpollo auth login # opens the browser, logs into pollo.ai -> profile "default" - Stay on the profile unless the user names another one. Profiles let one machine hold several logins;
defaultshows them (pollo profile listmarks current),*switches, andpollo profile use <name>overrides for a single command.pollo --profile <name> <command>
- 如果 中没有
$PATH,请安装已发布的二进制文件——不要从源码构建:pollo如果没有 Node(仅限 macOS / Linux),请改用独立安装程序:bashnpm i -g @pollo-ai/clibashcurl -fsSL https://raw.githubusercontent.com/polloaiofficial/cli/main/install.sh | sh - 运行 。如果返回
pollo account status数值,说明你已经登录生产环境(availableCredits,配置文件为pollo.ai)。如果出现 token 缺失或过期错误,请执行:defaultCLI 会自行管理凭据存储,并在每次请求前刷新短期 token,因此会话中无需再次登录。绝不读取、打印或复制已存储的凭据——以下每条命令都会自行完成身份验证。bashpollo auth login # 打开浏览器,登录 pollo.ai -> 配置文件 "default" - 除非用户指定了其他配置文件,否则始终使用 。配置文件允许同一台设备保存多个登录身份;
default可列出这些配置文件(pollo profile list标记当前配置),*用于切换配置,pollo profile use <name>则可仅为单条命令临时覆盖配置。pollo --profile <name> <command>
Step 1 — Find the model, then read what it actually accepts
第 1 步——查找模型,然后查看它实际接受哪些输入
Never guess a / or a field name — they change as models ship, so
a guess just surfaces as a server validation error one step later instead of
saving you a lookup now:
brandaliasbash
pollo model list # every standard model, capabilities aggregated
pollo model list --type text2video # only models with that capability
pollo model get <brand>/<alias> --fields # this model's input shapeEach model is listed once, with a array. A capability is an
input mode — | | | |
— and each one carries its own (the output endpoint,
or ) plus its own /. So a model that
takes both text and images has several capabilities sharing one , and a
dual-output model like has capabilities across both paths.
capabilities[]text2videoimage2videoref2videotext2imageimage2imagepath/video/imagefieldsconstraintspathkling-v3-omni--typemodel listget--typegenerate createcostvideoimagemodel get --fields--json- —
fields[].{name, type, description, values?, min?, max?}is the enum choices;values/minbound a numeric field.max - —
constraints[], a boolean rule over the eventual{id, message, expr}(e.g. a field that's only valid in a certain mode). If your plannedinputwould fail one,inputtells you what to change before you submit instead of finding out from a 400.message
The input mode is a capability, but it is not a separate endpoint — at
request time it's decided by which fields you put in : only →
text-driven, → image-driven, → reference-driven. So "does this
model support references?" = "does it have a capability whose
include ?" — check that, don't guess. If a model exposes both a
and an path, pick the one matching the user's intent and
build only from that capability's .
inputpromptimagerefsref2videofieldsrefs/video/imageinputfieldsIf the user hasn't named a specific model, read
first — it maps
what the user actually said to a concrete (video branches for
on-screen text / single image / multi-reference / default, quality tiers, and
an image routing table), with the fallback chain to use when a generation
disappoints. Brands are not guessable (HappyHorse and Wan are , Sora
is , Grok is , Seedream is ), so route from that
file rather than from memory, and verify with before you commit.
references/model-routing.mdbrand/aliasalibaba/openai/xai/bytedance/model listOnce you know which video model you're using, write the field's
wording following that vendor's own formula in
—
Kling, Veo, Seedance, Sora, Vidu, Wan, and Pixverse each respond best to a
different prompt structure, and a Seedance-style prompt on Veo (or vice
versa) tends to underperform.
promptreferences/prompt-engineering.md绝不猜测 / 或字段名——它们会随着模型上线而变化;猜测只会把问题推迟到下一步,以服务端校验错误的形式出现,而不是现在省去一次查询:
brandaliasbash
pollo model list # 列出所有标准模型,并汇总其 capabilities
pollo model list --type text2video # 仅列出具有该 capability 的模型
pollo model get <brand>/<alias> --fields # 查看此模型的输入结构每个模型只列出一次,并带有一个 数组。一个 capability 表示一种输入模式—— | | | | ——每种模式都带有自己的 (输出端点,即 或 ),以及自己的 /。因此,一个同时接受文本和图像的模型会有多项 capability 共用一个 ;而像 这样的双输出模型,其 capability 会横跨两个 path。
capabilities[]text2videoimage2videoref2videotext2imageimage2imagepath/video/imagefieldsconstraintspathkling-v3-omnimodel listget--typegenerate createcost--typevideoimagemodel get --fields--json- ——
fields[]。{name, type, description, values?, min?, max?}是枚举选项;values/min用于限定数值字段的范围。max - ——
constraints[],表示针对最终{id, message, expr}的布尔规则(例如某个字段仅在特定模式下有效)。如果计划提交的input会违反某项规则,input会在提交前告诉你需要调整什么,而不是等到收到 400 错误后才发现。message
输入模式是一种 capability,但它不是单独的端点——请求时,它由你放入 的字段决定:仅使用 → 文本驱动,使用 → 图像驱动,使用 → 参考驱动。因此,“这个模型支持参考输入吗?”等同于“它是否具有一项 capability,且该 capability 的 包含 ?”——请检查,不要猜测。如果模型同时提供 和 path,请选择与用户意图相符的那个,并且只根据对应 capability 的 构建 。
inputpromptimagerefsref2videofieldsrefs/video/imagefieldsinput如果用户没有指定具体模型,请先阅读 ——它会将用户的实际需求映射到具体的 (包括画面文字、单张图像、多参考图和默认情况下的视频分支、质量等级,以及图像路由表),并提供生成效果不理想时使用的回退链。品牌无法凭记忆猜测(HappyHorse 和 Wan 属于 ,Sora 属于 ,Grok 属于 ,Seedream 属于 ),因此应根据该文件进行路由,而不是凭记忆选择,并在确定模型前使用 进行验证。
references/model-routing.mdbrand/aliasalibaba/openai/xai/bytedance/model list确定要使用的视频模型后,请按照对应厂商在 中给出的公式撰写 字段。Kling、Veo、Seedance、Sora、Vidu、Wan 和 Pixverse 分别对不同结构的 prompt 响应最佳,将 Seedance 风格的 prompt 用于 Veo(或反之)通常会导致效果下降。
references/prompt-engineering.mdpromptStep 2 — Prepare inputs
第 2 步——准备输入
Image/video fields (commonly , , or ) accept either a
local file path or an HTTPS URL — you don't upload anything yourself. When you
pass a local path, the CLI uploads it to Pollo storage as part of the generation
and substitutes the resulting URL before submitting; pass a hosted HTTPS URL and
it's used as-is. (base64 isn't accepted.) There is no separate upload command —
uploads only happen as a step inside /.
imageimagesrefsgenerate createcost图像/视频字段(通常为 、 或 )接受本地文件路径或 HTTPS URL——你无需自行上传任何内容。传入本地路径时,CLI 会在生成过程中将文件上传到 Pollo 存储,并在提交前替换为生成的 URL;传入托管的 HTTPS URL 时则原样使用。(不接受 base64。)没有单独的上传命令——上传仅作为 / 内部的一步发生。
imageimagesrefsgenerate createcostStep 3 — Submit and read the result
第 3 步——提交并读取结果
bash
undefinedbash
undefinedoptional: estimate before an expensive run, or whenever the user is cost-sensitive
可选:在费用较高的运行前估算,或在用户对成本敏感时使用
pollo generate cost <brand>/<alias> [--type video|image] --name value ...
pollo generate cost <brand>/<alias> [--type video|image] --name value ...
-> cost / singleCost / discountCost / discountSingleCost (+ their *Usd counterparts)
-> cost / singleCost / discountCost / discountSingleCost(以及相应的 *Usd 值)
pollo generate create <brand>/<alias> [--type video|image]
--name value ... --json # -> { "taskId": "...", "status": "waiting" }
--name value ... --json # -> { "taskId": "...", "status": "waiting" }
pollo generate wait <taskId> [--timeout 10m] [--interval 3s] --json
pollo generate create <brand>/<alias> [--type video|image]
--name value ... --json # -> { "taskId": "...", "status": "waiting" }
--name value ... --json # -> { "taskId": "...", "status": "waiting" }
pollo generate wait <taskId> [--timeout 10m] [--interval 3s] --json
-> { "taskId", "credit", "generations": [{ "status": "succeed|failed",
-> { "taskId", "credit", "generations": [{ "status": "succeed|failed",
"url", "mediaType", "failMsg" }] }
"url", "mediaType", "failMsg" }] }
Notes on the flags above:
- You usually don't need `--type`: the CLI resolves the endpoint from
`/v1/models` on its own. Pass `--type video|image` only when the model
has both output types (the CLI errors and tells you so), or to skip the
extra lookup when you already know.
- Every other `--name value` becomes `input.<name>`. Values auto-type:
`true`/`false` → boolean, numeric strings → number, everything else →
string. Repeat a flag to build an array (e.g. multiple `--images <url>`);
`refs` is always sent as an array even from a single `--refs <url>`.
- `--webhookUrl` is lifted to the request envelope's top level, not into
`input`.
- There is no `--wait` flag on `create` — an unknown flag would be sent as an
`input` field instead of erroring, so always go through `create` then
`wait` as two separate calls, and use `--json` on `create` so you can parse
`taskId` reliably.
- The deliverable lives in the `generations` array: each item carries the
output `url`, `mediaType`, and per-item `status`/`failMsg`. Parse it from
the `--json` output — without `--json`, `wait`/`get` print a human summary
of only the **first** generation, so multi-output results get truncated.
Hand the user the URL(s); everything before that (taskId, polling) is just
plumbing you don't need to narrate.
关于上述 flags 的说明:
- 通常不需要使用 `--type`:CLI 会自行从 `/v1/models` 解析端点。仅当模型同时支持两种输出类型时(CLI 会报错并给出提示),或者你已明确知道端点并希望跳过额外查询时,才传入 `--type video|image`。
- 其他每个 `--name value` 都会成为 `input.<name>`。值会自动进行类型转换:`true`/`false` → boolean,数字字符串 → number,其他所有值 → string。重复传入同一个 flag 可构建数组(例如多个 `--images <url>`);即使只传入一个 `--refs <url>`,`refs` 也始终以数组形式发送。
- `--webhookUrl` 会被提升到请求封装的顶层,而不是放入 `input`。
- `create` 没有 `--wait` flag——未知 flag 不会报错,而是会被当作 `input` 字段发送,因此始终应将 `create` 和 `wait` 作为两次独立调用,并在 `create` 时使用 `--json`,以便可靠地解析 `taskId`。
- 最终交付内容位于 `generations` 数组中:每个条目都包含输出 `url`、`mediaType` 以及各自的 `status`/`failMsg`。请从 `--json` 输出中解析它;如果不使用 `--json`,`wait`/`get` 只会以人类可读形式打印**第一个**生成结果,多输出结果会被截断。将 URL 提供给用户即可;在此之前的 taskId、轮询等都只是无需向用户叙述的内部流程。Credits & recharge
积分与充值
Credits are spent per generation. Gauge affordability up front by comparing
() with .
pollo account statusavailableCreditspollo generate cost …When the user is short on credits — either you can already see
is below the cost, or a fails with
— treat it as terminal: do not
switch models, retry, or loop. Tell the user how many more credits they need and
point them to the recharge page , where is the
environment you're logged into ( shows it, e.g.
). Always give the actual link, not just "please
recharge".
availableCreditsgenerate createinsufficient credits — recharge at <url><host>/pricing<host>pollo profile currenthttps://pollo.ai/pricing每次生成都会消耗积分。可将 ()与 的结果进行比较,以预先判断是否负担得起。
pollo account statusavailableCreditspollo generate cost …当用户积分不足时——无论是已经看到 低于费用,还是 返回 ——都应将其视为终止条件:不要切换模型、重试或循环操作。告诉用户还需要多少积分,并提供充值页面 的实际链接,其中 是当前登录环境的主机(可通过 查看,例如 )。始终提供实际链接,不要只说“请充值”。
availableCreditsgenerate createinsufficient credits — recharge at <url><host>/pricing<host>pollo profile currenthttps://pollo.ai/pricingWorked examples
实操示例
bash
pollo account status
pollo model list --type text2image
pollo model get google/nano-banana --fieldsbash
pollo account status
pollo model list --type text2image
pollo model get google/nano-banana --fieldsText-to-video
文生视频
pollo generate create bytedance/seedance-2-0-fast
--prompt "a red sports car drifting on a mountain road"
--aspectRatio 16:9 --duration 5 --json
--prompt "a red sports car drifting on a mountain road"
--aspectRatio 16:9 --duration 5 --json
pollo generate create bytedance/seedance-2-0-fast
--prompt "一辆红色跑车在山间公路上漂移"
--aspectRatio 16:9 --duration 5 --json
--prompt "一辆红色跑车在山间公路上漂移"
--aspectRatio 16:9 --duration 5 --json
Text-to-image (endpoint auto-resolved to /image for an image-only model)
文生图(对于仅支持图像的模型,端点会自动解析为 /image)
pollo generate create pollo-ai/pollo-image-v2
--prompt "a cozy cabin in a snowy forest, warm light" --aspectRatio 16:9 --json
--prompt "a cozy cabin in a snowy forest, warm light" --aspectRatio 16:9 --json
pollo generate create pollo-ai/pollo-image-v2
--prompt "雪林中的一间温馨小屋,暖色灯光" --aspectRatio 16:9 --json
--prompt "雪林中的一间温馨小屋,暖色灯光" --aspectRatio 16:9 --json
Image-to-image (image field = local path, uploaded automatically; or an HTTPS URL)
图生图(image 字段可以是本地路径并自动上传,也可以是 HTTPS URL)
pollo generate create google/nano-banana
--image ./photo.png --prompt "make it nighttime" --aspectRatio 1:1 --json
--image ./photo.png --prompt "make it nighttime" --aspectRatio 1:1 --json
pollo generate create google/nano-banana
--image ./photo.png --prompt "把它改成夜晚" --aspectRatio 1:1 --json
--image ./photo.png --prompt "把它改成夜晚" --aspectRatio 1:1 --json
Reference-to-video: refs on the video endpoint (repeat --refs for multiple).
参考图生视频:refs 位于视频端点上(多个参考图需重复传入 --refs)。
Only refs-capable models accept it — confirm refs
shows up in model get --fields.
refs只有支持 refs 的模型才能接受该参数——请确认 model get --fields 中显示了 refs。
pollo generate create vidu/viduq3
--refs ./character.png --prompt "the character walks into frame" --json
--refs ./character.png --prompt "the character walks into frame" --json
pollo generate create vidu/viduq3
--refs ./character.png --prompt "角色走进画面" --json
--refs ./character.png --prompt "角色走进画面" --json
Dual-output model (both /video and /image): pick with --type
双输出模型(同时支持 /video 和 /image):使用 --type 选择
pollo generate create kling-ai/kling-v3-omni --type image --prompt "..." --json
pollo generate cost pollo-ai/pollo-image-v2 --prompt "..." --aspectRatio 16:9
pollo generate wait <taskId>
pollo generate get <taskId> # one-shot status check, no polling
undefinedpollo generate create kling-ai/kling-v3-omni --type image --prompt "..." --json
pollo generate cost pollo-ai/pollo-image-v2 --prompt "..." --aspectRatio 16:9
pollo generate wait <taskId>
pollo generate get <taskId> # 单次状态检查,不进行轮询
undefinedWhen it fails
失败处理
- Insufficient credits (, or you can see
insufficient credits — recharge at …is below theavailableCredits) — terminal, not a model problem. Do NOT switch models or retry; give the user the recharge linkgenerate costand how many more credits are needed. See "Credits & recharge".<host>/pricing - — that model isn't exposed on this account/environment, even though
403 "This model is not enabled for API access."andmodel getmay still succeed for it. Go back to Step 1, pick a different model, retry.generate cost - Any other validation error from the server — re-run and check the offending field/value against the
pollo model get <brand>/<alias> --fields/fieldsyou got back; something inconstraintsdoesn't match what the model actually declared.input - Expired/invalid token — again. This is only needed once the long-lived refresh token itself has expired; the short-lived one refreshes automatically.
pollo auth login - Generation fails uploading a local image (403) — the upload step is gated to some accounts. Pass an existing HTTPS image URL for the image field instead of a local path.
/file/sign - returns the server's raw history shape (always JSON) — treat it as opaque history to skim, not a typed result to parse fields out of.
generate list
- 积分不足(,或你已看到
insufficient credits — recharge at …低于availableCredits)——这是终止条件,而不是模型问题。不要切换模型或重试;向用户提供充值链接generate cost,并说明还需要多少积分。参见“积分与充值”。<host>/pricing - ——该模型未对当前账户或环境开放,即使
403 "This model is not enabled for API access."和model get仍可能成功。返回第 1 步,选择其他模型后重试。generate cost - 服务端返回的任何其他校验错误——重新运行 ,并根据返回的
pollo model get <brand>/<alias> --fields/fields检查有问题的字段和值;constraints中的某些内容与模型实际声明的结构不一致。input - token 过期或无效——再次运行 。只有长期有效的 refresh token 本身过期时才需要这样做;短期 token 会自动刷新。
pollo auth login - 上传本地图像时生成失败(403)——上传步骤仅对部分账户开放。请改为为 image 字段传入已有的 HTTPS 图像 URL,不要使用本地路径。
/file/sign - 返回服务端的原始历史记录结构(始终为 JSON)——应将其视为只需快速浏览的不透明历史记录,不要从中解析特定字段。
generate list
Everything else
其他信息
pollo --helppollo <command> --help--profile--jsonpollo profile list|use|current|removecreatecost{ "input": { ...your --name value... }, "webhookUrl"? }/v1/generation/{brand}/{model}/{video|image}/estimatefieldsconstraintsmodel get --fieldsThe same capabilities are also exposed over MCP (, a local stdio
server) for non-terminal agent clients like Cursor or Claude Desktop — same
login and endpoints, tools (pass to
read a model's input fields) / /
/ / .
Image inputs there also take a local path (uploaded automatically) or an HTTPS
URL — there's no separate upload tool. As this skill drives the CLI directly you
won't call those here; see the README "Use as an MCP server" for client setup.
pollo mcp/v1pollo_list_modelsformat: 'fields'pollo_estimate_generation_costpollo_generate_imagepollo_generate_videopollo_get_generation_statuspollo --helppollo <command> --help--profile--jsonpollo profile list|use|current|removecreatecost{ "input": { ...your --name value... }, "webhookUrl"? }/v1/generation/{brand}/{model}/{video|image}/estimatefieldsconstraintsmodel get --fields这些能力也可通过 MCP 暴露( 是一个本地 stdio server),供 Cursor 或 Claude Desktop 等非终端型 Agent 客户端使用。它使用相同的登录方式和 端点,并提供以下工具:(传入 可读取模型的输入字段)、、、、。其中的图像输入同样接受本地路径(自动上传)或 HTTPS URL——没有单独的上传工具。由于本 skill 直接驱动 CLI,因此这里不会调用这些工具;客户端设置请参阅 README 中的“Use as an MCP server”一节。
pollo mcp/v1pollo_list_modelsformat: 'fields'pollo_estimate_generation_costpollo_generate_imagepollo_generate_videopollo_get_generation_status