curl -X POST https://generativelanguage.googleapis.com/v1beta/interactions \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent": "antigravity-preview-05-2026",
"input": "Read Hacker News, summarize the top 5 stories, and save results as a markdown file.",
"environment": "remote"
}'
from google import genai
client = genai.Client()
interaction = client.interactions.create(
agent="antigravity-preview-05-2026",
input=(
"Read Hacker News, summarize the top 5 stories, and save results as"
" a markdown file."
),
environment="remote",
)
print(interaction.output_text)
import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({});
const interaction = await ai.interactions.create({
agent: 'antigravity-preview-05-2026',
input:
'Read Hacker News, summarize the top 5 stories, and save results as a markdown file.',
environment: 'remote',
});
console.log(interaction.output_text);
import com.google.genai.gaos.models.interactions.AgentOption;
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateAgentInteraction;
import com.google.genai.gaos.models.interactions.CreateAgentInteractionEnvironment;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import com.google.genai.gaos.models.operations.CreateInteractionResponse;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
Client client = new Client();
CreateAgentInteraction params =
CreateAgentInteraction.builder()
.agent(AgentOption.of("antigravity-preview-05-2026"))
.input(
InteractionsInput.of(
"Read Hacker News, summarize the top 5 stories, and save results as a markdown"
+ " file."))
.environment(CreateAgentInteractionEnvironment.of("remote"))
.build();
CreateInteractionResponse response =
client.interactions.create(CreateInteractionRequestBody.of(params));
Interaction interaction =
response.interaction().orElseThrow(() -> new RuntimeException("No interaction returned"));
System.out.println(interaction.outputText().orElse(""));
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
gaos_interactions "google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
body := operations.NewCreateInteractionRequestBody(gaos_interactions.CreateAgentInteraction{
Agent: gaos_interactions.AgentOption("antigravity-preview-05-2026"),
Input: genai.Ptr(gaos_interactions.NewInteractionsInput("Read Hacker News, summarize the top 5 stories, and save results as a markdown file.")),
Environment: genai.Ptr(gaos_interactions.NewCreateAgentInteractionEnvironment("remote")),
})
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{Body: body})
if err != nil {
log.Fatal(err)
}
if res.Interaction != nil && res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}