LLLanyard

Guides

Share LLLanyard across your devices or with your team

One machine holds your real API keys. Every other device, or every member of your team, gets a placeholder token that only works through that machine. Nothing goes to a cloud service: the keys stay in that one machine's keychain or encrypted vault, and the other devices only ever hold tokens.

The set-up is the same for both. Only who the tokens are for changes.

What you need

The other devices don't need LLLanyard at all. Their tools just need an address and a token.

1. Get a name and a certificate

Choose one of these:

Keep the certificate's private key readable only by the account that runs LLLanyard: chmod 600 key.pem. LLLanyard refuses to start if other users can read it.

2. Start the shared proxy

On the key machine, add your keys as usual (lllanyard add anthropic, lllanyard add openai), then:

lllanyard serve --host 0.0.0.0 --port 3443 \
  --tls-cert cert.pem --tls-key key.pem \
  --allow-host keys.example.com

--allow-host must be the exact name the devices use, such as your .ts.net name or keys.example.com. Requests that use any other name are refused, which protects against DNS rebinding. You can give --allow-host more than once.

Only let your own network reach port 3443: allow it in the machine's firewall from your office or Tailscale addresses, and don't forward it from your router to the internet. After 10 wrong tokens in 10 minutes, an address is locked out for 15 minutes. That lockout is a second line of defence, not a reason to expose the port.

3. Make a token for each tool

Each AI tool on each device gets its own token, and each one counts as one agent. Pro allows 10 per user. Team has no limit.

lllanyard agent create laptop-claude-code --providers anthropic --expires 90d
lllanyard agent create alice-cursor --providers openai --expires 90d

Each token is shown once. --providers limits which keys a token can use, and --expires makes it stop working after the time you give. For agency or client work, --client acme limits it to the keys you added with --label acme.

4. Point each tool at the shared proxy

On the other device, set the tool's base URL to the key machine and use the token as its API key. For Claude Code:

export ANTHROPIC_BASE_URL=https://keys.example.com:3443/anthropic
export ANTHROPIC_API_KEY=lly_…        # the token, not your real key

For the OpenAI SDK and tools built on it:

export OPENAI_BASE_URL=https://keys.example.com:3443/openai/v1
export OPENAI_API_KEY=lly_…

Other providers use https://keys.example.com:3443/<provider>. The token is useless anywhere else, so it's safe on a device you might lose.

Running it as a server (Team)

A server with no desktop login has no OS keychain, so use the encrypted file vault. Make a passphrase file that only root can read:

sudo mkdir -p /etc/lllanyard
openssl rand -base64 32 | sudo tee /etc/lllanyard/pass >/dev/null
sudo chmod 600 /etc/lllanyard/pass

Add keys and tokens with the vault switched on:

export LLLANYARD_BACKEND=file LLLANYARD_VAULT_PASSPHRASE_FILE=/etc/lllanyard/pass
lllanyard license activate lly1.…
lllanyard add anthropic --stdin < key.txt && shred -u key.txt

Then run it as a service, so it starts with the server. A systemd example, /etc/systemd/system/lllanyard.service:

[Unit]
Description=LLLanyard shared proxy
After=network-online.target
Wants=network-online.target

[Service]
User=lllanyard
LoadCredential=pass:/etc/lllanyard/pass
Environment=LLLANYARD_BACKEND=file
Environment=LLLANYARD_VAULT_PASSPHRASE_FILE=%d/pass
ExecStart=/usr/bin/lllanyard serve --host 0.0.0.0 --port 3443 --tls-cert /etc/lllanyard/cert.pem --tls-key /etc/lllanyard/key.pem --allow-host keys.example.com
Restart=on-failure

[Install]
WantedBy=multi-user.target

Run the key and token commands as the same lllanyard user, so they use the same vault (by default ~/.lllanyard/vault.enc; set LLLANYARD_VAULT_PATH to choose another place). Then run sudo systemctl enable --now lllanyard. The certificate and its key must be readable by that user. Renew the certificate before it runs out, then restart the service.

Day to day

Honest limits

Anyone who can log in to the key machine as the account running LLLanyard can reach the keys, so keep that machine locked down. LLLanyard ignores X-Forwarded-For, so a reverse proxy in front makes every device look like one address in the logs and the lockout. The security model covers this in full.

More guides