Python CLI Reference
Commands provided by pip install wlt-platform. Invoke as wlt or python -m wlt.
Most subcommands accept a --json flag to emit raw JSON output (useful for scripting).
Authentication
Persist credentials to ~/.wlt/config.json (mode 0600), or sign out.
For this environment, set --base-url to https://console.example.com.
# Login (persists API Key + base URL to ~/.wlt/config.json)
wlt login --api-key your-api-key --base-url https://console.example.com
# Logout (removes local credentials)
wlt logout
# Show current user
wlt whoami
| Flag | Required | Description |
|---|---|---|
--api-key <key> | yes (for login) | API key to persist. |
--base-url <url> | yes (for login) | Console base URL to persist. |
Config
Manage the local config file (~/.wlt/config.json).
wlt config set base_url https://console.example.com
wlt config set api_key your-api-key
wlt config get base_url
wlt config list # api_key shown masked
Secret
Secret CRUD, per-model usage, model & provider catalogues.
wlt secret list [--page-num N] [--page-size N]
wlt secret detail <id>
wlt secret create --name <name>
wlt secret edit <id> --name <new-name>
wlt secret action --id <id> --status ENABLE|DISABLE|DELETE
wlt secret usage-by-model <id> [--page-num N] [--page-size N]
wlt secret models
wlt secret providers
wlt secret action— Python uses--id <id>; Node uses positional<id>.wlt secret usage-by-model— Python currently exposes only<id>+ pagination flags. The SDK method acceptsstart_time/end_time; Node CLI surfaces those as--start/--end. Python CLI alignment is a known follow-up.
ApiKey
BYOK credentials — CRUD, status toggle, upstream connectivity test, provider list.
wlt apikey list [--page-num N] [--page-size N]
wlt apikey create --name <name> --provider <provider> --key <secret> [--key-id <id>]
wlt apikey update <id> --name <new-name>
wlt apikey delete <id>
wlt apikey change-status <id> --status 1|0
wlt apikey test-connect --provider <provider> --key <secret> [--key-id <id>]
wlt apikey providers
--status for change-status: 1 = enable, 0 = disable.
--provider must be the provider id (e.g. dashscope), not the display name. Use wlt apikey providers to list valid ids.
Usage
Serverless call records, statistics, history, and gateway provider list.
wlt usage list --start <date> --end <date> [--page-num N] [--page-size N]
wlt usage stats --start <date> --end <date>
wlt usage history [--page-num N] [--page-size N] [--start <date>] [--end <date>]
wlt usage providers
--start / --end accept either YYYY-MM-DD or YYYY-MM-DD HH:MM:SS.
Billing
Monthly GPU & service billing — operates on monthly cycles only.
wlt billing summary --cycle YYYY-MM
wlt billing by-gpu --cycle YYYY-MM [--page-num N] [--page-size N]
wlt billing by-service --cycle YYYY-MM [--page-num N] [--page-size N]
wlt billing list --cycle YYYY-MM [--page-num N] [--page-size N]
For date-range queries against the model-usage table, use payment billing-list instead.
Payment
Recharge records, statistics, model-usage billing by date range.
wlt payment records [--page-num N] [--page-size N]
wlt payment statistics
wlt payment detail <transaction_no>
wlt payment billing-list --start "2026-04-01 00:00:00" --end "2026-04-30 23:59:59" [--page-num N] [--page-size N]
wlt payment billing-amount --start "2026-04-01 00:00:00" --end "2026-04-30 23:59:59"
payment billing-list / payment billing-amount require the full YYYY-MM-DD HH:MM:SS form. Bare YYYY-MM-DD is rejected by the backend.
Model Gallery
Model Gallery — list, providers, pricing.
wlt model list [--page-num N] [--page-size N]
wlt model providers
wlt model price <model-name>
Model Lab
Model Lab — list models, manage chat session, stream chat.
wlt lab list [--page-num N] [--page-size N]
wlt lab session
wlt lab chat --provider <provider> --model <name> --message "<text>" [--session-id <id>]
Streaming chat — runnable example
wlt lab chat requires a provider + model combination registered in the gateway. Discover them first, then chat:
# 1. Find available gateway providers
wlt usage providers
# 2. List available models with their callable provider
wlt lab list --page-num 1 --page-size 5
# 3. Stream a real chat (daily endpoint via OpenRouter gateway)
wlt lab chat --provider openrouter --model openai/gpt-5.4-nano --message "Say hi in 5 words"
Admin
Admin-scope commands (billing reports + end-customer CRUD). Authenticates with an admin username/password — no captcha, no API key — and caches a session token to ~/.wlt/config.json under admin:. Admin commands do not share credentials with the tenant-user CLI above; use wlt admin login before running any wlt admin ... command.
# Admin session lifecycle
wlt admin login --username admin --password your-admin-password
wlt admin whoami
wlt admin logout
wlt admin login reads the base URL from WLT_BASE_URL or ~/.wlt/config.json. It does not accept --base-url — set it via wlt config set base_url <url> or export WLT_BASE_URL first.
Billing
Customer / Provider billing use full timestamps; RS billing uses date-only.
# Customer Billing
wlt admin billing customer-list --start-time "2026-06-01 00:00:00" --end-time "2026-06-30 23:59:59" [--page-num N] [--page-size N]
wlt admin billing customer-total --start-time "2026-06-01 00:00:00" --end-time "2026-06-30 23:59:59"
# Provider Billing
wlt admin billing provider-list --start-time "2026-06-01 00:00:00" --end-time "2026-06-30 23:59:59" [--page-num N] [--page-size N]
wlt admin billing provider-total --start-time "2026-06-01 00:00:00" --end-time "2026-06-30 23:59:59"
# RS Billing (date-only)
wlt admin billing rs-list --start-date 2026-06-01 --end-date 2026-06-30 [--page-num N] [--page-size N]
wlt admin billing rs-total --start-date 2026-06-01 --end-date 2026-06-30
Customer
End-customer (bizUser) list / create / delete.
wlt admin customer list [--page-num N] [--page-size N] [--user-name <fuzzy>]
wlt admin customer create --user-name <name> --password '<pwd>' [--email <email>] [--phone <phone>] [--timezone <IANA>]
wlt admin customer delete <user-id>
create returns success: True with no id echoed; use wlt admin customer list --user-name <name> --json to look up the new id.
Pricing
Model pricing: platform catalog, per-customer prices, discounts, and factors.
# Platform model catalog
wlt admin pricing list-provider-models --partner-id N [--model-type <type>] [--provider <name>] [--status <status>] [--page-num N] [--page-size N]
wlt admin pricing save-provider-model --file <body.json>
wlt admin pricing set-provider-model-listed --id N --status N
wlt admin pricing update-provider-model-price --file <body.json>
wlt admin pricing list-price-factors [--model-type <type>]
# Per-customer prices
wlt admin pricing list-user-model-prices --user-id N [--partner-id N] [--model-name <name>] [--page-num N] [--page-size N]
wlt admin pricing save-user-model-price --file <body.json>
wlt admin pricing set-user-model-listed --id N --status N
wlt admin pricing set-discount --discount "10" --model-ids 101,102 [--user-id N] [--partner-id N]
save-provider-model, update-provider-model-price, and save-user-model-price read their request body from a JSON file passed via --file. set-discount takes a percentage string ("10" = 10% off) and a comma-separated list of model ids.
Credit
Customer credit balance read / adjust.
wlt admin credit get --user-id N
wlt admin credit set --user-id N --amount 100
Rate Limit
Customer request rate cap (requests-per-minute) read / set. An empty cap means unlimited.
wlt admin rate-limit get --user-id N
wlt admin rate-limit set --user-id N --tpm-cap 60000
wlt admin rate-limit set --user-id N --unlimited
Pass either --tpm-cap or --unlimited, not both. --unlimited clears the cap.
Context
Context-record toggle, listing, and body export.
wlt admin context toggle --user-id N --enabled # or --disabled
wlt admin context list --user-id N [--start-date YYYY-MM-DD] [--end-date YYYY-MM-DD] [--trace-id-filter <id>] [--api-key-id <id>] [--max-traces N]
wlt admin context body --uid N --partition-date YYYY-MM-DD --trace-id <id> --visibility <scope>