Connect Claude Code to DotProd
Use your enabled DotProd open-weight model from Claude Code, with credentials stored in macOS Keychain and persistent settings that load automatically in every new terminal session.
DotProd serves an Anthropic Messages-compatible endpoint at POST /v1/messages (including ?beta=true) and POST /v1/messages/count_tokens through the same virtual-key auth, content screening, encrypted capture, and prepaid credit ledger as /v1/chat/completions. DotProd serves open-weight models under their real workspace IDs (for example up_quark, down_quark, strange_quark) rather than Claude models; multimodal image/document attachments and Anthropic server-hosted tools (such as web search) are rejected explicitly with HTTP 400.
- You’ll need
- A DotProd virtual key (
sk-...) and an enabled model ID - This guide covers
- Claude Code CLI on macOS (
~/.claude/settings.json) - Your key goes
- Into macOS Keychain, via a hidden terminal prompt
Choose your connection settings
Select a model enabled for your workspace or enter its exact DotProd ID. The display name is only a label in Claude Code’s /model picker. These fields stay in browser memory while the page is open.
Do not enter API keys in this page. The generated configuration contains public connection metadata only.
Store your DotProd API key
Open Terminal and run the command below. With -w last, macOS security prompts for the key privately without echoing it to your shell history. Enter your DotProd virtual key (sk-...) at the password prompt.
security add-generic-password \ -U \ -a "$USER" \ -s dotprod-claude-code \ -w
Run the same command again whenever you rotate your virtual key. macOS may ask you to authorize Keychain access.
Create the credential helper
This helper script lets Claude Code read your virtual key from macOS Keychain. Its standard output must contain only the credential.
mkdir -p "$HOME/.local/bin" cat > "$HOME/.local/bin/dotprod-claude-key" <<'SH' #!/bin/sh exec /usr/bin/security find-generic-password \ -a "$USER" \ -s dotprod-claude-code \ -w SH chmod 700 "$HOME/.local/bin/dotprod-claude-key"
If that helper file already exists, inspect it before replacing it. Avoid running it directly in a shared or recorded terminal because it prints your key.
Save the configuration for future sessions
Merge the generated JSON keys into ~/.claude/settings.json. Keep any unrelated permissions, hooks, and settings intact. Back up the existing file before editing.
mkdir -p "$HOME/.claude"
if [ -f "$HOME/.claude/settings.json" ]; then
cp -p "$HOME/.claude/settings.json" \
"$HOME/.claude/settings.json.backup.$(date +%Y%m%d-%H%M%S)"
fi
What these settings do
apiKeyHelperretrieves your DotProd virtual key from macOS Keychain.ANTHROPIC_BASE_URLpoints Claude Code to the DotProd gateway root (/v1/messagesis appended automatically).modelsets the default model ID for new sessions.ANTHROPIC_CUSTOM_MODEL_OPTIONadds your named DotProd model to the/modelpicker.- The default alias and subagent variables (
ANTHROPIC_DEFAULT_*_MODEL,CLAUDE_CODE_SUBAGENT_MODEL) route those roles to your chosen DotProd model so background tasks do not fall back to unconfigured Claude IDs. Explicit agent definitions, project settings, or managed policies can take precedence.
Check for previous base URLs, static authentication variables (ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN), another credential helper, provider-mode variables, and shell launchers such as claude-v2. Resolve conflicts so new sessions use your intended DotProd gateway and model.
If availableModels restricts your model list, include the exact DotProd model ID in that allowlist. Keep the model’s real context and tool capabilities aligned with your workspace’s configuration.
Verify a fresh Claude Code session
Open a brand-new terminal window after saving ~/.claude/settings.json. These manual checks confirm that the setup survives across new shells without temporary environment variables.
claude --version claude
0 of 8 manual notes checked.
Checklist selections are manual personal notes stored only in this page session. They do not execute automated checks or verify your account. Live inference and tool tests consume DotProd credits.
Maintain or remove the connection
Rotate a key
Create a replacement virtual key in your DotProd workspace, run the Keychain security add-generic-password -U ... command with the new key, restart Claude Code, and verify the replacement. Then revoke the old key in DotProd.
Choose another model
Use an enabled model ID from your workspace. Update model, ANTHROPIC_CUSTOM_MODEL_OPTION, and the default alias/subagent variables together if you want every role to switch. Restart Claude Code and confirm in /model.
Restore your previous setup
Restore your backed-up ~/.claude/settings.json or remove only the DotProd keys you merged. Revoke the virtual key in DotProd, delete the dotprod-claude-code item in Keychain Access, and remove ~/.local/bin/dotprod-claude-key when no session uses it.
Troubleshoot the connection
| What you see | What to check |
|---|---|
404 on /v1/messages |
Confirm that ANTHROPIC_BASE_URL is set to the gateway root (e.g. https://dotprod.tech) without a trailing /v1, and that the Anthropic adapter is deployed. |
400 invalid_request_error |
DotProd rejects multimodal image/document blocks, Anthropic server-hosted tools (like web_search_20250305), and policy-blocked content explicitly. Retry with plain text and standard client function tools. |
| 401 or 403 | Check key revocation, workspace status, enabled model permissions, and that ~/.local/bin/dotprod-claude-key outputs only your raw sk-... key. Contact security@dotprod.tech with the HTTP status and timestamp (never share your key). |
| 402 Payment Required | Check your DotProd prepaid credit balance and any active request holds in your workspace. |
The model is missing from /model |
Verify valid JSON syntax in ~/.claude/settings.json, check availableModels if configured, and restart Claude Code. |
| A new session uses the old provider | Inspect /status for an inherited shell variable (ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY), project-level .claude/settings.json override, managed policy, or custom wrapper such as claude-v2. |
| Text works but tool calls fail | Confirm the chosen open-weight model supports OpenAI-style function tool calling and verify tool schemas are valid JSON Schema objects. |
| The stream appears paused before text appears | DotProd buffers and screens complete model responses before emitting standard Anthropic SSE frames (message_start, content_block_delta, message_stop). Large responses wait until output safety screening completes. |
| Keychain access fails | Check that the Keychain item’s service (dotprod-claude-code) and account ($USER) match the helper, that the login keychain is unlocked, and that macOS permits access. |
Reference documentation
Anthropic’s documentation describes Claude Code gateway configuration and protocol compatibility. Routing to non-Claude open-weight models is outside Anthropic’s supported configurations, so DotProd validates and documents supported model capabilities independently.