Skip to content

Getting an Anthropic API Key

Stuart Meeks edited this page Jun 21, 2026 · 2 revisions

Getting an Anthropic API key

The foreman talks to Claude through the Anthropic API, which needs an API key. You can either give the key to the server once (so everyone using it is covered), or paste your own key into the web app. Either way, usage is billed to whoever owns the key — so keep it secret.

An API key is not the same as a Claude.ai subscription. The API is billed separately, by usage (per token).

Prefer OpenAI or another provider? See Getting an OpenAI API key.

Create a key

  1. Go to the Anthropic Console and sign in, or create an account.
  2. Add credit under Billing (the API runs on prepaid credits — a small top-up is plenty to try the foreman).
  3. Open Settings → API keys and choose Create key.
  4. Give it a name (for example FICSIT Foreman) and create it.
  5. Copy the key now — it is shown only once. It starts with sk-ant-.

Use the key

Pick one of these:

  • In the web app (easiest for trying it out). Open the foreman at http://localhost:8725, click Settings, and paste the key into the Anthropic API key field. It is stored only in your browser and sent with each message — never saved on the server.

  • On the server (covers everyone, no per-user key). Set ANTHROPIC_API_KEY in your .env before starting the stack:

    ANTHROPIC_API_KEY=sk-ant-...

    See Configuration for the full list of variables. With a server key set, the web app works without anyone entering their own.

If both are present, the key entered in the web app takes precedence for that browser.

Cost and safety

  • You are billed per token of usage. The foreman uses a capable model for chat and a cheaper model for background session summaries, to keep costs down.
  • Treat the key like a password: don't commit it to git or share it. The web app keeps it only in your browser; the server reads it from .env, which is git-ignored.
  • You can revoke or rotate a key any time from Settings → API keys in the Anthropic Console.

Clone this wiki locally