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

# Environment variables

> Safe local environment variables for the SimpleFunctions CLI and direct API use.

This page covers variables a user or developer may set locally. Server-only deployment secrets are not part of the public docs contract.

## CLI runtime

| Variable                 | Purpose                                                        |
| ------------------------ | -------------------------------------------------------------- |
| `SF_API_KEY`             | API key override (takes precedence over config file)           |
| `SF_API_URL`             | Base URL override (default `https://simplefunctions.dev`)      |
| `SF_TRADING_ENABLED`     | Set to `true` to allow `sf buy/sell/cancel`                    |
| `SF_AUTO_CONFIRM`        | Set to `1` to bypass `confirmInteractive` (non-TTY agent flow) |
| `SF_DEBUG`               | Verbose logs to stderr                                         |
| `KALSHI_API_KEY_ID`      | Kalshi key id                                                  |
| `KALSHI_PRIVATE_KEY_PEM` | Kalshi PEM contents (alternative to file path)                 |
| `KALSHI_BASE_URL`        | Override Kalshi API base                                       |
| `POLYMARKET_WALLET`      | Wallet address override                                        |
| `DEFAULT_MODEL`          | LLM for `sf agent`                                             |
| `OPENROUTER_API_KEY`     | OpenRouter key for `sf agent`                                  |
| `ANTHROPIC_API_KEY`      | Anthropic key (alternative path)                               |

## Portfolio and exchange credentials

Exchange variables are optional. They are needed only for local exchange reads or live trading commands. Prefer `sf setup` for persistent local config because `sf status --json` can show which values are present without exposing secret material.

Do not put API keys or exchange private keys in public logs, prompts, client-side bundles, or CI output.

## Confirming environment

```bash theme={null}
sf status --json | jq '.env'
```

Returns which env vars the CLI sees set (values redacted).
