Overview

Fast path: a decision API key

Routine decisions are made by the fast path, a decision model, which needs one API key: TypeSafe, OpenRouter, Gemini or OpenAI.

Overview#

Routine decisions are made by the fast path, a decision model, which needs one API key from any of four labs: TypeSafe (Jev), OpenRouter, Google (Gemini) or OpenAI. With several keys set, the runtime uses all of them as a failover chain, TypeSafe first, then OpenRouter, Gemini and OpenAI. Without a key you can still run everything with the offline baseline (--provider keyword), but that is a deterministic demo baseline, not the decision model.

  • Create a key with one lab: TypeSafe (typesafe.ai), OpenRouter, Google AI Studio or OpenAI. The examples below use TypeSafe; the others are OPENROUTER_API_KEY, GEMINI_API_KEY and OPENAI_API_KEY.
  • Store it in the environment — pick one of the options below.
  • Verify with mlola browser config check: every provider in the chain is asked one probe question and should answer CLICK 2.
Option 1 — export in your shell (persists per session)
export TYPESAFE_API_KEY="tsk_..."
mlola browser doctor
Option 2 — make it permanent (zsh)
echo 'export TYPESAFE_API_KEY="tsk_..."' >> ~/.zshrc
source ~/.zshrc
Option 3 — inline for a single run (CI friendly)
TYPESAFE_API_KEY="tsk_..." npx @mlola/browser-cli browser run \
  --goal "Download my latest invoice" \
  --url https://billing.example.com/invoices
Option 4 — .env file (your runner must load it)
# .env
echo 'TYPESAFE_API_KEY=tsk_...' > .env
node --env-file=.env ./node_modules/.bin/mlola browser run --goal "..."
Option 5 — config file (recommended, nothing to export)
mlola browser config init          # writes mlola.config.json
mlola browser config show          # what the file says + what actually resolved

# with only an OpenRouter, Gemini or OpenAI key, there is nothing else to set:
export OPENAI_API_KEY=...
mlola browser run --goal "Download my latest invoice" --url https://...

Overriding the endpoint or model#

VariableDefaultPurpose
TYPESAFE_API_KEY—Jev credential: one decision key (OPENROUTER_API_KEY, GEMINI_API_KEY or OPENAI_API_KEY also work)
MLOLA_JEV_BASE_URLhttps://api.typesafe.aiAPI base URL
MLOLA_JEV_MODELjev-latestModel id sent in the request
MLOLA_JEV_TIMEOUT_MS20000Per-request timeout

Choosing the decision provider#

Provider selection
mlola browser run --provider typesafe …   # fast path (needs a key)
mlola browser run --provider keyword  …   # offline baseline, no key required