Gemini API

Gemini API는 Gemini, Veo, Nano Banana 등을 사용하여 프롬프트에서 프로덕션까지 도달하는 가장 빠른 경로입니다. 이 API를 사용하면 이러한 생성 모델을 애플리케이션에 통합하여 텍스트와 이미지를 생성하고, 멀티모달 입력을 분석하고, 대화형 에이전트를 빌드할 수 있습니다.

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-3.8-flash",
    input="Explain how AI works in a few words"
)

print(interaction.output_text)

자바스크립트

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

const ai = new GoogleGenAI({});

const interaction = await ai.interactions.create({
  model: "gemini-3.8-flash",
  input: "Explain how AI works in a few words",
});

console.log(interaction.output_text);

자바

import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;

Client client = new Client();

CreateModelInteraction params =
    CreateModelInteraction.builder()
        .model(Model.of("gemini-3.7-flash"))
        .input(InteractionsInput.of("Explain how AI works in a few words"))
        .build();

Interaction interaction =
    client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();

System.out.println(interaction.outputText().orElse(""));

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gemini-3.8-flash",
    "input": "Explain how AI works in a few words"
  }'

모델 살펴보기

모두 보기

기능 살펴보기

에이전트 만들기

관리형 에이전트는 Gemini가 자체적으로 작업을 계획하고 완료할 수 있는 작업 공간을 제공합니다. Gemini는 단일 요청으로 코드를 작성하고 실행하며, 웹을 검색하고, 호스팅된 샌드박스 환경에서 파일을 만들 수 있습니다. 사전 빌드된 Antigravity 에이전트로 시작하거나 자체 안내와 도구로 맞춤설정하세요.

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    agent="antigravity-preview-09-2026",
    input=(
        "Research the top 5 sustainable fashion brands, "
        "compare their materials and pricing tiers, and "
        "build an interactive dashboard in analysis.html."
    ),
    environment="remote"
)

print(interaction.output_text)

자바스크립트

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

const ai = new GoogleGenAI({});

const interaction = await ai.interactions.create({
  agent: "antigravity-preview-09-2026",
  input:
    "Research the top 5 sustainable fashion brands, " +
    "compare their materials and pricing tiers, and " +
    "build an interactive dashboard in analysis.html.",
  environment: "remote",
});

console.log(interaction.output_text);

자바

import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.AgentOption;
import com.google.genai.gaos.models.interactions.CreateAgentInteraction;
import com.google.genai.gaos.models.interactions.CreateAgentInteractionEnvironment;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;

Client client = new Client();

CreateAgentInteraction params =
    CreateAgentInteraction.builder()
        .agent(AgentOption.of("antigravity-preview-09-2026"))
        .input(
            InteractionsInput.of(
                "Research the top 5 sustainable fashion brands, "
                    + "compare their materials and pricing tiers, and "
                    + "build an interactive dashboard in analysis.html."))
        .environment(CreateAgentInteractionEnvironment.of("remote"))
        .build();

Interaction interaction =
    client.interactions.create(CreateInteractionRequestBody.of(params))
        .interaction()
        .get();

System.out.println(interaction.outputText().orElse(""));

REST

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-09-2026",
    "input": "Research the top 5 sustainable fashion brands, compare their materials and pricing tiers, and build an interactive dashboard in analysis.html.",
    "environment": "remote"
  }'

Interactions API

Interactions API는 2026년 6월부터 기본 인터페이스가 되었으며, 앞으로 Gemini 모델 및 에이전트를 빌드하는 가장 좋은 방법입니다. 새 프로젝트를 시작하는 경우 Interactions API를 사용해야 합니다. generateContent API는 계속 지원되지만 이제 레거시로 간주됩니다.