> ## Documentation Index
> Fetch the complete documentation index at: https://platform.stepfun.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment variables

Environment variables identify Step Code subprocesses, control permissions and multiple agents, and inject temporary model configuration in CI or containers. Launch Step Code from the same terminal after setting them.

## Provider credentials

Each provider uses its own variables, such as `ANTHROPIC_API_KEY` and `OPENAI_API_KEY`. See [API key providers](https://platform.stepfun.ai/docs/en/step-code/configuration/models.md#api-key-providers).

```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
export STEP_API_KEY="YOUR_STEP_API_KEY"
```

Replace `YOUR_STEP_API_KEY` with your key and keep it out of commits. Saved accounts and custom provider settings also affect credentials; see [Authentication and models](https://platform.stepfun.ai/docs/en/step-code/configuration/models.md).

`STEP_BASE_URL` selects the Step model service endpoint. Match it to the account and billing channel; see [Step API endpoints](https://platform.stepfun.ai/docs/en/step-code/configuration/models.md#step-api-endpoints).

## Runtime switches

| Variable | Description |
| - | - |
| `STEP_PERMISSION_PRESET`, `STEP_APPROVAL_MODE` | Override permission mode; see [Permissions and safety](https://platform.stepfun.ai/docs/en/step-code/guides/permissions.md#permission-modes) |
| `STEP_DISABLE_WORKFLOW` | Set to `1` to disable workflow / ultraloop registration |

## Data and plan directories

| Variable | Purpose |
| - | - |
| `STEP_CODING_AGENT_DIR` | Agent resource root; its parent stores configuration, credentials, and model files |
| `STEP_CODING_AGENT_SESSION_DIR` | Session directory |
| `STEP_CODING_AGENT_PLAN_DIR` | Directory for new plan files, which can be outside the workspace; relative paths resolve from the working directory, and existing sessions keep their saved plan paths without automatic migration |

See [Data paths](https://platform.stepfun.ai/docs/en/step-code/configuration/data-paths.md) for the directory layout.

## Injecting models with environment variables

| Variable | Description |
| - | - |
| `STEPCODE_CONFIG_PATH` | JSON model configuration injected into the catalog at startup |
| `STEP_API_KEY` | Key variable for the built-in `step` provider |
| `STEP_MAX_CONTEXT_TOKENS` | Override the injected model's context window |
| `STEP_MAX_OUTPUT_TOKENS` | Override the injected model's maximum output |

Saving model and permission preferences writes back to the JSON file pointed to by `STEPCODE_CONFIG_PATH` rather than `models.json`; do not treat it as a read-only temporary model catalog.

Use injected configuration for temporary endpoints in CI or containers. Specify the required model capabilities and compatibility options to match the server.

See [Authentication and models](https://platform.stepfun.ai/docs/en/step-code/configuration/models.md) for persistent configuration.

## Proxies

Use `HTTP_PROXY` / `HTTPS_PROXY` for outbound proxies, or global `httpProxy` in `config.toml`. `NO_PROXY` matches hostnames or suffixes that bypass the proxy.

```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
export HTTPS_PROXY="http://127.0.0.1:7890"
export NO_PROXY="localhost,127.0.0.1"
step
```

Replace the port with your proxy's port. This example bypasses the proxy for loopback requests.

## Process marker

| Variable | Description |
| - | - |
| `AI_AGENT=step` | Lets external tools identify processes launched by Step Code |

Subprocesses inherit this marker. SDK embedding does not set it automatically.

## Telemetry

Telemetry is configured in global `config.toml`; see [Configuration files](https://platform.stepfun.ai/docs/en/step-code/configuration/files.md#telemetry). Model requests and manual feedback are managed separately.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.