curl -X POST https://generativelanguage.googleapis.com/v1beta/agents \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-H "Api-Revision: 2026-05-20" \
-d '{
"id": "data-analyst-abc123",
"base_agent": "antigravity-preview-05-2026",
"system_instruction": "You are a data analyst. Always include visualizations and export results as PDF.",
"base_environment": {
"type": "remote",
"sources": [
{
"type": "inline",
"target": ".agents/AGENTS.md",
"content": "Always use matplotlib for charts. Include a summary table in every report."
},
{
"type": "repository",
"source": "https://github.com/my-org/analysis-templates",
"target": "/workspace/templates"
}
]
}
}'
import uuid
from google import genai
client = genai.Client()
agent = client.agents.create(
id=f"data-analyst-{uuid.uuid4().hex[:8]}",
base_agent="antigravity-preview-05-2026",
system_instruction="You are a data analyst. Always include visualizations and export results as PDF.",
base_environment={
"type": "remote",
"sources": [
{
"type": "inline",
"target": ".agents/AGENTS.md",
"content": "Always use matplotlib for charts. Include a summary table in every report.",
},
{
"type": "repository",
"source": "https://github.com/my-org/analysis-templates",
"target": "/workspace/templates",
},
],
},
)
print(f"Created agent: {agent.id}")
import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({});
const agentId = `data-analyst-${crypto.randomUUID().slice(0, 8)}`;
const agent = await ai.agents.create({
id: agentId,
base_agent: 'antigravity-preview-05-2026',
system_instruction: 'You are a data analyst. Always include visualizations and export results as PDF.',
base_environment: {
type: 'remote',
sources: [
{
type: 'inline',
target: '.agents/AGENTS.md',
content: 'Always use matplotlib for charts. Include a summary table in every report.',
},
{
type: 'repository',
source: 'https://github.com/my-org/analysis-templates',
target: '/workspace/templates',
},
],
},
});
console.log(`Created agent: ${agent.id}`);