Skip to main content
web agent needs a model profile or one-off model flags. Model setup is separate from your Webcompute API key and from SDK application configuration.

Interactive setup

web model setup
The guided setup starts with:
Set up an AI model for web agent browsing.

Choose a provider and model, then save them as a model profile for use with the web agent CLI or MCP when run_web_agent is enabled.

Your API key is read from your environment and not stored here.
A model profile stores the provider route, model ID, and the name of the environment variable containing your provider key. It does not store the raw provider key. After saving a profile named browsing, run:
web agent --profile browsing --url https://example.com "Tell me the page title."
web model doctor browsing
web mcp setup codex --surface all --model browsing
The MCP command is needed only when you want MCP to expose run_web_agent on the agent or all surface. Inspect profiles later:
web model list
web model show browsing
web model show browsing --sdk
web model doctor browsing
Use web model show <profile> --sdk to regenerate copy-paste SDK code that uses the same route, model, and env-var name explicitly. Use web model use <profile> when you have more than one saved profile:
web model use browsing

One-off model flags

Pass model access directly when you do not want to save a profile:
web agent \
  --route openrouter \
  --model openai/gpt-5.4-mini \
  --api-key-env OPENROUTER_API_KEY \
  --url https://www.sec.gov/edgar/search/ \
  --allow-domain sec.gov \
  "Find Apple's latest 10-Q filings."
Supported routes:
RouteUse it for
openaiOpenAI API keys
openrouterOpenRouter model routing
openai-compatibleOpenAI-compatible gateways
anthropicAnthropic API keys
googleGoogle Gemini API keys
For compatible gateways, use --model-api chat-completions or --model-api responses when the gateway needs an explicit API family.

Environment variables

Provider keys should live in environment variables:
export OPENROUTER_API_KEY=your_provider_key
The CLI stores the environment variable name in the model profile. It does not need the raw provider key in your browsing goal. For scripted setup, pass all required values:
web model setup \
  --name browsing \
  --route openrouter \
  --model openai/gpt-5.4-mini \
  --api-key-env OPENROUTER_API_KEY \
  --default
web model setup --json is non-interactive and machine-readable. Add --quiet to a fully specified setup command when scripts should save the profile without success prose or SDK snippets.

Where model profiles apply

Model profiles are used by:
  • web agent.
  • MCP when run_web_agent is enabled on the agent or all surface.
SDK web.agent() requires explicit model config. SDK code can use the same route, model, and credential env-var values. The SDK model-profile helpers work with profile-shaped config supplied by your application code; they do not load local CLI config. Reference: CLI command reference.