StepFun’s Step 3.7 Flash is one of the cheapest reasoning-capable models you can put behind a coding agent — a multimodal mixture-of-experts design that activates only a small slice of its parameters per token, keeping it fast and inexpensive. Paired with free, open OpenCode, it makes a low-cost agent that can also reason over images if you need that.
This is the OpenCode + StepFun setup. For OpenCode’s general provider model, see OpenCode custom providers.
Step 1: Install OpenCode and get a StepFun key
npm install -g opencode-ai
Sign up on the StepFun platform and create an API key (its quickstart covers key creation). On Windows, WSL gives the cleaner shell — see install OpenCode on Windows with WSL.
Step 2: Add the StepFun provider
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"stepfun": {
"npm": "@ai-sdk/openai-compatible",
"name": "StepFun",
"options": {
"baseURL": "https://api.stepfun.com/v1",
"apiKey": "{env:STEPFUN_API_KEY}"
},
"models": {
"step-3.7-flash": { "name": "Step 3.7 Flash" },
"step-3.5-flash": { "name": "Step 3.5 Flash" }
}
}
},
"model": "stepfun/step-3.7-flash"
}
Export the key:
export STEPFUN_API_KEY="your-stepfun-key"
Confirm the exact base URL and model IDs on StepFun’s docs.
Step 3: Run it
opencode
The default is stepfun/step-3.7-flash. For the lowest cost on simpler tasks, switch to step-3.5-flash.
StepFun models (verify rates on StepFun)
| step-3.7-flash | Tunable reasoning; multimodal; very cheap |
|---|---|
| step-3.5-flash | Even cheaper; great for simple tasks |
Pricing
StepFun’s pricing is at or below the floor most mid-tier providers held — Step 3.7 Flash in the region of $0.20 input / $1.15 output per million, and Step 3.5 Flash even lower (around $0.10 / $0.30), illustrative. Multimodal images bill at a fixed token count each. Confirm current rates on StepFun’s pricing page.
Troubleshooting
- Provider not found — the
providerkey (stepfun) must match themodelprefix. - Auth errors —
STEPFUN_API_KEYnot set in the launching shell. - Model rejected — confirm the Step model ID on StepFun.
- Format errors — confirm you’re using StepFun’s OpenAI-compatible endpoint.
StepFun + OpenCode checklist
- OpenCode installed
- StepFun API key created and exported
- Provider block with StepFun's OpenAI base URL
- Step 3.7/3.5 Flash IDs listed; default set
- Launched with opencode
Wrapping up
StepFun Step 3.7 Flash with OpenCode is about the cheapest reasoning-capable coding agent you can assemble: a free, open tool on a fast, multimodal MoE model at floor-level pricing. Add the provider block, set step-3.7-flash as default (drop to 3.5 Flash for simple work), and launch. Verify the endpoint and rates on StepFun’s docs.
For the broader budget picture, see cheapest AI coding API in 2026.