Gemini 3.5 Flash Agentic Computer Use Guide: Built-in Browser Tool, Managed Agents, and Routing Integration
Gemini 3.5 Flash ships computer use as a built-in tool — no separate model needed. This guide covers enabling computer_use_google, the Managed Agents background execution API, Interactions API with Flex Tier, safety guardrails, and how to route agentic Gemini workflows through TheRouter.
Google made computer use a first-class built-in tool inside Gemini 3.5 Flash on June 24, 2026 — the same model developers already use for function calling, Search grounding, and Maps. Before this, computer use required a separate preview model. Now a single google/gemini-3.5-flash call can see screenshots, reason about UI elements, and take action across browser, mobile, and desktop environments. Alongside that launch, Google shipped Managed Agents with background execution, remote MCP server integration, and the Interactions API at GA with Flex Tier pricing (50% cheaper, ~2-minute latency SLA). Together these three updates reshape how developers build and route agentic Gemini workflows.
google/gemini-3.5-flash is a verified model in TheRouter's catalog. We route requests to it through its OpenAI-compatible endpoint.
OpenAI-compatible means a provider exposes a chat-completions endpoint whose request and response shape matches the OpenAI API contract closely enough that an unmodified OpenAI SDK call works against it after swapping three values: API key, base URL, and model name. The minimum surface in practice is POST /v1/chat/completions with messages, model, and an OpenAI-shaped streaming response.
Sources: Google Blog — Introducing Computer Use in Gemini 3.5 Flash, retrieved 2026-07-21; Gemini API Computer Use Docs, retrieved 2026-07-21; Google DeepMind Managed Agents Update (the-decoder.com), retrieved 2026-07-21; Gemini API Pricing, retrieved 2026-07-21; BenchLM — Gemini API Pricing July 2026, retrieved 2026-07-21.
Getting Started in 3 Minutes
1. Get an API key
Create or retrieve your Gemini API key at ai.google.dev. Enable the Gemini API in your Google Cloud project if you plan to use the Enterprise Agent Platform.
2. Install the SDK
pip install google-genai
3. First computer-use call
from google import genai
from google.genai import types
client = genai.Client()
response = client.models.generate_content(
model="gemini-3.5-flash",
contents="Open the browser and navigate to therouter.ai",
config=types.GenerateContentConfig(
tools=[
types.Tool(
computer_use=types.ToolComputerUse(
environment=types.Environment(
browser=types.EnvironmentBrowser()
)
)
)
]
),
)
print(response.text)
That is all. The model sees the rendered page, reasons about which element to click, and returns a structured action. No separate computer-use model ID needed — gemini-3.5-flash handles it natively.
All Supported Models and Capabilities
| Capability | Gemini 3.5 Flash | Gemini 3.5 Pro | Gemini 3.1 Pro |
|---|---|---|---|
| Built-in computer use | Yes (native) | No | No |
| Function calling | Yes | Yes | Yes |
| Managed Agents | Yes | Yes | Yes |
| Search grounding | Yes | Yes | Yes |
| Interactions API | Yes | Yes | Yes |
| Flex Tier | Yes | Yes | No |
| Input / 1M tokens | $1.50 | $2.00 | $2.00 |
| Output / 1M tokens | $9.00 | $12.00 | $12.00 |
| Context window | 1M tokens | 1M tokens | 2M tokens |
Why 3.5 Flash for computer use? Google chose Flash over Pro because computer-use tasks generate many sequential screenshot-to-action cycles. The lower per-token cost of Flash ($1.50/$9.00 vs $2.00/$12.00) compresses the cost of those high-token-volume agentic loops.
Computer Use Architecture
Gemini 3.5 Flash's computer use pipeline works in three stages:
- Screenshot capture — The agent takes a screenshot of the current environment (browser viewport, desktop, or mobile screen).
- Reasoning — The model analyzes the screenshot, identifies UI elements, and determines the next action to accomplish the goal.
- Action execution — The model outputs a structured action (click, type, scroll, navigate) that your application executes in the target environment.
This loop repeats until the task completes or the model determines it cannot proceed.
Supported environments
- Browser — Web page interaction through rendered screenshots and DOM-level actions.
- Desktop — Native application control across macOS, Windows, and Linux via screen capture.
- Mobile — Android device automation (iOS support in preview).
Multi-step example: filling a form
from google import genai
from google.genai import types
client = genai.Client()
# The model handles multi-step form filling autonomously
response = client.models.generate_content(
model="gemini-3.5-flash",
contents="Go to therouter.ai/contact, fill in name='Test User', email='test@example.com', and submit the form",
config=types.GenerateContentConfig(
tools=[
types.Tool(
computer_use=types.ToolComputerUse(
environment=types.Environment(
browser=types.EnvironmentBrowser()
)
)
)
]
),
)
The model breaks this into discrete steps — navigate, locate the name field, type, locate the email field, type, find the submit button, click — each validated against a fresh screenshot.
Managed Agents: Background Execution and Remote MCP
On July 8, 2026, Google added four capabilities to Managed Agents in the Gemini API:
Background Execution
Run agents asynchronously without holding an HTTP connection open. Start a task, get a handle, poll for results:
from google import genai
client = genai.Client()
# Start a background agent task
operation = client.agentic.create(
model="gemini-3.5-flash",
config={
"tools": [...],
"execution_mode": "BACKGROUND",
},
contents="Analyze the top 10 pages on therouter.ai and summarize their content",
)
# Poll for completion
result = client.agentic.get(operation.name)
This matters for long-running agentic tasks (software testing pipelines, multi-page web scraping, data processing) where holding a synchronous HTTP connection is impractical.
Remote MCP Server Integration
Managed Agents can now connect directly to remote MCP (Model Context Protocol) servers. This lets agents access internal databases, APIs, or tool servers without custom function wrappers:
config = {
"tools": [
{
"mcp_server": {
"uri": "https://your-internal-api.example.com/mcp",
"credentials": {"type": "bearer", "token": "..."}
}
}
]
}
Custom Functions Alongside Sandbox Tools
Developers can now define custom functions that run alongside Google's built-in sandbox tools (code execution, file I/O). Previously it was one or the other.
Credential Refresh
Tokens and credentials can be refreshed between interaction turns without losing the agent's sandbox state — critical for long-running enterprise workflows where OAuth tokens expire mid-task.
Interactions API: GA with Flex Tier
The Interactions API is the interface for multi-turn agent conversations through Managed Agents. It went GA in mid-2026 with a new Flex Tier:
| Tier | Latency target | Pricing vs Standard |
|---|---|---|
| Standard | Best-effort low latency | 1x |
| Flex | ~2 minutes | 50% discount |
Flex Tier uses off-peak compute capacity. It is a good fit for:
- Batch agentic tasks where you queue many agent runs and collect results asynchronously.
- Background execution workflows where sub-2-minute latency is acceptable.
- Cost optimization on high-volume agentic pipelines.
Standard tier remains the default for interactive, user-facing agent experiences.
Safety Guardrails for Computer Use
Google takes a "defense-in-depth" approach to computer-use safety in 3.5 Flash:
- Targeted adversarial training — The model is specifically trained to resist prompt injection in live browser environments where page content could attempt to hijack the agent.
- User confirmation for sensitive actions — Optional enterprise safeguard that requires explicit user approval before the agent executes irreversible actions (purchases, deletions, form submissions with PII).
- Automatic prompt-injection detection — Optional system that stops a task automatically if an indirect prompt injection is identified during execution.
Production checklist:
- Enable both optional safeguards for any production deployment.
- Run agents in sandboxed browser environments (Google recommends Browserbase or similar).
- Implement human-in-the-loop verification for high-stakes actions.
- Apply strict access controls — limit agent permissions to only what the task requires.
- Monitor agent actions via audit logs.
Common Errors and Fixes
| Error | Cause | Fix |
|---|---|---|
TOOL_NOT_SUPPORTED | Using computer_use with a model that does not support it | Switch to gemini-3.5-flash |
ENVIRONMENT_NOT_AVAILABLE | No browser/desktop environment configured | Add EnvironmentBrowser() or EnvironmentDesktop() to your tool config |
| Stale screenshot loop | Agent keeps acting on outdated screenshots | Ensure your environment returns fresh screenshots after each action |
| Rate limit exceeded (429) | Too many concurrent agentic sessions | Implement exponential backoff; consider Flex Tier for batch workloads |
| Credential expired mid-task | OAuth token expired during long-running agent | Use the new credential refresh API between interaction turns |
MCP_CONNECTION_FAILED | Remote MCP server unreachable | Verify MCP server URI, check network/firewall rules, validate credentials |
TheRouter Integration
google/gemini-3.5-flash is in TheRouter's model catalog. You can route requests through TheRouter's unified endpoint:
from openai import OpenAI
client = OpenAI(
api_key="YOUR_THEROUTER_KEY",
base_url="https://therouter.ai/api/v1",
)
response = client.chat.completions.create(
model="google/gemini-3.5-flash",
messages=[
{"role": "user", "content": "What are the top features of Gemini 3.5 Flash?"}
],
)
For standard chat completions, function calling, and Search-grounded requests, TheRouter routes to google/gemini-3.5-flash through its OpenAI-compatible interface.
Computer use and Managed Agents note: The
computer_usebuilt-in tool and Managed Agents APIs use Google-specific SDK calls (google-genaiPython package) that go beyond the OpenAI-compatible chat completions spec. These features require direct integration with the Gemini API. TheRouter routes standard chat and function-calling requests to Gemini; for computer-use and Managed Agents workflows, use the Google SDK directly and route your non-agentic Gemini traffic through TheRouter for unified billing and fallback.
Routing agentic workflows: a practical pattern
A common architecture for production agentic systems:
- Planning calls → Route through TheRouter (standard chat completions, benefits from fallback to other models if Gemini is rate-limited).
- Computer-use execution → Direct Gemini API (requires
computer_usetool, Google SDK). - Result summarization → Route through TheRouter (standard chat completions, can use any model).
This hybrid approach gives you unified billing and fallback for the calls that support it, while using Google's native SDK for the capabilities that require it.
FAQ
Q: Do I need a separate model for computer use?
A: No. As of June 24, 2026, computer use is a built-in tool in gemini-3.5-flash. The separate computer-use preview model from the Gemini 2.5 era is no longer needed.
Q: What is the pricing for computer-use calls? A: Computer-use calls are billed at the standard Gemini 3.5 Flash rate: $1.50 per 1M input tokens and $9.00 per 1M output tokens. Each screenshot-action cycle consumes tokens (screenshots are image tokens). Flex Tier offers 50% off for batch/background workloads.
Q: Can I use computer use through the OpenAI-compatible API?
A: No. The computer_use tool requires the Google genai SDK. Standard chat completions and function calling work through OpenAI-compatible endpoints (including via TheRouter); computer-use requires the native Gemini API.
Q: What environments does computer use support? A: Browser, desktop (macOS/Windows/Linux), and mobile (Android; iOS in preview).
Q: How does background execution work with Managed Agents?
A: You start an agent task with execution_mode: "BACKGROUND", receive an operation handle, and poll for completion. No open HTTP connection needed. Available through the Interactions API.
Q: Is Flex Tier suitable for real-time user-facing agents? A: Flex Tier targets ~2-minute latency. For interactive user-facing experiences, use Standard tier. Flex is best for batch processing, background tasks, and cost-sensitive pipelines.
Q: Can Managed Agents connect to my internal MCP servers?
A: Yes, as of July 8, 2026. Configure mcp_server in your tool config with the server URI and credentials. The agent can call MCP tools alongside Google's built-in sandbox tools.
Last updated: July 21, 2026. Pricing and capabilities verified against official sources on retrieval date. Capabilities evolve; verify against Gemini API documentation for the latest.