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

# How do I switch between accounts on the same machine?

To manage two W\&B accounts from the same machine, store both API keys in a file outside your repository, then load the key you need at runtime. This approach keeps secret keys out of source control.

```python theme={null}
if os.path.exists("~/keys.json"):
    os.environ["WANDB_API_KEY"] = json.loads("~/keys.json")["work_account"]
```

***

<Badge stroke shape="pill" color="orange" size="md">[Environment Variables](/support/models/tags/environment-variables)</Badge>
