SophNet Key
Overview
Resolve and persist SOPH_API_KEY for SophNet-authenticated scripts.
When to Use
- A script fails with missing/invalid API key errors.
SOPH_API_KEYexists in config but is not exported in current shell.- Key works in one terminal but disappears in new sessions.
- Do not use when key is already present and valid in environment.
Quick Reference
| Goal | Command |
|---|---|
| Check and resolve key | bash {baseDir}/scripts/get-key.sh |
| Print key only (for scripts) | bash {baseDir}/scripts/get-key.sh --output-quiet |
| Interactive persistent setup | bash {baseDir}/scripts/setup-key.sh |
Resolution order:
- Existing
SOPH_API_KEYin environment. - Moltbot config (
MOLTBOT_CONFIGor~/.clawdbot/moltbot.json). - Interactive setup flow.
Implementation
- Run
get-key.shfirst. - If unresolved, run
setup-key.shand reload shell profile. - Retry the original caller command.
Common Mistakes
- Expecting persistence without reloading shell profile.
- Using normal output mode in automation that expects raw key value only.