Antigravity Agent

Antigravity 智能体是 Gemini API 上的通用托管式智能体。只需一次 API 调用,您就能获得一个智能体,该智能体可在 Google 托管的自有安全 Linux 沙盒中进行推理、执行代码、管理文件和浏览网页。

它由 Gemini 3.6 Flash 提供支持,并使用与 Antigravity IDE 相同的 harness。您可以使用 agent_config 配置底层 Gemini 模型。可通过 Interactions APIGoogle AI Studio 使用。

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    agent="antigravity-preview-05-2026",
    input="Read Hacker News, summarize the top 10 stories, and save the results as a PDF.",
    environment="remote",
)

print(interaction.output_text)

JavaScript

import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

const interaction = await client.interactions.create({
    agent: "antigravity-preview-05-2026",
    input: "Read Hacker News, summarize the top 10 stories, and save the results as a PDF.",
    environment: "remote",
}, { timeout: 300000 });

console.log(interaction.output_text);

REST

curl -X