@d3ara1n/pi-provider-stepfun0.4.0
StepFun provider for pi — Step 5, Preview, and Flash via pay-as-you-go or Step Plan
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-stepfun
StepFun (阶跃星辰) provider for pi — registers pay-as-you-go and Step Plan channels and uses the Responses API where supported, with Chat Completions for other models.
Providers
| Provider ID | Channel | Base URL | API Key Env |
|---|---|---|---|
stepfun |
Pay-as-you-go | api.stepfun.com/v1 |
STEP_API_KEY |
stepfun-plan |
Step Plan subscription (Token Plan or legacy Coding Plan) | api.stepfun.com/step_plan/v1 |
STEP_PLAN_API_KEY |
Both channels accept the same API key — set both env vars to it if you only have one. The difference is billing and model set:
stepfunbills per token (CNY).stepfun-planconsumes Step Plan subscription allowance.
The base URLs above are not interchangeable: calling the ordinary API does not spend Step Plan allowance.
Models
Each registration refreshes its own channel catalog (GET <base>/models)
when the cached snapshot is stale — at most once every 4 hours, matching
pi's built-in catalog cadence — and restores the last-seen catalog on
offline startups; pi update --models forces an immediate refresh.
Catalog metadata takes priority, with the shipped specs filling in missing fields for known models.
Unrecognized models without token limits use a conservative 256K context and 16K output budget.
If a refresh fails, the previous catalog stays in place.
Shipped specs:
| Model | Reasoning | Input | Context | Max Output | Providers |
|---|---|---|---|---|---|
step-5 |
Yes | text, image | 1M | 64K | both |
step-5-preview |
Yes | text, image | 1M | 64K | both |
step-3.7-flash |
Yes | text, image | 256K | 16K | both |
step-3.5-flash |
Yes | text | 256K | 16K | both |
step-3.5-flash-2603 |
Yes | text | 256K | 16K | both |
step-1o-turbo-vision |
No | text, image | 32K | 8K | stepfun |
step-gui |
Yes | text, image | 256K | 16K | stepfun |
step-router-v1 |
Yes | text | 256K | 16K | both |
step-3.5-flash-2603 is the Agent/Coding-optimized snapshot of step-3.5-flash — faster and more token-efficient, tuned for coding and agent frameworks.
Step 5 and Step 5 Preview also accept video through the API, but pi's model input declaration only supports text and images. Step 5 supports five reasoning efforts: low, medium, high, xhigh, and max.
API selection
Each channel uses its own /models response to choose the API per model.
It prefers responses in supported_protocols, otherwise uses Chat Completions if chat is listed.
Models declaring neither are not registered as chat models.
Without protocol metadata, both channels use the same preset based on pay-as-you-go behavior:
step-5, step-5-preview, step-3.7-flash, step-gui, and step-router-v1 prefer Responses when available in that channel's model list.
Other models default to Chat Completions.
step-router-v1
A routing model: it can dispatch requests to step-5-preview or step-3.7-flash. The preset uses the smaller 256K context. Charges depend on the engine selected for each request.
Note that step-router-v1 emits an [Advisor consultation] … [End of advisor consultation] planning block inside its text output — this is the router's internal planning, not something to act on.
Pay-as-you-go Pricing
The ordinary API bills in CNY per million tokens, using any gift balance before the topped-up account balance. Current official rates:
| Model | Input (cache miss) | Input (cache hit) | Output |
|---|---|---|---|
step-5 / step-5-preview |
¥7 | ¥0.70 | ¥20 |
step-3.7-flash |
¥1.35 | ¥0.27 | ¥8.1 |
step-3.5-flash / -2603 |
¥0.7 | ¥0.14 | ¥2.1 |
step-1o-turbo-vision |
¥2.5 | ¥0.5 | ¥8 |
Cost estimation in pi's status bar is disabled (set to 0), since it assumes USD. These prices are references, not amounts charged by the extension.
Step Plan Subscription
Step Plan's current Token Plan measures model use in Credits (1M Credits = ¥1 of model usage). Credits are issued monthly, can be spent at any time during the month, and do not roll over. The plan channel does not draw on the ordinary API account balance.
| Tier | Credits per month | Monthly | Quarterly | Annually |
|---|---|---|---|---|
| Flash Mini | 400M | ¥49 | ¥129 | ¥456 |
| Flash Plus | 1,600M | ¥99 | ¥269 | ¥936 |
| Flash Pro | 8,000M | ¥199 | ¥539 | ¥1,860 |
| Flash Max | 40,000M | ¥699 | ¥1,889 | ¥6,666 |
Quarterly and annual plans are paid up front, but Credits are still issued monthly. Subscribers can buy a separate 30-day booster when their monthly allowance runs out: ¥49 for 400M Credits or ¥99 for 1,600M Credits. Model usage is converted to Credits from its actual API charges; step-router-v1 uses the price of the engine selected for each request. These are the published domestic tiers; check the subscription page for current prices in your region.
The older Coding Plan used request counts and five-hour/weekly limits. It cannot be purchased again, but existing subscribers with successful auto-renewal can keep it; upgrading to Token Plan is irreversible. Neither plan requires a different endpoint or provider ID. See the official upgrade notice.
Installation
pi install npm:@d3ara1n/pi-provider-stepfun
Or add to ~/.pi/agent/settings.json:
{
"extensions": [
"/absolute/path/to/pi-extensions/packages/pi-provider-stepfun"
]
}
Configuration
Get an API key from the StepFun console, then set the env var for the channel(s) you use:
export STEP_API_KEY="your-api-key" # stepfun (pay-as-you-go)
export STEP_PLAN_API_KEY="your-api-key" # stepfun-plan (Step Plan)
Or store it through /login, or manually in ~/.pi/agent/auth.json:
{
"stepfun": { "type": "api_key", "key": "your-api-key" },
"stepfun-plan": { "type": "api_key", "key": "your-api-key" }
}
Notes
- The Step 3.x Flash models always reason. Turning thinking off in pi only omits the reasoning parameter — the model still thinks at its default level. This is a model characteristic, not something the provider can disable.
step-1o-turbo-visiondoes not reason. step-3.5-flash-2603accepts onlylowandhighreasoning effort; pi'smediumis mapped tolow. For models with three documented effort levels, pi's extra levels are mapped into thelow/medium/highrange.
Dependencies
None — standalone provider with no pi-extension dependencies. It uses pi's built-in openai-responses and openai-completions transports.