pt, also supports powertokens) is used from the terminal to call the Chinese large language models, image models, video models, and speech models on the PowerTokens platform. It is suitable for local creation, bulk generation, script automation, and for invocation by coding agents.
This document introduces the current features in the order “Install → Login → Select Model → Execute Tasks → Retrieve Files → Configuration and Troubleshooting”. The model catalog and vendor parameters are dynamically updated by the platform, so actual usage should rely on the results returned by pt models.
1. Quick start
pt generate will automatically select the appropriate vendor route based on the model ID. You do not need to manually specify a vendor endpoint.
2. Installation
System requirements
PowerTokens CLI is distributed via npm. We recommend Node.js 18 or later. Make surenpm and the global npm executables directory are added to your system PATH.
pt command.
3. Login and credential management
Login
View current identity and usage information
Logout
4. Recommended workflow
For unfamiliar models, we recommend the following process:generate’s general options and --params. After a task completes, the CLI downloads the generated result to the path specified by -o.
5. View available models
GET /v1/models. The client caches the model list; when the API is temporarily unavailable, the CLI falls back to a built-in list.
Models are roughly categorized by capability as follows:
Multimodal models such as
kling-v3 and kling-v3-omni may appear in both the image and video categories.
6. Text chat: pt chat
Basic usage
Read the prompt from standard input
When no positional argument is provided,pt chat reads content from standard input, so you can combine it with other commands:
Parameters
7. Multimedia generation: pt generate
generate is the unified entry point for image, video, and audio generation. At minimum, provide a model ID, a prompt, and an output path:
7.1 Image generation
Image size formats are not shared across providers. For example, Seedream commonly uses
2048x2048, Kling uses 1k, 2k, or 4k, and Qwen/Wan may use 2048*2048 or 2K. Use the official parameters of the target model as the source of truth.
Kling’s std, pro, and 4k indicate quality tiers and do not necessarily correspond to fixed pixel dimensions. The CLI maps these values to the parameters required by the upstream API.
7.2 Text-to-video
Resolution values differ across providers. Seedance/Wan commonly use
480p, 720p, and 1080p; Kling commonly uses std, pro, and 4k; Vidu commonly uses 540p, 720p, and 1080p; Hailuo commonly uses 768P and 1080P.
7.3 Image-to-video
--ref accepts a local file path, public URL, Base64 string, or asset:// resource identifier. The CLI handles asset formats automatically based on the provider.
7.4 First-and-last-frame video
--ref and --last-frame.
7.5 Reference video and reference audio
7.6 Kling camera motion control
--params:
video_url or character_orientation appears in --params, the CLI automatically selects Kling’s camera motion control endpoint. --character-orientation can be set to image or video.
7.7 Text-to-speech
--voice:
8. generate complete parameters
Whether a parameter takes effect depends on the target model and upstream provider. The CLI maps general parameters to the corresponding endpoints; fields that cannot be expressed with general parameters should be passed through
--params.
9. Pass model parameters with --params
Merge mode
When the JSON passed in--params contains no content or media array, the CLI merges the JSON fields into the request body:
Full request body mode
When--params directly contains a content or media array, the CLI treats it as the complete request body and adds the model field. You can omit -p in this case:
10. Asset handling and provider differences
Local assets
--ref, --last-frame, --ref-video, and --ref-audio all accept local files. The CLI converts them automatically depending on the provider:
- BytePlus Seedance first uploads assets to the asset library, then passes them to the model as
asset://<id>. Anasset://path you provide directly is passed through unchanged. - MiniMax, Kling, Wan, Vidu, and HappyHorse typically convert local files to Base64 or a data URL; the exact encoding is determined by the provider adapter.
Main video parameter support
Provider fields not listed here should be passed through with
--params. The table reflects the CLI’s current adapter support and does not represent the full capabilities of the upstream models.
11. Configuration
View and modify configuration
https://baze-api.powerbuyin.top, the asset library address is typically derived as https://powertokens.ai/api. Override it manually with -a only when you use a standalone asset service.
Local configuration file
The configuration file is located at:0600. Example structure:
Environment variables
Environment variables take precedence over the configuration file and are well suited to CI/CD, containers, and temporary tasks:
Example:
12. Script automation
Bash
Node.js
Python
13. Frequently asked questions
13.1 “API key not configured” prompt
Run one of the following commands first:pt whoami.
13.2 Model not found or parameters not applied
Check the current model catalog first:--params.
13.3 A local file cannot be used as a reference asset
Verify the file path and check the file type and size. We recommend an absolute path or a path relative to the current directory:13.4 --params JSON parsing failed
Check the quoting and JSON format. Bash example:
13.5 How to view the underlying request
SetPT_DEBUG=1:
13.6 No output file was generated
Check that:- The directory specified by
-oexists, or create it first. - The current model and input combination actually supports that task type.
- The task was not rejected by an upstream model.
- Your API key, API Base URL, and asset library address are configured correctly.
- Use
PT_DEBUG=1to view the task status and raw responses.