when i export the token and url, it usually works fine as a standard bash user for sandbox and dangerously skip permissions (not right now, as i’m getting a connectivity error, wondering if the api is even up). however, when i run it as root, it doesn’t pick up my exported api key or url, it defaults to my claude.ai config (anthropic), which i have no idea where that’s stored.
so:
unset ANTHROPIC_AUTH_TOKEN
export ANTHROPIC_BASE_URL=https://api.moonshotai/anthropic
export ANTHROPIC_AUTH_TOKEN=sk-MY_MOONSHOT_K2_API_KEY
IS_SANDBOX=1 claude --dangerously-skip-permissions
works fine as a standard user, but not as root. i’d like to run it as root.
what’s odd is that sometimes in claude code, the api completely stops. not sure how else to describe it. no errors, no issues, it starts running my instructions, then just halts with no output and a ready prompt. super odd. i ask it to “continue” and it does, for a few seconds, then stops again.