Gemini Developer API

Gemini API 키를 가져와 몇 분 만에 첫 번째 API 요청을 실행하세요.

from google import genai

client = genai.Client(api_key="YOUR_API_KEY")

response = client.models.generate_content(
    model="gemini-2.0-flash",
    contents="Explain how AI works",
)

print(response.text)
import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({ apiKey: "YOUR_API_KEY" });

async function main() {
  const response = await ai.models.generateContent({
    model: "gemini-2.0-flash",
    contents: "Explain how AI works",
  });
  console.log(response.text);
}

await main();
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  -X POST \
  -d '{
    "contents": [
      {
        "parts": [
          {
            "text": "Explain how AI works in a few words"
          }
        ]
      }
    ]
  }'

API 살펴보기

네이티브 이미지 생성

Gemini 2.0 Flash를 사용하여 문맥에 맞는 이미지를 기본적으로 생성하고 수정합니다.

긴 컨텍스트 살펴보기

Gemini 모델에 수백만 개의 토큰을 입력하고 비정형 이미지, 동영상, 문서에서 이해를 도출합니다.

구조화된 출력 생성

자동 처리에 적합한 구조화된 데이터 형식인 JSON으로 응답하도록 Gemini를 제한합니다.

Gemini API로 빌드 시작하기

시작하기