@d3ara1n/pi-provider-unisound0.3.1
Unisound (云知声) MaaS provider for pi — registers U2-Flash via OpenAI-compatible API
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
@d3ara1n/pi-provider-unisound
Unisound (云知声) MaaS provider for Pi Coding Agent — registers the U2 model family (plus plan-hosted GLM/Kimi) via the platform's OpenAI-compatible API.
Providers
| Provider ID | Name | Billing | API Key Env |
|---|---|---|---|
unisound |
Unisound MaaS | Pay-as-you-go | $UNISOUND_API_KEY |
unisound-plan |
Unisound MaaS (Token Plan) | Subscription | $UNISOUND_PLAN_API_KEY |
Both channels share the endpoint https://maas-api.unisound.com/v1. The keys are not interchangeable: pay-as-you-go keys come from Metered & Packs → API Key Management, Token Plan keys from Subscription Management.
Token Plan usage restriction: plan quota may only be used inside coding tools (U2Claw, OpenClaw, OpenCode and equivalents like pi). Using the plan key for non-coding automation or application backends is considered abuse and may get the key blocked.
Models
The catalog covers the full platform model set — both channels expose the
same models and differ only in billing (permissions live on the API key).
It is refreshed from the live API (GET /v1/models) when the cached
snapshot is stale — at most once every 4 hours, matching pi's built-in
catalog cadence — so newly published models appear without a plugin
update:
- Network refresh: each registration fetches the live catalog with its
own key during interactive startup when the persisted snapshot is older
than 4 hours, and replaces the registered model list.
pi update --modelsforces an immediate refresh. - Offline restore: the last-seen catalog is persisted to
~/.pi/agent/models-store.jsonand restored on offline startups (PI_OFFLINE=1). - Metadata:
context_window/max_outputcome from the live catalog. Modalities, thinking behavior and pricing are not exposed by the endpoint and fall back to the shipped specs per model id; models new to the catalog get conservative family defaults (text-only input, on/off thinking). - Fallback: the shipped spec table is used until the first successful network refresh (or while the API is unreachable).
Reasoning families (shipped specs)
| Family | Thinking levels |
|---|---|
| U2 Flash | on/off (thinking.type) |
| U2 | always on (cannot disable) |
| U2 Med | off / low / medium / high (reasoning_effort) |
| GLM-5.2, DeepSeek V4 family | off / high / max (reasoning_effort) |
| GLM-5.3 / 5.3 Flash | off / low / high / max (reasoning_effort) |
| Kimi K3 | low / high / max, always on (reasoning_effort) |
| others | on/off (thinking.type) — levels unverified |
u2-radimed (medical imaging) is no longer listed by the live catalog
and was removed (2026-10); it re-registers automatically if it returns.
Pay-as-you-go U2 pricing is in Pricing; every model on the
Token Plan and unpublished-price third-party models cost 0.
Compatibility
- Thinking is on by default on the U2 models:
u2-flashandu2-medcan toggle it,u2always reasons, andu2-radimednever does.u2-flashignoresreasoning_effort(re-verified live), so only on/off is offered for it. - Reasoning effort applies to
u2-medand the plan-hosted models:u2-medexposes off / low / medium / high,glm-5.2exposes off / high / max, andkimi-k3is always-on with low / high / max. Gateway alias levels (e.g.minimal→lowonu2-med) are hidden. - Image input:
u2-flashis text-only;u2-medandu2-radimedaccept images. - Context overflow errors match pi's built-in patterns, so auto-compaction works. Declared context windows are conservative, so pi compacts before the gateway rejects an oversized request.
- Caching: the API reports cache-hit tokens, which pi shows as cache-read tokens in the cost estimate.
- Tool calls, streaming, and usage reporting follow the standard OpenAI shapes.
Pricing
pi tracks cost in USD. Unisound lists CNY prices, so cost fields are FX-converted estimates (~7.1 CNY/USD) for pi's status-bar display only — not real billing. List prices (input / cache-hit / output, CNY per million tokens): u2-flash 1/0.2/2 (limited-time promos such as the Sept–Oct 2026 free month excluded), u2 1/0.02/2, u2-med 8/2/28, u2-radimed 15/4/20. Token Plan models have subscription billing → cost 0. Cache-write pricing is not published.
Installation
pi install npm:@d3ara1n/pi-provider-unisound
Or add to ~/.pi/agent/settings.json:
{
"extensions": [
"/absolute/path/to/pi-extensions/packages/pi-provider-unisound"
]
}
Set your API key (pay-as-you-go):
export UNISOUND_API_KEY="sk-..."
Or for the Token Plan:
export UNISOUND_PLAN_API_KEY="sk-..."
Or use /login in pi to store them in ~/.pi/agent/auth.json:
{
"unisound": { "type": "api_key", "key": "sk-..." },
"unisound-plan": { "type": "api_key", "key": "sk-..." }
}
Then switch models with /model unisound/u2-flash or /model unisound-plan/kimi-k3.
Getting an API Key
- Visit the Unisound MaaS platform
- Pay-as-you-go: Metered & Packs → API Key Management
- Token Plan: subscribe on the Token Plan page, then Subscription Management → dedicated API key
Note that model access is scoped per key — a key without permission for a model returns no model <id> permission.
Dependencies
None — this is a standalone provider with no pi-extension dependencies. It uses pi's built-in openai-completions streaming.
Usage Quota Reporting
Not yet implemented — Unisound MaaS does not currently expose a public quota or balance API. Token Plan credits are visible only in the web console (Subscription Management). When one becomes available, quota reporting will be added via @d3ara1n/pi-usage-block-core.