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

# Configuration

> Every environment variable the SDK reads, its default, and when to change it.

The SDK is configured entirely through the environment (or the corresponding
`wrap()` arguments). Explicit arguments win over environment variables, which
win over defaults.

## Connection

| Variable            | Default                      | Purpose                                                                                     |
| ------------------- | ---------------------------- | ------------------------------------------------------------------------------------------- |
| `VISCERAL_API_KEY`  | —                            | Workspace API key (`vsc_live_...`). Without it, `wrap()` returns the client uninstrumented. |
| `VISCERAL_BASE_URL` | `https://api.visceralai.dev` | Backend base URL.                                                                           |

## Export tuning

Telemetry is batched and exported in the background; these bound how long
Visceral will ever wait on the network.

| Variable                   | Default | Purpose                                                         |
| -------------------------- | ------- | --------------------------------------------------------------- |
| `VISCERAL_EXPORT_TIMEOUT`  | `5`     | Export timeout, seconds. Also bounds the flush at process exit. |
| `VISCERAL_EXPORT_INTERVAL` | `5`     | How often the batch exporter ships spans, seconds.              |

## Behavior switches

| Variable                           | Default  | Purpose                                                                                                                                                                                                                                        |
| ---------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `VISCERAL_HEURISTIC_STRIP`         | `1` (on) | Third-tier heuristic content stripping — removes attributes whose names *look* like content (`.text`, `.body`, `.query`, …) on top of the exact-match redaction vocabulary. Leave on unless a preserved metadata field is being over-stripped. |
| `VISCERAL_STREAM_USAGE`            | `1` (on) | On OpenAI streaming calls, asks the API to include token usage and strips that extra bookkeeping chunk before your code sees the stream. Output is unchanged; without it, streamed calls report no token counts.                               |
| `VISCERAL_APPLY_RULES_TTL_SECONDS` | `60`     | How often the SDK refreshes optimization rules when [`apply=True`](/sdk/optimization).                                                                                                                                                         |
| `VISCERAL_ALLOW_PROXY_AND_SDK`     | unset    | The SDK skips instrumenting a client that is already routed through a Visceral capture proxy, to avoid double-counting. Set to `1` to force both.                                                                                              |

<Note>
  Redaction itself has no off switch. The exact-match content vocabulary is
  always stripped before export — `VISCERAL_HEURISTIC_STRIP` only controls the
  extra pattern-based backstop on top of it. See
  [Privacy & data](/concepts/privacy).
</Note>
