Skip to main content
Pi is an open-source terminal coding agent maintained by earendil-works, with tools for reading files, editing code, and running commands. A custom provider connects it to Step Plan through the Anthropic Messages API.

Requirements

Run the following commands in your terminal to check your environment:
If your Node.js version is v22.19.0 or later and npm successfully returns a version number, you can proceed with installing Pi.

Install Pi

Install Pi 0.87.1:
Check the installed version:

Configure Step Plan

Set the API key

Set the environment variable in the terminal that will launch Pi. Replace YOUR_STEP_API_KEY with your key.

Add models

  1. Open ~/.pi/agent/models.json. If PI_CODING_AGENT_DIR is set, use models.json in that directory instead.
  2. Merge the following providers.stepfun entry into the file, preserving other providers. If the file does not exist, create the directory and save this JSON.
Step 5 Preview has a 1M-token context window; Step 3.7 Flash has a 256K-token window. The configuration uses 1000000 and 256000, respectively.

Set the default model

Merge these fields into settings.json in the same configuration directory:

Start Pi

Run Pi from your project directory:
To select the provider and model at launch, use:

Verify the integration

Check model configuration

An authentication status of ready means the client can resolve its credentials. The model list should include the configured IDs, with a 1M window for Step 5 Preview and a 256K window for Step 3.7 Flash.

Test a conversation

Expected output: OK.

Test tool calls

Create a separate test directory on a machine with Python installed. Add a README.md containing Pi Step Plan test, start Pi from that directory, and enter:
Check the file-reading, creation, and command records. Confirm that hello.py exists and outputs Hello, StepFun!.

Check usage

In the StepFun platform usage details, match the request time, model ID, and billing source to confirm that the call used Step Plan.

Common questions

Check that the active configuration directory contains valid JSON in models.json and the correct IDs under providers.stepfun.models. Open /model to reload the file, or restart Pi and run pi --list-models stepfun.
Set STEP_API_KEY in the terminal that launches Pi. Check that the key is complete, valid, and belongs to the account for the configured endpoint. A saved stepfun credential in auth.json takes precedence, so check that entry as well.
Set api to anthropic-messages and baseUrl to https://api.stepfun.ai/step_plan. Pi appends /v1/messages; the configuration URL ends at /step_plan.
Check the model’s contextWindow: use 1000000 for step-5-preview and 256000 for step-3.7-flash. Reload the model list after saving and select the model again.