Skip to content
Documentation

Models

Providers, credentials, and pointing Forge at a gateway.

Forge has no model of its own and no server in the middle. You supply a credential, and the CLI talks to that endpoint from your machine. Nothing about a task leaves your shell except the request to the provider you configured.

Providers

--providerwhat it does
anthropic
The default. Any Claude model your credential can reach.
fake
A scripted provider used by the test suite. Makes no network calls - useful for exercising the loop without spending tokens.

Both sit behind one provider interface, which is where additional providers will be added. Only these two exist today; if you need a different vendor now, put a gateway in front of Forge rather than waiting for a native provider.

Choosing a model

There is no default model - Forge will not guess what you want to be billed for. Set one in your shell profile, or pass --model for a single run.

$ export ANTHROPIC_MODEL="claude-sonnet-4-5"$ forge "add a retry to the webhook client" # or, just for this run$ forge --model claude-opus-4-5 "refactor the scheduler"

Model ids are passed through untouched, so a new model works the day it ships without upgrading Forge. Starting a session with no model configured exits with code 2 rather than falling back to something arbitrary.

Which one to use

  • A mid-tier model is the right default. Most of the loop is reading files and running commands, and it handles that at a fraction of the cost.
  • Reach for the strongest model on tasks that are genuinely hard to reason about - a subtle bug, a refactor that spans packages, anything where a wrong plan wastes many iterations.
  • Smaller models tend to fail in a specific way: they stop early and declare success. If a model keeps reporting work it did not verify, that is the signal to move up.

Credentials

Either an API key or a bearer token works. Forge reads the FORGE_ variables first, then the ANTHROPIC_ equivalents, so an existing setup needs nothing new.

variablepurpose
ANTHROPIC_API_KEY
Standard API key. Also FORGE_API_KEY.
ANTHROPIC_AUTH_TOKEN
Bearer token, for gateways that issue their own. Also FORGE_AUTH_TOKEN.
ANTHROPIC_BASE_URL
Point at any Anthropic-compatible endpoint. Also FORGE_BASE_URL.

Keep credentials in the environment or a secret manager. forge config redacts them on the way out, but a forge.toml you commit is a file you have published.

Pointing at a gateway

Because the base URL is configurable, anything that speaks the Anthropic API works - an internal proxy, a billing gateway, a local router, or a logging layer your team already runs.

$ export ANTHROPIC_BASE_URL="https://gateway.internal/v1"$ export ANTHROPIC_AUTH_TOKEN="$GATEWAY_TOKEN"$ export ANTHROPIC_MODEL="claude-sonnet-4-5"$ forge config

Forge does not care what is on the other end. If the gateway rewrites model names, use the names it expects.

Token use and limits

  • --max-tokens caps output tokens per model call. It bounds a single reply, not the run.
  • --max-iterations bounds the run. This is the control that decides what a runaway task can cost you.
  • Long sessions compact their own context rather than failing at the window limit, so early history is summarised as a run goes on.
  • Every run prints duration, model calls, tool calls, and token usage when it finishes. Read it a few times and you will know what a task costs before you start one.

Forge is MIT licensed and free. Model usage is not - you are billed by whoever issued your credential, at their rates. See the FAQ for what a typical task looks like.