> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-docs-1917.mintlify.site/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>
