> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apigo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini 비디오 생성 예

> Gemini 장기 실행 비디오 생성 예시.

## 권장 엔드포인트

* [Gemini /v1beta/models/{model}:predictLongRunning](/ko/api-reference/endpoints/gemini/video-predict-long-running)
* [제미니 /v1beta/operations/{operation_id}](/ko/api-reference/endpoints/gemini/video-operations)

## 최소한의 요청

```json theme={null}
{
  "model": "veo-3.1-generate-preview",
  "prompt": "An 8-second ApiGo product demo animation"
}
```

## cURL 예

```bash theme={null}
curl "https://generativelanguage.googleapis.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "An 8-second ApiGo product demo animation"
  }'
```

## 파이썬 예제

```python theme={null}
import requests

create_response = requests.post(
    "https://generativelanguage.googleapis.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning",
    headers={
        "x-goog-api-key": "<GEMINI_API_KEY>",
        "Content-Type": "application/json",
    },
    json={"prompt": "An 8-second ApiGo product demo animation"},
)

operation = create_response.json()
print(operation)
```

## Node.js 예

```js theme={null}
const createResponse = await fetch(
  "https://generativelanguage.googleapis.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning",
  {
    method: "POST",
    headers: {
      "x-goog-api-key": process.env.GEMINI_API_KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      prompt: "An 8-second ApiGo product demo animation"
    }),
  }
);

const operation = await createResponse.json();
console.log(operation);
```

## 모범 사례

* 초기 요청은 최종 비디오가 아닌 작업 핸들을 반환합니다.
* 폴링 및 상태 매핑은 서버에 있어야 합니다.
* 작업이 완료된 후에만 최종 자산을 검색합니다.
