Requirements
Environment
- macOS, Linux, or Windows. On Windows, use PowerShell or run Claude Code inside WSL.
- The npm installation method below requires Node.js 22 or later. Skip it if you already installed Claude Code with a native installer.
Subscribe to Step Plan
Confirm that your Step Plan subscription is active, has available quota, and provides access to the model. The configuration examples in this guide use the Step Plan channel.Get a Step API Key
Create an API key on the Step platform API keys page.Configuration Steps
Install Claude Code
Run the following command in your terminal:Create the Configuration File
- Quick setup with the script
- Edit the configuration file manually
The commands below download the English scripts from the official Step repository, Windows (PowerShell)Run the following commands in a regular PowerShell session as your current user. Administrator privileges are not required.Select option 2 for StepFun Step Plan (subscription), then enter your API key and model name when prompted. The script backs up an existing configuration, replaces the entire
stepfun-ai/Step-Cookbook, and execute them only after a successful download.macOS / Linux / WSL (Bash)Install jq before running the Bash script. The script uses it to update the JSON configuration.env object, and preserves other top-level fields. Any additional variables previously stored inside env are removed. Restart Claude Code after setup.Set Reasoning Effort
step-5-preview supports the following reasoning effort levels:
For Step 5 Preview, Step maps
xhigh and max to high. Claude Code sends the setting through the Messages API field output_config.effort.
Set the effort level when starting a session:
effortLevel into the top level of ~/.claude/settings.json, not into env:
CLAUDE_CODE_EFFORT_LEVEL, launch flags, and project or organization settings.
Enable 1M Context
step-5-preview has a 1M-token context window. If /context treats it as an unrecognized model with a 200k window, merge the following fields into ~/.claude/settings.json, preserving your existing configuration:
CLAUDE_CODE_MAX_CONTEXT_TOKENStells Claude Code to measure usage against a 1M window. Use the plain number1000000. Do not write1Mor1000k.CLAUDE_CODE_AUTO_COMPACT_WINDOWaligns the auto-compact window to 1M. Valid range is100000–1000000, also as a plain number. Claude Code reserves space for output and internal processing, so compaction may occur before the window is full.- Save the file, fully quit and restart Claude Code, then run
/contextand confirm the window is close to 1M instead of 200k. - After you declare a window above 200k, a startup message such as “200K limit isn’t enforced” is expected.
env yourself after running the script.
Start Claude Code
Enter any code project directory:Do you want to use this API key? appears on first launch, select Yes.
Test the Integration
Verify Client Conversations
- Save the configuration, quit Claude Code completely, and restart it.
- Run
/statusto check the model, authentication, and configuration source. - Send “Reply only with OK.” Check the returned text and streaming output.
Verify Agent Tool Calls
Use a separate test directory on a machine with Python installed. Createhello.py containing a statement that prints Hello, world!, then send Claude Code this task:
Verify Usage and Routing
In the Step platform, match request time, model, and response ID to confirm that the call used Step Plan and its quota.Common Issues
Q: Why do configuration changes not take effect?
Q: Why do configuration changes not take effect?
Restart and run
/status to check the model, authentication, and configuration source. Check project settings, --model, ANTHROPIC_MODEL, CLAUDE_CONFIG_DIR, and organization settings. Confirm that settings.json is valid JSON.This Bash / jq command shows relevant settings and whether credentials exist without printing their values:Q: How do I resolve 401 invalid_api_key?
Q: How do I resolve 401 invalid_api_key?
Put a valid Step API key in
ANTHROPIC_AUTH_TOKEN. Check for typing errors, revoked keys, or a key from another site. If ANTHROPIC_API_KEY is also set, do not update only that variable while leaving an old ANTHROPIC_AUTH_TOKEN.If you previously signed in to another account with /login, use /status to check the credential source. To leave that login session, run /logout, restart, and verify the Step configuration again.Q: How do I test the Messages API independently?
Q: How do I test the Messages API independently?
Use curl to check the endpoint, key, and model first. The command below uses Bash or Zsh; on Windows, run it in WSL or Git Bash.Pass criteria: HTTP 200, response
type is message, and content includes a text block containing OK. If only thinking blocks are returned with stop_reason: max_tokens, increase the output budget and retry.Q: What if the URL fails, or curl works but Claude Code does not?
Q: What if the URL fails, or curl works but Claude Code does not?
Claude Code appends
/v1/messages to ANTHROPIC_BASE_URL. Check the URL against this table:If curl works but the client fails, check whether project or user settings override terminal variables. Use
claude --debug to inspect logs when further diagnosis is needed.Q: Why do background tasks or subagents report model errors?
Q: Why do background tasks or subagents report model errors?
Check
ANTHROPIC_DEFAULT_HAIKU_MODEL, ANTHROPIC_DEFAULT_FABLE_MODEL, CLAUDE_CODE_SUBAGENT_MODEL, and models explicitly assigned to tasks. They must use available Step model IDs. See the configuration fields above.Q: Why does /context still show 200k?
Q: Why does /context still show 200k?
Confirm that the model is
step-5-preview, that you edited the correct configuration directory, and that CLAUDE_CODE_MAX_CONTEXT_TOKENS and CLAUDE_CODE_AUTO_COMPACT_WINDOW in env both equal "1000000". Quit completely and restart. The setup script does not write these fields by default.Q: How do I resolve model does not exist?
Q: How do I resolve model does not exist?
Check the model ID, account permissions, target channel, and subagent models. A client warning about an unrecognized custom model is not the same as a server rejection; inspect the actual request error.
Q: How do I resolve 402 quota_exceeded?
Q: How do I resolve 402 quota_exceeded?
Confirm the request channel first. Check subscription status and Credits for Step Plan, or account balance and credits for the standard API.

