Docs · Providers
StepFun Step Plan in Claude Code and Codex
StepFun has two sites with separate accounts: platform.stepfun.com in China and platform.stepfun.ai internationally. Each has a Step Plan and pay as you go; the Step Plan is served at its own step_plan endpoints, and its key is refused at pay as you go's. Add the provider for your site in magpie with the key's plan, and Claude Code, Codex, Gemini CLI and OpenCode use Step's models through magpie's local gateway on 127.0.0.1:3425.
Add StepFun
- Add the provider and pick the planOn Providers, click + Add provider, pick StepFun or StepFun (China), set the key's plan to Step Plan or Pay as you go, paste the key and save.
- Pick it for a toolOn Agents, pick a model such as step-5-preview on a tool's row.
An international account is StepFun (provider id stepfun); a China account is StepFun (China) (stepfun-cn).
magpie claude stepfun-cn/step-5-preview magpie codex stepfun-cn/step-3.7-flash magpie opencode stepfun/step-5-preview
Sites, plans and endpoints
| Site and plan | Chat Completions | Anthropic Messages |
|---|---|---|
| China · Step Plan | https://api.stepfun.com/step_plan/v1 | https://api.stepfun.com/step_plan |
| China · Pay as you go | https://api.stepfun.com/v1 | https://api.stepfun.com |
| International · Step Plan | https://api.stepfun.ai/step_plan/v1 | https://api.stepfun.ai/step_plan |
| International · Pay as you go | https://api.stepfun.ai/v1 | https://api.stepfun.ai |
A Step Plan key works only at the endpoints under step_plan and is refused at pay as you go's, so magpie sends each request by the plan its key names. A Step Plan key and a pay-as-you-go key on one site can share one provider. Neither serves Responses.
Models
The Step Plan catalogs' chat models are step-5-preview, step-3.7-flash, step-3.5-flash and step-3.5-flash-2603; the China Step Plan has step-router-v1 too. Pay as you go adds the speech models stepaudio-2.5-asr, stepaudio-2.5-tts and step-tts-2.
Balance and Step Plan windows
- Balance: magpie reads
/v1/accountswith the API key, in yuan on the China site and dollars on the international one. - Step Plan windows: a Step Plan key is told its plan by StepFun's usage API (
GET /step_plan/v1/usage), so with the key added the Usage page shows the plan, its credits used and left, and when they run out, with nothing to sign in to. A plan whose windows the API doesn't tell in a form magpie reads (the old Coding Plan's 5-hour and weekly windows) is read through a sign-in on StepFun's platform instead: sign in in your own browser, run magpie's bookmarklet on that page, and paste what it copies into magpie. magpie then renews the sign-in itself; it is kept in stepfun-auth.json beside providers.json, readable by you alone.
In each agent
- Claude Code speaks Anthropic Messages. Both StepFun sites have Anthropic endpoints, so requests go as they are. See Claude Code with other models.
- Codex speaks only OpenAI Responses. StepFun doesn't serve Responses, so magpie converts Codex's requests to Chat Completions, custom tools such as
apply_patchincluded. The models show in Codex's/model. See Codex with other models. - Gemini CLI speaks Gemini's API; magpie points it at the local gateway and translates. See Gemini CLI with other models.
- OpenCode: magpie writes the models into opencode.json. See OpenCode with other models.
FAQ
How do I use the StepFun Step Plan in Claude Code?
Add StepFun or StepFun (China) in magpie with the key's plan set to Step Plan, then pick step-5-preview on Claude Code's row, or run magpie claude stepfun/step-5-preview. Requests go to https://api.stepfun.ai/step_plan (api.stepfun.com in China).
Why is my Step Plan key refused at /v1?
A Step Plan key works only at the endpoints under step_plan; pay as you go's /v1 refuses it. Set the key's plan to Step Plan in magpie and requests go to /step_plan/v1.
Does StepFun work in Codex?
Yes. StepFun has no Responses endpoint, so magpie converts Codex's requests to Chat Completions. Run magpie codex stepfun/step-3.7-flash.
Can magpie show what is left of my Step Plan?
Yes. With a Step Plan key added, magpie reads the plan from StepFun's usage API with that key: the plan's name, the credits used and left, and when they run out. A plan the API doesn't tell fully is read through the platform's sign-in, brought over with magpie's bookmarklet. The balance needs only the key.
The same for other providers: Xiaomi MiMo, Huawei Cloud MaaS, MiniMax, GLM Coding Plan, Kimi, DeepSeek, Qwen. Hit an error? See troubleshooting, or ask on Discord.