> ## 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.

# 同じマシンでアカウントを切り替えるにはどうすればよいですか？

同じマシンで 2 つの W\&B アカウントを管理するには、両方の APIキーをリポジトリの外部にあるファイルに保存し、実行時に必要なキーを読み込みます。この方法により、シークレットキーをソース管理から除外できます。

```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">[環境変数](/ja/support/models/tags/environment-variables)</Badge>
