Skip to content

LLM Providers ​

Shiplight's AI-powered features — natural language actions, self-healing locators, and VERIFY assertions — call an LLM. Deterministic YAML steps do not, so a test made only of explicit locators and assertions runs without any provider configured.

You have two ways to supply credentials:

  • Bring your own key from Anthropic, OpenAI, or Google. Simple, and you're billed by that provider.
  • The Shiplight LLM proxy, using a Shiplight API token instead of a provider key. One credential for all three providers, billed with the rest of your Shiplight usage.

Either way, put the values in a .env file in your project root — the CLI discovers it automatically. Keep .env in .gitignore.

Bring your own key ​

At least one of these is required. When WEB_AGENT_MODEL is unset, the default model comes from the first credential found in this order: GOOGLE_API_KEY, then Gemini on Vertex AI (see Routing through Vertex AI), then ANTHROPIC_API_KEY, then OPENAI_API_KEY.

VariableDescription
GOOGLE_API_KEYGoogle AI Studio key (Gemini models) — get a key
ANTHROPIC_API_KEYAnthropic API key (Claude models) — get a key
OPENAI_API_KEYOpenAI API key (GPT / o-series models)
OPENROUTER_API_KEYOpenRouter API key. Has no default model: also set WEB_AGENT_MODEL=openrouter:<vendor>/<model>, for example openrouter:anthropic/claude-sonnet-4.6

Choosing a model ​

These apply when you bring your own key — you pay the provider, so you choose the model. On the Shiplight LLM proxy the model is chosen by tier instead and these variables are ignored; see Choosing a tier.

VariableDescriptionDefault
WEB_AGENT_MODELWeb agent model, e.g. claude-sonnet-5. claude-*, gemini-*, and gpt-*/o* names pick their provider automatically; other names need a provider:model prefix: anthropic:, google:, openai:, or openrouter:Detected from the API keys set (see above)
WEB_AGENT_FALLBACK_MODELSComma-separated provider:model chain tried when the primary is unavailable. Set to an empty string ("") to disable it.A built-in cross-provider chain
WEB_AGENT_LLM_TIMEOUT_MSTimeout for each model request, in milliseconds. When it expires, the agent moves to the next fallback model. 0 disables it150000
COMPUTER_USE_MODELModel for coordinate-based computer-use actionsAuto-detected

The built-in fallback chain uses Anthropic and OpenAI models. Each fallback call needs credentials for its provider: your own key, or, when SHIPLIGHT_API_TOKEN is also set, the billed Shiplight proxy. With a Google key and no Shiplight token, the chain can't run, so set WEB_AGENT_FALLBACK_MODELS yourself or disable it.

WEB_AGENT_LLM_TIMEOUT_MS also applies on the proxy.

Custom endpoints ​

VariableDescriptionDefault
OPENAI_BASE_URLBase URL for OpenAI-compatible APIs such as Ollama, vLLM, or LiteLLM. Applies to both the regular LLM path and the computer-use path. Used only together with OPENAI_API_KEYhttps://api.openai.com/v1
ANTHROPIC_BASE_URLBase URL of a relay or gateway for direct Anthropic calls. /v1 is appended if missing. Used only together with ANTHROPIC_API_KEYAnthropic's API

Routing through Vertex AI ​

Set one of the *_USE_VERTEXAI flags to route a provider through Google Vertex AI instead of calling it directly. Either flag requires GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION, and expects GOOGLE_APPLICATION_CREDENTIALS (or Application Default Credentials) to be available.

VariableDescriptionDefault
ANTHROPIC_MODELS_USE_VERTEXAIRoute Anthropic (Claude) calls through Vertex AIfalse
GOOGLE_GENAI_USE_VERTEXAIRoute Google (Gemini) calls through Vertex AIfalse
GOOGLE_CLOUD_PROJECTGCP project ID (required when either flag is set)—
GOOGLE_CLOUD_LOCATIONGCP region, e.g. us-central1 (required when either flag is set)—

Shiplight LLM proxy ​

Instead of a provider key, you can authenticate with a Shiplight API token and let Shiplight call the provider:

bash
SHIPLIGHT_API_TOKEN=shp_pat_…

For local development, run the following command from your project:

bash
bun run shiplight setup-api-token

It authenticates you with Shiplight in the browser, creates or restores a personal token for the organization you select, and writes SHIPLIGHT_API_TOKEN to the project's .env file. This is Shiplight platform authentication, not authentication for the application under test; use /shiplight setup-test-auth for the latter.

Setting SHIPLIGHT_API_TOKEN is what puts the CLI in proxy mode. You can also create a token manually at app.shiplight.ai/api-tokens with the llm:invoke scope. For CI and shared automation, create an organization token rather than using the personal token produced by setup-api-token.

Provider keys take precedence

The CLI treats a provider API key as an instruction to use it directly. If ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_API_KEY, or OPENROUTER_API_KEY is present, or Vertex AI is configured (GOOGLE_GENAI_USE_VERTEXAI with GOOGLE_CLOUD_PROJECT), the CLI stops choosing models by tier and calls that provider directly, even when a Shiplight token is also set. To use the proxy for that provider, remove its credentials from your environment.

A provider key covers only its own provider. If a Shiplight token is also set and a model from another provider is used, for example a Gemini model named in WEB_AGENT_MODEL or the fallback chain with only ANTHROPIC_API_KEY set, that call still goes through the proxy and is billed. To keep every call off the proxy, remove SHIPLIGHT_API_TOKEN.

The proxy is part of the Shiplight API. With a shp_ token and no SHIPLIGHT_API_URL, the CLI calls the public service at api.shiplight.ai. A self-hosted or enterprise Shiplight service must set SHIPLIGHT_API_URL; see CLI Reference.

Choosing a tier ​

On the proxy, Shiplight picks the model and you pick a tier — whoever pays for the LLM calls chooses the model, and on the token path that is Shiplight. Set the tier with WEB_AGENT_TIER:

bash
WEB_AGENT_TIER=standard   # lite | standard | pro
TierBest for
liteFastest and lowest cost
standardA balance of capability and cost
proThe most capable models, for the hardest steps

When WEB_AGENT_TIER is unset, the run uses your organization's default tier: Enterprise organizations default to standard, and other plans default to lite. Shiplight can set a different default for your organization on request. These defaults come from your organization's settings, read at the start of each run; a run that can't load them falls back to lite. Shiplight maps each tier to a current model and manages cross-provider fallbacks for provider outages on your behalf; billing always reflects the model that actually ran. Coordinate-based computer-use actions are not tiered — Shiplight always selects that model.

WEB_AGENT_MODEL is ignored on the proxy

Because Shiplight chooses the model on the token path, WEB_AGENT_MODEL, WEB_AGENT_FALLBACK_MODELS, and COMPUTER_USE_MODEL have no effect when you authenticate with SHIPLIGHT_API_TOKEN and no provider key. The CLI prints a one-line notice when it ignores them, so the switch is never silent. To choose the model yourself, bring your own key instead — then you pick the model and pay the provider directly.

Usage visibility ​

Whichever option you choose, Shiplight records how many tokens your tests consumed and reports them in Usage, broken down by operation, provider, and model. What changes is whether a cost is attached:

RoutingWhen it appliesIn Usage
proxyCalls went through the Shiplight LLM proxyCounted and billed
byokYou supplied your own provider keyCounted, no cost
custom_endpointYou pointed OPENAI_BASE_URL at your own endpointCounted, no cost

Routing is detected per provider, so a run that uses a direct key for one provider and the proxy for another labels each correctly. Set SHIPLIGHT_USAGE_ROUTING to proxy, byok, or custom_endpoint to override the whole run.

Shiplight Cloud turns this usage data into practical cost guidance. Ask /shiplight cloud to analyze LLM token usage, identify what is driving cost, and suggest where to optimize. See Analyze usage with /shiplight cloud for details.

On CI ​

The same choice applies in CI: supply credentials as secrets, exactly as you would locally. Set either a Shiplight API token for the proxy, or a provider key:

yaml
jobs:
  e2e:
    runs-on: ubuntu-latest
    env:
      SHIPLIGHT_API_TOKEN: ${{ secrets.SHIPLIGHT_API_TOKEN }}   # the proxy
      # ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}     # or your own key

A provider key wins: when one is set, the CLI treats it as a direct-provider credential and stops using the proxy for that provider.

What this costs you

LLM calls the CLI makes with your own key are paid to your provider and don't draw down your Shiplight credit. When the run's report is uploaded to Shiplight Cloud (which needs a Shiplight token), their token counts still appear in Usage with no cost attached.

  • CLI Reference — every environment variable the CLI reads
  • API Tokens — token scopes and the proxy in detail
  • CI/CD — wiring credentials into your pipeline

Released under the MIT License.