Model Provider

Use Anthropic, OpenAI or OpenRouter with your own credential. The provider bills you, Link adds nothing, and your agent never holds the credential.

Add your key

Start your agent with the provider's credential in its variable, or let it ask for one.

ANTHROPIC_API_KEY=sk-ant-... lnk agent start   # or OPENAI_API_KEY or OPENROUTER_API_KEY, else it asks
lnk agent start --model claude-sonnet-5-5      # another model the provider has

Its default model

With a credential and no --model, every harness gets claude-haiku-5-5 on Anthropic, gpt-6-luna on OpenAI and anthropic/claude-haiku-5.5 on OpenRouter, each $0.10 a million tokens in and $0.50 out. Every flag is in Switch Models.

Your key never reaches your agent

lnk agent secret says whether the harness holds its keys, or Link's proxy adds them on the wire.

lnk agent secret wire      # the proxy adds the keys, and the agent restarts
lnk agent secret agent     # the harness holds the keys again

Keys on the wire

With wire, the harness gets placeholders, and Link's proxy, which runs outside the sandbox, adds the real model credential on the way to the provider. It adds the real Telegram bot token on the way to Telegram the same way, and nothing in the sandbox can find either.

Which harnesses

Link Harness runs this way by default, and so does every other harness whose adapter says it can, which includes OpenClaw, Hermes Agent and DeepSeek Harness. Any other holds its keys until you switch it. Link Harness never holds a bot token, because Link carries its connections.

Where it works

It works for Anthropic, OpenAI and OpenRouter credentials. With a local model or --network-mode host, the setting is kept and does nothing. If a request fails with the placeholder, lnk agent secret agent puts the key back.

A key left behind

lnk agent harness check reports LEAK if the real key or token is still in the harness's home. What the proxy passes and refuses is in Security.

Link ships a model's window, the longest answer it writes, how it's asked to think and what it costs, refreshed at every release for the models OpenRouter lists. A model newer than your Link, or a figure that's wrong, is yours to add or correct, and yours wins field by field.

lnk model show                      # every known model, and whose each figure is
lnk model show claude-sonnet-5-5     # one
lnk model show --json               # the full facts inventory

Your own figures

Yours are in ~/.lnk/model-facts.toml, each model by the name it's found by, its figures over Link's.

# ~/.lnk/model-facts.toml
[model."my-finetune"]                 # a model, by its provider's or a router's name
window = 65536                        # its whole window, the answer included, in tokens
answer = 8192                         # the longest answer it writes
thinking = "no"                       # adaptive, budget, effort or no
price = { input = 0.2, output = 0.6 } # dollars a million tokens; cached, too, if it has one

[model."claude-sonnet-5-5"]
window = 500000                       # corrects Link's figure, keeps the rest

How a model is found

A model is found by its own name, with a router's prefix such as anthropic/claude-sonnet-4.6, with a dated snapshot's suffix, or with . for -. Every harness is handed the facts of its agent's model. Why they're data and where they come from is in Decisions.