# Gemini Managed Agents: Deploy an AI Agent with One API Call

> Source: <https://byteiota.com/gemini-managed-agents-antigravity-api/>
> Published: 2026-06-13 18:09:14+00:00

Google shipped Managed Agents in the Gemini API at I/O 2026, and the pitch is blunt: call an API, get a working Linux sandbox where an AI agent reasons, runs code, browses the web, and manages files — all in one call. No VMs to spin up, no orchestration loop to write, no tool registry to maintain. The first call to `client.interactions.create()`

replaces what used to be a multi-service setup. Whether or not it holds up in production, the developer experience argument is hard to argue with.

## What Managed Agents Actually Do

The core of this is the **Interactions API** (currently in Beta), which replaces `generateContent`

for agentic work. You pass a task to the Antigravity agent — `antigravity-preview-05-2026`

, Google’s general-purpose managed agent — and Google provisions a remote Linux sandbox, runs the agent loop, and returns the result. Inside that sandbox, the agent can execute Python, Node.js, and Bash; install packages; read and write files; and browse the web. That last combination — code execution *and* web browsing in the same isolated environment — is what separates this from OpenAI’s code interpreter, which keeps those capabilities more siloed.

The Antigravity agent runs on [Gemini 3.5 Flash](https://blog.google/innovation-and-ai/technology/developers-tools/google-io-2026-developer-highlights/), fine-tuned specifically for tool calls and shell command output. Google reports Terminal-Bench 2.1 at 76.2% and MCP Atlas at 83.6%, outperforming Gemini 3.1 Pro on the agentic benchmarks that matter for this use case.

## The Code: Start in Under Five Minutes

Install the SDK (`pip install google-genai`

), set your `GEMINI_API_KEY`

, and you’re ready. Here’s the basic pattern:

``` python
from google import genai

client = genai.Client()

# One call provisions a fresh Linux sandbox
interaction = client.interactions.create(
    agent="antigravity-preview-05-2026",
    environment="remote",
    input="Research the top Python web frameworks in 2026. Write a markdown comparison and save it as report.md"
)

print(interaction.output_text)  # Final response
print(interaction.steps)        # Every reasoning step and tool call

# Continue in the same sandbox — files and packages persist
follow_up = client.interactions.create(
    agent="antigravity-preview-05-2026",
    environment=interaction.environment_id,
    previous_interaction_id=interaction.id,
    input="Add benchmark data and convert report.md to HTML"
)
```

The `interaction.steps`

list is worth examining when debugging. It surfaces every reasoning step, tool invocation, and code execution so you can trace exactly what the agent did — significantly more useful than a black-box response.

## State: Two Independent Dimensions

The state model is what makes iterative workflows practical. The [Interactions API](https://ai.google.dev/gemini-api/docs/interactions/interactions-overview) tracks two independent dimensions:

**Conversation context**— tracked via`previous_interaction_id`

. Pass the last`interaction.id`

and the agent carries forward its full chat history, reasoning trace, and tool logs.**Environment state**— tracked via`environment_id`

. Reuse the same sandbox and your installed packages, generated files, and file system state persist. Sandboxes have a 7-day TTL.

These two are independent by design. You can reset conversation history while keeping the environment — useful for running different prompts in the same prepared sandbox — or vice versa. Reusing `environment_id`

is the better practice for iterative tasks: it avoids re-provisioning latency and keeps the packages you installed in step one alive for step three.

## What It Costs Right Now

During the public preview, sandbox compute is free. You pay only for tokens at standard Gemini 3.5 Flash rates: **$1.50 per million input tokens** and **$9.00 per million output tokens**. That’s 25% cheaper than Gemini 3.1 Pro ($2.00/$12.00), which is now outclassed on agentic benchmarks anyway. When Managed Agents move to GA on the [Enterprise Agent Platform](https://cloud.google.com/products/gemini-enterprise-agent-platform/pricing), Google Cloud pricing applies. If you’re evaluating this for a real use case, the preview window is the right time to benchmark it.

## Where This Fits (Honest Take)

Managed Agents are not the right tool for every agent workflow. Here’s where they earn their place and where they don’t.

**Pick Managed Agents when:** you want a working prototype in an afternoon, you’re already on GCP or deep in Google Workspace, or your use case is self-contained tasks — research, code execution, data processing — that don’t require tight integration with external services you control.

**Stick with Claude Agent SDK or OpenAI when:** you need fine-grained control over the orchestration loop, complex multi-agent topologies with MCP integration, or production-grade reliability guarantees that a preview product can’t provide. The Claude SDK gives you composable agents with explicit tool registration and transparent state management — more setup, more control.

The honest comparison: Managed Agents are to agent development what Vercel was to deployment — they remove the infra work so you can focus on what your agent actually does. That’s genuinely valuable. Not everyone needs more control than that.

## Get Started

The [official quickstart](https://ai.google.dev/gemini-api/docs/managed-agents-quickstart) covers your first interaction in Python, JavaScript, and REST. The [Antigravity agent reference](https://ai.google.dev/gemini-api/docs/antigravity-agent) has the full capability list. If you want to build a custom managed agent with your own tool set and system prompt, the documentation is at [Building Managed Agents](https://ai.google.dev/gemini-api/docs/custom-agents).

The preview is live now. Sandbox compute is free. If you’ve been meaning to prototype an agent workflow, this is the lowest-friction entry point available — with the understanding that preview means preview.
