Storing API keys for Claude Code providers in KeePassXC

Storing API keys for Claude Code providers in KeePassXC 图片 1

A growing number of providers expose Anthropic-compatible API endpoints for Claude Code:

MiniMax

Z.AI

DeepSeek

Moonshot/Kimi

Alibaba/DashScope

OpenRouter

They all work the same way: set ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN, and Claude Code talks to them instead of Anthropic. Their docs typically suggest putting the key straight into ~/.claude/settings.json:

jsonCopy That, unfortunately, involves saving a plaintext secret on disk. Plaintext secrets anywhere near Claude Code are risky – it has beenknown to read .env files and leak their contents into session transcripts and tool-result logs under ~/.claude/, and settings.json itself is no safer. A popular workaround is a ~/.secrets file sourced from your shell profile, but that still means the key is stored in plaintext, just somewhere else.

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论