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
browsing, run:
run_web_agent on the agent or all surface.
Inspect profiles later:
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:
One-off model flags
Pass model access directly when you do not want to save a profile:| Route | Use it for |
|---|---|
openai | OpenAI API keys |
openrouter | OpenRouter model routing |
openai-compatible | OpenAI-compatible gateways |
anthropic | Anthropic API keys |
google | Google Gemini API keys |
--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: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_agentis enabled on theagentorallsurface.
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.