Skip to main content
This guide explains how to connect Step models to Claude Code through the Messages API, configure Step Plan, reasoning effort, and a 1M context window, and verify conversations and tool calls.

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.
Before installing through npm, check that Node.js and npm are available:

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:
After installation, verify the version:
Client compatibility was checked with Claude Code 2.1.209. The installation command installs the latest release; model alias resolution and context handling can vary by version.

Create the Configuration File

The commands below download the English scripts from the official Step repository, 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.
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 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:
To save a default, merge effortLevel into the top level of ~/.claude/settings.json, not into env:
Restart Claude Code after saving. If the setting does not take effect, check 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:
Notes:
  • CLAUDE_CODE_MAX_CONTEXT_TOKENS tells Claude Code to measure usage against a 1M window. Use the plain number 1000000. Do not write 1M or 1000k.
  • CLAUDE_CODE_AUTO_COMPACT_WINDOW aligns the auto-compact window to 1M. Valid range is 100000–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 /context and 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.
The official setup script does not write these two fields. Add them to env yourself after running the script.

Start Claude Code

Enter any code project directory:
Start Claude Code:
If Do you want to use this API key? appears on first launch, select Yes.

Test the Integration

Verify Client Conversations

  1. Save the configuration, quit Claude Code completely, and restart it.
  2. Run /status to check the model, authentication, and configuration source.
  3. 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. Create hello.py containing a statement that prints Hello, world!, then send Claude Code this task:
Approve the required operations, then check the file-reading, editing, and execution records and both outputs. Ask a follow-up question to confirm that the conversation retains the task context.

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

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:
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.
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.
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.
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.
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.
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.
Confirm the request channel first. Check subscription status and Credits for Step Plan, or account balance and credits for the standard API.
For further help, provide the client version, error details, time of the failure, redacted configuration, and request ID to support.