Every DisSysLab office that uses an AI analyst needs an Anthropic API
key. This guide walks you through getting one and putting it where
dsl run can find it.
Time required: about 3 minutes.
Open console.anthropic.com and create an API key. Paid accounts get higher rate limits; a free account works for the gallery offices.
Your key starts with sk-ant- and is about 100 characters long.
Copy the whole thing to your clipboard. Anthropic only shows it
once — if you close the window you will need to generate a new one.
DisSysLab reads the key from a file named .env in your office folder.
The fastest way to create it — on macOS, with the key still on your
clipboard:
cd path/to/your/office
echo "ANTHROPIC_API_KEY=$(pbpaste)" > .envThat's it. The file now contains exactly one line that looks like:
ANTHROPIC_API_KEY=sk-ant-api03-...(about 100 chars)...
On Linux the equivalent is xclip -o or xsel -b instead of
pbpaste. On Windows (PowerShell):
"ANTHROPIC_API_KEY=$(Get-Clipboard)" | Out-File -Encoding utf8 .envOpen .env in VS Code, nano, or any other plain-text editor.
Paste your key on a single line after ANTHROPIC_API_KEY=. Save.
Do not use TextEdit on macOS. TextEdit silently saves
.envas Rich Text Format (RTF), whichdsl runcannot read. If you've already used TextEdit, delete the file (rm .env) and recreate it with thepbpasteone-liner above, or with VS Code.
Run dsl doctor from the same folder:
dsl doctorYou should see:
Local .env:
[OK] .env format: ANTHROPIC_API_KEY present (prefix sk-ant-…, len 108)
Credentials:
[OK] ANTHROPIC_API_KEY: set (prefix sk-ant-…, len 108)
If anything says FAIL, jump to the next section.
dsl doctor prints a specific hint for each problem. The common ones:
TextEdit saved your file as rich text, not plain text. Fix:
rm .env
echo "ANTHROPIC_API_KEY=$(pbpaste)" > .envRe-copy your key to the clipboard first if needed.
You pasted terminal history into .env instead of a single
KEY=VALUE line. Same fix:
rm .env
echo "ANTHROPIC_API_KEY=$(pbpaste)" > .envThe file exists but doesn't have your key in it. Open .env and add
a line:
ANTHROPIC_API_KEY=sk-ant-api03-...
You probably copied only part of the key, or copied a placeholder.
Go back to console.anthropic.com,
copy the full key (starts with sk-ant-), and redo step 2.
The key was found but Anthropic rejected it. Either the key is revoked or you copied the wrong one. Generate a fresh key from console.anthropic.com and redo step 2.
Your shell is finding a different dsl binary than the one you just
installed. Check which one it's using:
which dsl
pip show dissyslab | grep -E '^(Version|Location)'If the which path is not inside the pip install location, you
probably forgot to activate your virtual environment:
source /path/to/your/venv/bin/activate
dsl --versionEach office folder gets its own .env. dsl run path/to/office/
looks for .env inside that folder. If you share one key across
several offices, you can either:
-
Copy
.envinto each office folder, or -
Export the key in your shell once, so every office picks it up:
export ANTHROPIC_API_KEY=sk-ant-api03-...(Add that line to
~/.zshrcor~/.bashrcto make it permanent.)
Last reviewed for DisSysLab v1.1.3.