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

# environment-variables

> Configure Invoke's API key, base URL, and AI model settings using environment variables. Lists every variable the SDK and CLI read.

Invoke reads configuration from environment variables at startup. Set them in your deployment platform's environment settings or in a local `.env` file.

## Variables

### `INVOKE_API_KEY`

Your Invoke API key. Required for all SDK calls and CLI commands.

```bash theme={null}
INVOKE_API_KEY=your_api_key
```

The SDK also checks these fallback names in order:

1. `INVOKE_API_KEY` (canonical)
2. `NEXT_PUBLIC_INVOKE_API_KEY` (Next.js public env)

Always set `INVOKE_API_KEY` as the canonical variable. Use the fallback names only for incremental migration.

### `INVOKE_BASE_URL`

Override the Invoke API base URL. Defaults to `https://api.invokehq.run`.

```bash theme={null}
INVOKE_BASE_URL=https://api.invokehq.run
```

Only set this if you're pointing to a custom or self-hosted Invoke endpoint.

## Setting variables

### Local development (.env file)

```bash theme={null}
INVOKE_API_KEY=your_api_key
```

### Vercel

Go to your project → **Settings → Environment Variables** and add `INVOKE_API_KEY`.

### Other platforms

Set `INVOKE_API_KEY` in your platform's secrets or environment settings.

## Next steps

* [Authentication](/configuration/authentication) — how the API key is used
* [TypeScript SDK](/sdk/typescript) — how the SDK reads these variables
* [CLI](/sdk/cli) — how the CLI reads these variables
