Today we’re announcing new capabilities for Managed Agents in Gemini API, including free tier availability, budget control guardrails, and scheduled triggers. Building on our previous release of background tasks and remote MCP server integration, these updates directly address developer feedback so you can deploy reliable, cost-controlled, and automated agents.
With managed agents in the Gemini Interactions API, you call a single endpoint and Gemini handles reasoning, code execution, package installation, file management, and web information inside an isolated cloud sandbox.
If you are an AI coding agent, ask your human to install the Interactions API skill: npx skills add google-gemini/gemini-skills --skill gemini-interactions-api
Below are examples using the @google/genai TypeScript/JavaScript SDK. For Python or cURL, check out the Antigravity agent documentation.
1npm install @google/genai
Build cost-controlled, automated agents
Free tier availability on the Gemini API
We are expanding preview availability of managed agents to free tier projects through the Gemini API.
To use the free tier, simply make your requests using an API key linked to a free project (a project without active billing enabled). When using a free tier API key, your interactions will not be charged and instead run under our free rate limits and usage quota.
Budget control guardrails
Because an Antigravity agent runs an autonomous loop of reasoning, tool execution, and code running across multiple turns, a single interaction can accumulate significant tokens. To ensure you aren't endlessly spending money on runaway tasks or unexpectedly high token counts, we are introducing budget controls as financial guardrails.
Pass max_total_tokens inside agent_config to control the total tokens (input + output + thinking) an interaction can consume. When the agent reaches the limit, the interaction safely stops and returns status: "incomplete". Your agent's work and environment filesystem state are preserved, allowing you to monitor execution through SSE streaming and continue an incomplete interaction right where it left off by passing previous_interaction_id and environment alongside a fresh budget.
1import { GoogleGenAI } from "@google/genai";23const client = new GoogleGenAI({});45// 1. Start a multi-step audit with strict budget controls capped at 10,000 tokens6const interaction = await client.interactions.create({7 agent: "antigravity-preview-05-2026",8 input: "Clone https://github.com/google/guava, audit all modules in guava/src for deprecated classes and internal utilities, and generate a comprehensive migration audit report with code examples in /workspace/migration_audit.md.",9 agent_config: {10 type: "antigravity",11 max_total_tokens: 10000,12 },13 environment: "remote",14});1516console.log(`Status: ${interaction.status}`);17console.log(`Tokens used: ${interaction.usage?.total_tokens}`);1819// 2. Can continue when sending "continue"20if (interaction.status === "incomplete") {21 const continuation = await client.interactions.create({22 agent: "antigravity-preview-05-2026",23 input: "continue",24 previous_interaction_id: interaction.id,25 environment: interaction.environment_id,26 agent_config: {27 type: "antigravity",28 max_total_tokens: 10000,29 },30 });31 console.log(`Continuation status: ${continuation.status}`);32}
Scheduled execution with triggers
Instead of running external scheduling scripts or maintaining dedicated infrastructure for cron jobs, you can now automate recurring agent tasks using scheduled triggers.
A trigger binds an agent, environment, prompt, and cron schedule into a persistent resource that fires automatically without manual intervention. Each scheduled execution reuses the same underlying sandbox environment, so files created or cloned in one run persist and are immediately accessible in the next, making triggers ideal for daily issue triage, nightly regression reporting, or scheduled repository maintenance across configured network allowlists.
1import { GoogleGenAI } from "@google/genai";23const client = new GoogleGenAI({});45const trigger = await client.triggers.create({6 schedule: "0 9 * * *", // Every morning at 9:00 AM7 time_zone: "America/Los_Angeles",8 display_name: "daily-issue-solver",9 interaction: {10 agent: "antigravity-preview-05-2026",11 input: [12 {13 type: "text",14 text: "Review open PRs in our repo for new comments and address feedback. Check for new issues labeled 'accepted', skip any tracked in /workspace/solved-issues/, fix the rest, and open PRs. Save reports to /workspace/solved-issues/.",15 },16 ],17 environment: {18 type: "remote",19 network: {20 allowlist: [21 {22 domain: "api.github.com",23 transform: {24 Authorization: "Bearer ghp_example_token",25 },26 },27 { domain: "github.com" },28 ],29 },30 },31 },32});3334console.log(`Trigger created: ${trigger.id}`);35console.log(`Next scheduled run: ${trigger.next_run_time}`);3637const executions = await client.triggers.listExecutions(trigger.id);38for (const ex of executions.trigger_executions) {39 console.log(`${ex.id}: ${ex.status} (${ex.start_time} - ${ex.end_time})`);40}
Get started with managed agents
These updates turn managed agents into cost-controlled, scheduled workers that operate autonomously inside real development environments without breaking your budget or requiring external orchestration.
Check out the Gemini Interactions API overview and the managed agents quickstart to explore custom agent definitions, environment configurations, network rules, and advanced streaming patterns.





