Skip to main content
Claude Code is an AI coding assistant that runs in the terminal and can complete tasks such as code generation, debugging, refactoring, and engineering management through natural language commands. By configuring the API interface, Claude Code can forward model invocation requests to a custom AI service. This document explains how to complete the Step API integration configuration in Claude Code and verify whether the model is available.

Overview

Claude Code is suitable for developers who prefer terminal-based workflows. After configuration is complete, you can directly drive coding tasks with natural language in local projects.

Prerequisites

Operating System

Claude Code supports the following systems:
  • macOS
  • Linux
  • Windows (PowerShell or Windows Terminal is recommended)

Node.js Environment

Claude Code depends on Node.js to run. It is recommended to install Node.js >= 18. Examples of installation methods for different systems:
  • macOS: use Homebrew or nvm
  • Linux: use the system package manager or nvm
  • Windows: use the official Node installer or Chocolatey
Example commands:
brew install node
nvm install 18
sudo apt install nodejs npm
choco install nodejs
After installation, run the following commands to confirm the environment:
node -v
npm -v

Subscribe to Step Plan

Before you start configuring, make sure your current account has an active Step Plan subscription. Only accounts with the required plan or calling permissions can use model calls and quotas normally. To subscribe or purchase, visit Step Plan subscription

Obtain a Step API Key

Before calling the model, you need to obtain an API Key from the Step Open Platform first. It is recommended to create a new key through the console and avoid hardcoding it into the code repository. Recommended practices:
  • Store the key in environment variables
  • Or manage the key through a local configuration file

Configuration Steps

Install Claude Code

Run in the terminal:
npm install -g @anthropic-ai/claude-code
After installation, verify the version:
claude --version

Create the Configuration File

Claude Code reads the API service address and authentication information through a configuration file. The configuration file location is:
~/.claude/settings.json
If the file does not exist, you can create the directory and file first:
mkdir -p ~/.claude
touch ~/.claude/settings.json
Write the following content into the configuration file:
{
  "env": {
    "ANTHROPIC_API_KEY": "YOUR_API_KEY",
    "ANTHROPIC_BASE_URL": "https://api.stepfun.ai/step_plan"
  },
  "model": "<model_id>"
}
Parameter description:
  • ANTHROPIC_API_KEY: enter your Step API Key
  • ANTHROPIC_BASE_URL: enter https://api.stepfun.ai/step_plan
  • model: enter <model_id>
Note: In the examples below, replace <model_id> with either step-3.5-flash-2603 or step-3.5-flash.
After saving, it is recommended to reopen the terminal to make the configuration take effect.

Start Claude Code

Enter any code project directory:
cd your-project
Start Claude Code:
claude
If Do you want to use this API key? appears on the first startup, select Yes.

Test the Integration

After entering Claude Code, first run the following command to view the current configuration status:
/status
Confirm that the following information is correct:
  • API Key is loaded
  • Base URL is correct (https://api.stepfun.ai/step_plan)
  • The default model name is correct (<model_id>)
Then run the test instruction:
write a minimal python hello world program into hello.py
If Claude Code successfully creates the file and writes the code, the model integration is successful.

Common Issues

Model Does Not Exist

Example error:
model does not exist
Possible reasons:
  • The model name is entered incorrectly (<model_id>)
  • The current account does not have permission for this model
  • The Base URL points to the wrong interface (https://api.stepfun.ai/step_plan)

Invalid API Key

Example error:
401 invalid_api_key
Possible reasons:
  • The API Key was entered incorrectly
  • The key has expired or been deleted
  • The key does not match the current API domain

Insufficient Quota

Example error:
402 quota_exceeded
This usually means the current account has used up its calling quota, and you need to add balance or upgrade the plan.

Changes Do Not Take Effect After Modifying the Configuration

It is recommended to check:
  1. Whether Claude Code has been fully restarted.
  2. Whether the JSON format of the configuration file is correct.
  3. Whether the terminal environment variables have been refreshed.

Summary

After configuration is complete, Claude Code can use the Step API to initiate model calls in the terminal for code generation, debugging, and development workflow automation. It is recommended to first verify the configuration with /status and a minimal task before using it in a real project.