powertokens-video
Provides access to ByteDance's Seedance video generation models (versions 1.0, 1.5, 2.0, and 2.5, including Mini/Fast variants) through the PowerTokens API. Supports text-to-video using media-text prompts, image-to-video with asset:// first-frame/last-frame inputs, reference video/audio inputs, and configurable duration, resolution, aspect ratio, seed, and audio generation.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
powertokens-kit
📘 This document is in English. 中文文档
📦 This repository contains three capabilities
This page (
pt_video.py+mcp_server.py): the image / video / Seedance generation engine and MCP integration.
pt-gateway/(production-grade unified gateway): builds on the engine to add audio (TTS) and chat (multimodal / web-search / thinking-mode capability labeling), with both HTTP and MCP interfaces, a capability catalog, and a three-tier test suite.
node/(zero-dependency Node core): a decision layer for agents — 5 rule APIs + 7 read-only account APIs (including cost estimation). It never sends generation requests. Seenode/README.md.👉 chat / audio / gateway docs are NOT on this page — see
pt-gateway/README.md(chat model capability labeling in §9.1, 38 models labeled one-by-one for vision / audio_in / video_in / web_search / thinking).👉 Node core usage & interface list:
node/README.md(quick start in Chinese) · full capability list.
Table of Contents
Related MCP server: MiniMax MCP JS
1. What is this
powertokens-kit is a cross-agent PowerTokens toolkit: it wraps PowerTokens's image / video / Seedance / audio / chat model capabilities into "one engine + two integration shells", plus a production-grade unified gateway:
Engine
pt_video.py: pure Python standard library, zero external dependencies, talks directly to the official REST API, no Node, nopowertokens-cli.Shell A · Agent Skills (
SKILL.md): conforms to the open standard and is read directly by 40+ supporting agents (Claude Code, Cursor, GitHub Copilot, Codex, Trae, Zed, Kiro, Junie, Roo Code …).Shell B · MCP server (
mcp_server.py): called as a "tool" by any MCP client (Claude Desktop, Cursor, Trae, VS Code, Windsurf, Cline, Zed …).Gateway
pt-gateway/: a unified HTTP + MCP entry point that adds audio (TTS) and chat (with multimodal / web-search / thinking-mode capability labeling) on top of the engine, plus a capability catalog and three-tier tests. Docs:pt-gateway/README.md.Node core
node/: a zero-dependency, request-free decision layer for agents — 5 rule APIs (loadCatalog/selectCandidates/classifyError/retryDecision/reasoningParams) + 7 read-only account APIs (including cost estimation). It reads the samecatalog.jsonbut never sends generation requests. Docs:node/README.md.
The three shells above share the same engine; all generation logic is maintained in one place (single source of truth). The
node/core is a separate read-only decision layer, not a fourth generation shell.
Official REST, no middle layer:
Type | Submit endpoint | Mechanism |
Video ( |
| Async: poll |
Image ( |
| Sync: returns |
The default model is auto (auto-picks from the models actually available on your account, separate pools for video/image/seedance); you can also specify any model explicitly and query each model's pricing and supported parameters.
2. Why build this
Cross-agent, universal: avoid re-writing the calling code every time you switch agents (Claude / Cursor / Trae …). This repo ships both the Agent Skills standard and the MCP standard, covering the vast majority of agent clients on the market.
Open source, zero dependencies: only the Python standard library. Anyone can
git cloneand runpython pt_video.py— no Node, no powertokens CLI to install.Official API direct: no third-party relay/gateway; behavior is predictable and auditable, and problems can be debugged directly against the official endpoints.
Pitfalls documented: Seedance agreement signing, the
asset://asset format, the media-text submission style for text-to-video, cross-account asset sharing, etc. — all tested in practice and written intodocs/pitfall-archive.mdand this document.
3. Quick Start (CLI)
git clone https://github.com/tjj1234/powertokens-kit.git
cd powertokens-kit
export POWERTOKENS_API_KEY="sk-pt-xxxx" # recommended via env var (see §8)
python pt_video.py check # Key health check
python pt_video.py models -t all --json # list models + pricing + params
# Video (default auto, picks from account-available models)
python pt_video.py generate -p "a cat dancing on the Mongolian grassland" -d 5 -r 720p
python pt_video.py generate -m kling-v2-1-master -p "a cat dancing" -d 5 -r 1080p
# Image (add --type image)
python pt_video.py generate -p "cyberpunk city night" --type image --aspect-ratio 16:9
python pt_video.py generate -m seedream-5-0-260128 -p "cyberpunk city" --type image --aspect-ratio 16:9
python pt_video.py estimate -m seedance-1-5-pro-251215 -d 5 -r 720p # estimate cost only (no charge)
# Seedance family (1.0/1.5/2.0/2.5 all work; standalone type: --type seedance; sign agreement first, see §10)
python pt_video.py models -t seedance --json
python pt_video.py generate --type seedance -m seedance-1-5-pro-251215 -p "a cat walking on grass" -d 5 -r 720p --no-download # text-to-video: just -p
python pt_video.py upload -f ./first_frame.png # upload asset, get asset://<id> (free)
python pt_video.py generate --type seedance -m seedance-1-5-pro-251215 -p "camera push-in" --first-frame asset://<id> --no-download # image-to-video
python pt_video.py seedance enable # after signing, mark it so the onboarding prompt stops
# Read-only account / billing queries (no generation, no credit deduction)
python pt_video.py balance # account balance (by Key)
python pt_video.py usage --start-date 2026-01-01 --end-date 2026-01-31 # billing summary by model type
python pt_video.py logs # consumption records
python pt_video.py agreement # asset-library agreement statusHow it works:
Video
generateenters async polling after submission — checks status every 10s until success, then downloads toout/<task_id>.mp4by default and prints the link. Real render time is usually 1–3 minutes.Image
generate --type imagereturnsdata[].urlsynchronously (usually a few seconds) and downloads toout/<model>_<n>.pngby default.
4. Capability Overview: image / video / seedance
This project splits generation into three parallel types (a deliberate design, tested in practice — see §10):
Type |
| Description | Agreement prerequisite | Asset format | Generation mechanism |
|
| text-to-image | none | — | sync ( |
|
| ordinary video models (Kling / Wan / Hailuo / Vidu / HappyHorse) | none |
| async polling ( |
|
| Seedance family (ByteDance: 1.0/1.5/2.0/2.5, incl. Mini/Fast) | must sign the "Asset Library User Agreement" |
| async polling ( |
Key design point: Seedance is split into a standalone type rather than crammed into ordinary
video. Reason: it has three unique prerequisites (sign agreement / assets go through the asset libraryasset:/// text-to-video usesmedia-textinstead of the top-levelprompt), which are systematically different from ordinary video models. Theautocandidate for ordinaryvideoalready excludes Seedance;--type seedanceexplicitly routes to it.
5. Supported Models & Pricing
Prices are PT pre-deduction unit prices (USD, $), probed at
5s / 720p; duration and resolution are converted by coefficients (see §15). Image unit prices are not public via PT API, markedn/ain the table — refer to the dashboard. Actually available models depend onpython pt_video.py models -t all --jsonqueried under your account (different accounts have different quotas/whitelists).
Video models (--type video, auto candidates)
Model ID | 5s/720p price | Max duration | Resolution | Main inputs |
| $0.20 | 10s | 720p/1080p | text, image |
| $0.70 | 10s | 720p/1080p | text, image |
| $0.475 | 10s | 720p/1080p | text, image |
| $0.42 | 10s | 720p/1080p | text, image, audio |
| $0.42 | 10s | 720p/1080p | text, image |
| $1.40 | 10s | 720p/1080p | text, image, audio (camera motion) |
Seedance models (--type seedance, 7 tested, all available)
Model ID | 5s/720p price | Max duration | Resolution | Main inputs |
| $0.247 | 10s | 720p/1080p | text, image(first-frame), start-end, video+audio ref |
| $0.605 | 10s | 720p/1080p | same as above |
| $0.756 | 10s | 720p/1080p | same as above |
| n/a | 10s | 720p/1080p | same as above |
| n/a | 10s | 720p/1080p | same as above |
| n/a | 10s | 720p/1080p | same as above |
| n/a | 10s | 720p/1080p | same as above |
Image models (--type image, auto candidates)
Model ID | Price | Aspect ratio | Input |
| n/a | 1:1/16:9/4:3/3:2/2:3/3:4/9:16/21:9 | text |
| n/a | same as above | text |
6. Prerequisites
Python 3.9+ (standard library only; only the MCP server needs the optional
mcppackage).PowerTokens API Key: open https://powertokens.ai/zh-Hans/dashboard → register/log in → top up → create Key (looks like
sk-pt-xxxx).(Seedance only): before using
--type seedance, you must manually sign the "Asset Library User Agreement" on the dashboard (https://powertokens.ai/assets-library?tab=1). There is no API endpoint to sign it programmatically — it must be done in the web UI.
7. Installation
Method 1: Use directly (recommended, zero install)
git clone https://github.com/tjj1234/powertokens-kit.git
cd powertokens-kit
python pt_video.py checkThe engine uses only the standard library; python pt_video.py <subcommand> works with no pip install.
Method 2: Install as an MCP server (optional)
Only needed if you want "Integration B (MCP)" — install the mcp dependency:
pip install -e ".[mcp]" # or pip install "mcp[cli]>=1.2"
python mcp_server.py # stdio; the agent client launches it automatically8. Configure API Key
Three configuration methods, highest to lowest priority:
Environment variable
POWERTOKENS_API_KEY(recommended, works across any agent)export POWERTOKENS_API_KEY="sk-pt-xxxx"Local config file (permissions 0600, recommended on shared machines)
python pt_video.py config --set-key "sk-pt-xxxx" # saved to ~/.config/powertokens-kit/config.json (user-level, not in the repo) # old path ~/.config/powertokens-video/config.json is still auto-fallback-read (rename compatibility)Repo-level config (optional): the
PT_VIDEO_CONFIGenv var can override the config file path.
⚠️ Keys are sensitive credentials: do not write them into any file that will be committed.
.gitignorealready ignoresconfig.jsonand.env.
9. Command Reference (full parameters)
All commands: python pt_video.py <subcommand> [args].
Subcommand | Purpose | Notes |
| Key health check | exit 0=ready, 2=missing Key |
| Save generation API Key ( | — |
| Save account-domain personal access token | for |
| Save numeric | required by |
| Save default model | default |
| View config (tokens masked to last 4) | — |
| Print the auto-preferred model (no generation) | — |
| List models + pricing + supported params | public catalog visible without Key |
| Estimate cost only (USD) | no charge; T03: catalog price with |
| Generate (video polling / image sync) | core command |
| Upload asset to library, get | free |
| Manage Seedance agreement local flag | see §10 |
| Query account balance (by Key) |
|
| Query billing summary by model type |
|
| Query consumption records |
|
| Query asset-library agreement status |
|
All four
balance/usage/logs/agreementcommands are read-only — they never generate or deduct credits. Auth uses a barept_live_personal access token (Authorization: <token>, noBearer) against thepowertokens.ai/apihost — NOT the generation API Key.balance/usagealso need a numerickey_id. SetPT_ACCESS_TOKEN+PT_KEY_ID(orconfig --set-access-token/--set-key-id); the old-k/POWERTOKENS_API_KEYstill works as a bare-key fallback for backward compatibility. See §16.
generate full parameters
General:
-p/--prompt(required, text-to/image-to prompt)-m/--model(defaultauto; or a specific model ID)--type(inferred from model ID by default; explicitvideo/image/seedance)-o/--output(output path; defaults toout/)--no-download(return link only, don't download)--timeout(total polling timeout in seconds, default 600)
Video (video / seedance):
-d/--duration(2–30s, default 5)-r/--resolution(480P/720P/1080P, default 720P)--ratio(e.g.16:9/9:16/adaptive)--seed(integer, reproducible)--first-frame/--last-frame(first/last frame,asset://orhttp(s))--ref-image/--ref-video/--ref-audio(reference assets, repeatable)--no-audio(disable generated audio)--no-prompt-extend(disable prompt extension)--watermark(enable watermark)
Image (image):
--aspect-ratio(1:1/16:9/4:3/3:2/2:3/3:4/9:16/21:9, default1:1)--n(1–9 images, default 1)--response-format(url/base64, defaulturl)
upload parameters
-f/--file(image path, required; asset library requires width 300–6000px)--group-name(asset group name, optional; must not duplicate an existing group name)
Read-only account / billing commands
balance [-k <key>]— prints the rawGET /v1/billing/balanceJSON (balance, currencycredits, data-as-of, cached flag, key_id).usage [--start-date YYYY-MM-DD] [--end-date YYYY-MM-DD] [-k <key>]— prints the rawGET /v1/billing/usageJSON, optionally filtered by date range (per-modeltotal_costitems + grand total).logs [-k <key>]— prints the rawGET /v1/logs/queryJSON (consume_id, request_id, task_id, endpoint, model, status, quota, usage, billing, …).agreement [-k <key>]— prints the rawGET /v1/asset/agreement/statusJSON (account_id, agreement_accepted, asset_library_enabled).
If -k/--key is omitted, the command reads POWERTOKENS_API_KEY from the environment (same precedence as generation). On a 401 it exits 2; any other API error exits 1.
10. Seedance Deep Dive (standalone type)
10.1 Why a standalone type
The entire Seedance family (ByteDance, 1.0 / 1.5 / 2.0 / 2.5 and Mini/Fast variants) has three prerequisites that are systematically different from other video models:
Must sign the "Asset Library User Agreement" (manual in the dashboard, no API);
Image-to-video assets must go through the asset library, passed as
asset://<ASSET_ID>;Text-to-video prompt must be placed in
media:[{type:text, text:...}]— the server does not recognize a top-levelpromptfield.
So it is promoted to a standalone type --type seedance rather than patched inside video. The auto candidate for ordinary video already excludes it.
10.2 Agreement signing flow (local flag + error fallback)
PT has no API endpoint to "query whether the agreement is signed", so the skill approximates with a local flag + error fallback:
When unflagged, before generation it prints a 4-step "jump to PT onboarding" guide (does not block submission);
After you sign, run
python pt_video.py seedance enableto flag as signed, and the guide stops showing;If submission is still rejected by the server as "unsigned" (keyword hit), the skill auto-
resets the flag and shows the guide again;On first successful generation it auto-marks as signed.
seedance status now also does a best-effort server-side check: if POWERTOKENS_API_KEY is set, it calls GET /v1/asset/agreement/status and reports agreement_accepted_server / asset_library_enabled_server alongside the local flag. If the key is not set, it skips the server check.
python pt_video.py seedance status # view current flag (+ best-effort server check)
python pt_video.py seedance enable # flag after signing
python pt_video.py seedance disable # clear the flag10.3 Text-to-video vs image-to-video (clarified by testing)
Text-to-video needs only
-p, no media at all: on submission the engine auto-places the prompt intomedia:[{type:text}].Image-to-video (first frame / reference image) needs assets, and the asset must be uploaded via the asset library and passed as
asset://<ASSET_ID>.
⚠️ Correction of an old belief: some network/early docs claimed "BytePlus-family text-to-video must carry media" — that was a misjudgment. It was triggered by using a fake
asset://placeholder (BytePlus video models only accept media); tested with a real Key, plain-prompt text-to-video proceeds normally to the charge check (returnspre-consume quota failedwhen balance is insufficient).
10.4 Asset upload loop (upload, free)
Image-to-video must use asset:// assets. Get them in two steps:
# 1) upload a local image (asset library requires width 300–6000px), free, returns asset://<id>
python pt_video.py upload -f ./first_frame.png
# 2) use the asset id as first frame
python pt_video.py generate --type seedance -m seedance-1-5-pro-251215 -p "slow camera push-in" --first-frame asset://<id>Under the Seedance type, media like
--first-frameonly acceptsasset://; passing a publichttp(s)URL is rejected at pre-validation (to avoid bypassing the agreement).
11. Cross-account asset sharing & security notes
Tested conclusion (2026-10-27, real dual accounts): PowerTokens asset:// asset ids are cross-account resolvable shared references — the read path does no account isolation.
An
asset://xxxuploaded under account A can be used directly as a first frame under account B's Key to generate video; the task runs to completion and the cost is charged to account B.Security implication: do not put confidential / PII content into an asset and expect "account isolation" — anyone who knows the asset id can reference it under their own Key to generate (as long as pre-deduction passes). Treat the asset id as an "unguessable but shareable" token.
Product opportunity: this also means "upload once, reuse across people/multiple accounts" is a natively supported platform capability, usable directly in collaborative products.
12. Output & Download
Video: after polling succeeds, defaults to downloading to
out/<task_id>.mp4and printing the link;--no-downloadreturns the link only.Image: after sync returns, defaults to downloading to
out/<model>_<n>.png(multiple images get_1/_2suffixes automatically);--no-downloadreturnsdata[].urlonly.Image URL validity:
data[].urlis a temporary signed address (~24 hours) — download or re-host promptly.All generation artifacts land in the repo's
out/directory (already in.gitignore, won't be committed).
13. Integration A: Agent Skills
The repo root is itself an Agent Skill folder (contains SKILL.md) — copy it into the agent's skills directory to be read.
Agent | skills directory |
Claude Code |
|
Cursor |
|
GitHub Copilot | in-project |
Codex (OpenAI) |
|
Trae / Zed / Kiro / Junie / Roo Code | respective skills directory (see each tool's docs) |
# Example: Claude Code
mkdir -p ~/.claude/skills
cp -r . ~/.claude/skills/powertokens-kitDirectory structure (the repo root is the skill folder):
powertokens-kit/
├── SKILL.md # Agent Skills manifest (name + description + instructions)
├── pt_video.py # engine (direct official REST, zero deps)
├── mcp_server.py # MCP server (optional)
├── LICENSE
├── README.md
├── README.zh-CN.md # Chinese version of this document
├── pyproject.toml
└── docs/
├── publish.md # registry submission checklist
├── publish.zh-CN.md # Chinese version
└── pitfall-archive.md # pitfall archiveSKILL.md's description uses tool-agnostic trigger phrases (e.g. "generate a video with PowerTokens") with no single-agent-specific wording, so it is universal across 40+ agents.
14. Integration B: MCP server
Only the MCP server needs the mcp dependency (see §7 Method 2). Run:
python mcp_server.py # stdio; the agent client launches it automaticallyAdd this to each MCP client's config (replace the path with your absolute path, and include the Key env var):
{
"mcpServers": {
"powertokens-kit": {
"command": "python",
"args": ["/abs/path/to/powertokens-kit/mcp_server.py"],
"env": { "POWERTOKENS_API_KEY": "sk-pt-xxxx" }
}
}
}Client config entry points:
Client | Entry |
Claude Desktop | Settings → Developer → Edit Config (claude_desktop_config.json) |
Claude Code |
|
Cursor | Settings → MCP → Add |
Trae | Settings → MCP → Add |
VS Code (Copilot) | Command Palette → MCP: Add Server |
Windsurf / Cline / Zed | respective MCP config panel / JSON |
MCP tools exposed
Tool | Description |
| check whether the API Key is ready |
| list models + pricing + params; |
| estimate one generation's cost (USD) |
| generate video (async auto-poll) |
| generate image (sync) |
| generate Seedance video (standalone type) |
| read account balance (by Key) — |
| read billing summary by model type — |
| read consumption records — |
| read asset-library agreement status — |
Note:
upload(asset upload) is currently CLI-only and not exposed as an MCP tool; theasset://needed for Seedance image-to-video can be obtained first via CLIupload, then passed togenerate_seedance'sfirst_frame. The fourquery_*tools are read-only and never generate or deduct credits.
15. Pricing & cost estimation
Video is estimated from PT's pre-deduction unit price; coefficients: duration is linear (5s→10s = ×2), 1080p = 720p ×2. Example:
seedance-1-5-pro-2512155s/720p = $0.247 → 10s/720p = $0.494 → 5s/1080p = $0.494.Images are billed per image; PT has not opened a unit-price API, marked
n/ain the table — refer to the dashboard.The
estimatesubcommand only estimates, does not charge, and does not enter the generation flow.PT quota is counted in USD; before generation the server does a
pre-consume quota failedpre-deduction check — no charge if the check fails.
16. Direct API reference
Generation endpoints base: https://api.powertokens.ai, auth: Authorization: Bearer <POWERTOKENS_API_KEY>.
Purpose | Method + path | Key points |
Submit video |
| body: |
Poll video |
| after status |
Text-to-image |
| OpenAI-style, sync returns |
List available models |
| returns the model list callable by the current Key (for auto candidate / pre-check) |
Upload asset |
| async: returns |
16.1 Model → submit-endpoint mapping (T01, 0.8.10)
Each model in pt-gateway/catalog.json carries two endpoint fields with different meanings — do not use vendor_endpoint as the call endpoint:
Field | Meaning | Who should use it |
| The PT gateway unified endpoint callers should request | ✅ use it when submitting tasks |
| The upstream vendor's real interface, for docs / debugging only | ❌ callers must not use it directly |
Since 0.8.10, pt_video.py resolves the submit endpoint from the catalog by model before posting (resolve_submit_endpoint()), and falls back to the hard-coded constant (VIDEO_SUBMIT / IMAGE_ENDPOINT) when the catalog is missing, the model is unregistered, or the mapped endpoint is cross-type (a video model mapped to /images). Consequences:
A standalone skill copy without
catalog.jsonbehaves exactly as before;If a model's usable PT endpoint changes later (e.g. kling), edit only the catalog
submit— no engine code change;A new endpoint must be confirmed on a live call before being written to the catalog; never guess (rule R4).
Current distribution: /v1/chat/completions 37, /v1/videos 30, /v1/images/generations 11, /v1/audio/speech 8 (86 models total). Kling video series currently has submit = /v1/videos.
Account / billing / asset-library endpoints — different host & auth: the four read-only commands in §9 (balance, usage, logs, agreement) hit a separate host https://powertokens.ai/api (the dashboard / asset backend), not api.powertokens.ai, and use a bare pt_live_ personal access token (Authorization: <token>, no Bearer). This is a different credential from the generation API Key — the two must not be mixed (SSOT C1, real-device verified). balance/usage additionally require a numeric key_id.
Credential sources (T04, in priority order): -k/--key if it starts with pt_live_ → env PT_ACCESS_TOKEN + PT_KEY_ID → config.json access_token/key_id → legacy POWERTOKENS_API_KEY (bare-key fallback, no key_id guessed). The personal token is account-level, shown in plaintext only once, and cannot be reverse-resolved to a key_id (no such API) — set both explicitly. On missing credentials the command prints a first-time setup guide and exits 401.
Purpose | Method + path (host | Key points |
Account balance (by Key) |
| requires |
Billing summary by model |
| requires |
Consumption records |
| single-record lookup by request_id / task_id / consume_id |
Asset-library agreement status |
| account_id / agreement_accepted / asset_library_enabled |
Note: a real device confirmed the bare-token auth (C1). Business success is judged by the response-body
code(an invalid token may still return HTTP 200 withcode=500), not by HTTP status alone. Values without an official source are left unset rather than guessed (R4).
Common errors:
cannot unmarshal number into ... seconds of type string: the server'ssecondsisenum<string>and must be passed as a string (the engine handles this).pre-consume quota failed: insufficient balance, pre-deduction check failed, no charge.BytePlus video models only accept media: mostly caused by an invalid/fakeasset://(see §10.3).404on/v1/images: the correct path is/v1/images/generationswith the/generationssuffix.
17. FAQ / Troubleshooting
17.1 PT HTTP status codes (401 / 402 / 403)
PT assigns specific semantics to these status codes. Our CLI / MCP / gateway surface the original status and PT's message on stderr; the CLI maps auth failures to exit code 2 and everything else to exit code 1.
Status | Meaning | Typical trigger |
| API Key invalid / expired / missing | Bad or absent key |
| Insufficient balance / quota | Generation when credits are exhausted |
| No permission / model delisted | Key lacks access, or the model was removed |
Notes:
The read-only account / billing commands (
balance/usage/logs/agreement, and the gateway/account/*routes) never return402— they only query.A
401/403from thehttps://powertokens.ai/apihost may mean the host expects a web-login token rather than the API Key — verify with a real Key (not verified in the sandbox).
Q: Video generation stuck at some status?
A: Video is generated asynchronously; real render time is 1–3 minutes. The script polls every 10s with a default total cap of 600s; raise --timeout if needed. If it stays unknown for a long time, it's likely server-side queuing — you can later re-check with GET /v1/videos/{id} using the task_id (a status subcommand will be added in a later version).
Q: Image URL won't open?
A: data[].url is a temporary signed address (~24 hours). Download promptly (the default behavior, or use curl manually).
Q: Seedance says I need to sign the agreement?
A: Go to https://powertokens.ai/assets-library?tab=1 to sign manually, then python pt_video.py seedance enable.
Q: Why didn't my auto pick Seedance?
A: Seedance is a standalone type; the auto for ordinary video does not include it — use explicit --type seedance.
Q: Can I use the same asset id across accounts? A: Yes (see §11) — asset ids are cross-account resolvable, but mind the security implication.
Q: MCP server fails to start, missing mcp?
A: pip install -e ".[mcp]" or pip install "mcp[cli]>=1.2".
Q: The balance/usage/logs/agreement commands return 401/403 or code=500?
A: These hit the powertokens.ai/api host with a bare pt_live_ token (not the generation API Key — see §16). Set PT_ACCESS_TOKEN + PT_KEY_ID, or run config --set-access-token / --set-key-id. balance/usage need a numeric key_id; there is no API to reverse-resolve it from the token, so set it explicitly. Note an invalid token can return HTTP 200 with body code=500, so judge by code, not status.
18. Known limitations & roadmap
Polling circuit breaker: 429 backoff / 5xx circuit breaking is a known to-do (see
docs/pitfall-archive.mdA.02/A.03).statussubcommand: re-checking status bytask_idalone is not implemented.Image unit price: PT has not opened a unit-price API,
estimatereturnsn/afor images.Seedance agreement has no API signing: only manual dashboard signing + local flag approximation.
Result video direct download: some result URLs may return 403 on direct R2 access from this machine (bucket hotlink/access policy); the server-side generation task is unaffected; the download-link policy needs further confirmation.
Account/billing endpoints not verified on real hardware: see §16 caveat.
19. Contributing
Issues / PRs welcome. Keep the "engine single source of truth" principle: CLI / SKILL / MCP all share pt_video.py; do not re-implement generation logic in MCP or SKILL. New pitfalls should be synced to docs/pitfall-archive.md.
20. License
21. Changelog
0.7.0 —
catalog.jsonv2.1 (PT 12/12 answers): 8errorscorrections (generation-domain D4 §1 code table, 429model_rate_limited+Retry-After, 5xx pass-through 502/503 + auto Refund, timeout fixed 500 +do_request_failed, 400unsupported_parameter/context_length_exceeded,token_invalid|expired|disabled, 403+503model_not_found, historical 403 balance response voided); new top-levelretry_policy(4+1 acceptance/retry rules,X-Oneapi-Request-Id) andcharging(async full refund vs sync mid-stream per-token settle);kinds.seedance.interface_variants(openai_standard vs vendor_compatible endpoints) andresult_persistence(permanent vs 24h);currency.notesC3. Schema/validator/tests synced; generation code untouched.0.6.0 —
catalog.jsonv2 (P0):schema1 -> 2; add top-levelcurrency,auto_policy.purposes,errors(9 generation-domain categories) andcapability_gaps; addlimits/tool_calling/routing(+web_search_detailon the 4conditionalmodels) to the 7 main models._sourceunified to 8 values; every unverified result staysnull. Shipscatalog.schema.json, a zero-dependencyvalidate_catalog.py, v2 unit assertions and a minimal CI that runs the offline suite only. SeeCHANGELOG.mdand §21.1.0.5.0 — Add read-only account/billing commands: CLI
balance/usage/logs/agreementand matching MCP tools (query_balance/query_usage/query_logs/query_agreement);seedance statusnow best-effort checks server-side agreement; document thepowertokens.ai/apibare-key domain for account/billing/asset endpoints.0.4.1 — Correct the misjudgment that "Seedance text-to-video must carry media" (tested: plain prompt works); add the cross-account asset-sharing finding (A.14);
uploadasset-upload loop; docs aligned.0.4.0 — Split Seedance into a standalone type (
image/video/seedanceparallel); "local flag + error fallback" onboarding flow;force_assetmedia validation; MCPgenerate_seedancetool.0.3.0 — Add image generation (sync
/v1/images/generations); REST direct replaces CLI.0.2.0 — Async video submit + polling;
automodel selection; pricing/param query.0.1.0 — Initial engine skeleton.
21.1 catalog v2 field conventions (schema 2)
pt-gateway/catalog.json is the single source of truth for model capabilities — agents read it
instead of keeping a private capability table. v2 only adds fields; existing values are untouched.
Empty values (A3): null = unknown; [] = confirmed absent; false = confirmed unsupported.
Never turn null into false, never fabricate true.
_source — exactly 8 values (A5): official, documented, verified, official+verified,
inferred, configured (same as inferred), verified(unmapped), product.
Priority: human-confirmed
verified>official/documented> auto-probe >inferred. Auto-probing never overwrites the first three groups; it only refreshes_checked_atand writes a separate probe report.verified(unmapped)is treated as KNOWN, not unknown: the model was really probed, the response just did not map onto a known capability dimension. Do not re-probe it as a blank.productis used only for the top-levelauto_policy(product-side routing decisions); model-levelrouting.recommendedusesconfigured.
Layout: auto_policy.purposes = ordered candidate lists (first layer); routing.recommended =
unordered tags, used only as a fallback when auto_policy does not cover a purpose. errors holds
the 9 generation-domain categories — the account-domain status table (which has no 402) must
not be mixed in. capability_gaps lists capabilities not yet callable; kinds stays the 5
callable kinds (image / video / seedance / audio / chat).
Format reference: pt-gateway/catalog.schema.jsonv2.1 additions (2026-11-12, PT answers 12/12): retry_policy is a top-level
section (not a 10th errors category) holding the 4+1 acceptance/retry rules — a non-2xx is
never accepted and is auto-refunded (safe to retry), while 200 + SSE finish_reason=error|timeout|abort
is already settled/charged and must not be auto-retried. charging splits the two paths:
async tasks get a full RefundTaskQuota on failure/timeout, sync chat mid-stream failures are
charged per measured token and keep status=success (filter by logs.other.finish_reason).
kinds.seedance.interface_variants records both endpoint families (we use openai_standard
/v1/videos); result_persistence records permanent PT-owned URLs vs 24h upstream signed links
(--no-download is not promised permanent until verified). Field names deliberately avoid the
Chinese word for "pass-through" — the repo already has 6+ conflicting meanings for it.
· offline validator: python pt-gateway/validate_catalog.py.
0.8.0 · Node.js consumers: node/ is a zero-dependency core that reads the same pt-gateway/catalog.json (loadCatalog / selectCandidates / classifyError / retryDecision / reasoningParams) plus a Node account-client.js; it never sends requests. Run node --test node/test/core.test.js node/test/account-client.test.js. See node/README.md and docs/PT_项目资料总集_20261112.md §14.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Generate images, video, audio and short films with 140+ AI models from any MCP client.
Generate images, videos and music with model discovery, cost estimates and asynchronous results.
AI video, image and audio generation with 140+ AI models from any MCP agent
Generate images and videos with Seedance, Veo, Wan, Grok, GPT-Image and Nano Banana via one MCP.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables MCP-compatible clients to generate and upscale AI images, videos, music, and sound effects, manage generation jobs, access model catalogs, and track credits.3MIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible clients to generate images and videos, synthesize speech, clone and design voices, and dynamically configure API interactions.468 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI clients to create images and videos through a hosted remote MCP endpoint with browser OAuth, letting users discover available models and Quick Apps, quote credit costs, upload reference files, submit single or batch generation tasks, and retrieve finished results. It also supports task tracking, retries with consistent request IDs, and ranged downloads, while spending account credits only on actually submitted jobs.MIT
- AlicenseAqualityCmaintenanceEnables MCP clients to inspect available models and pricing, upload reference images, submit asynchronous video generation jobs, poll task progress, and download completed videos from a Seedance-compatible API.6MIT