New: Nano Banana 2.1Try the model
API Stock

영상

텍스트를 비디오로

프롬프트에서 클립을 만드는 방법: 구도, 움직임, 길이, 전달.

2분 분량2개 섹션

좋은 비디오 계획은 주제, 장소, 행동, 구도, 카메라 움직임을 설명합니다. 짧은 클립부터 시작하고, 잘 나온 결과를 기준으로 반복하세요.

실무 핵심

속도, 충실도, 해상도, 제어 중 무엇이 우선인지에 따라 모델을 선택하고 모든 결과의 파라미터와 버전을 저장하세요. veo3.1-*, wan2.7-video and kling-3.0-* — Text to video.

한 번의 시도에서는 한 가지만 바꾸세요. 좋은 출력은 참조가 되며 다음 반복의 가장 신뢰할 수 있는 출발점입니다.

finished와 failed를 최종 상태로 다루세요. polling 또는 webhook을 사용하고 원본 오류는 서버에 보관하며 사용자에게는 안전한 메시지만 표시하세요.

프롬프트와 API 예시

text
Close up shot (composition) of melting icicles (subject) on a frozen rock wall
(context) with cool blue tones (ambiance), zoomed in (camera motion) maintaining
close-up detail of water drips (action).
Veo 3.1 follows a compact shot list: close framing, cool-blue ambience, a zoom and one clear action.

Source: Google AI for Developers, used under CC BY 4.0; format and dimensions adapted.

text
A barista slides a paper cup across the counter and says "your usual, right?",
warm indoor light, handheld, slight rack focus onto the cup, cafe ambience
text
A close-up cinematic shot follows a desperate man in a weathered green trench
coat as he dials a rotary phone mounted on a gritty brick wall, bathed in the
eerie glow of a green neon sign. The camera dollies in, revealing the tension
in his jaw and the desperation etched on his face as he struggles to make the
call. The shallow depth of field focuses on his furrowed brow and the black
rotary phone, blurring the background into a sea of neon colors and indistinct
shadows, creating a sense of urgency and isolation.
Veo 3.1 with the detailed version of the prompt: camera, texture, light and emotion all reinforce the same shot.

Source: Google AI for Developers, used under CC BY 4.0; format and dimensions adapted.

text
A satellite floating through outer space with the moon and some stars in the
background.
Veo 3.1 from a subject-and-context prompt only; the result is coherent, but the model chooses the camera and motion for you.

Source: Google AI for Developers, used under CC BY 4.0; format and dimensions adapted.

text
A cyclist crests a hill at dusk, silhouette against an orange sky, camera
tracking alongside, dust in the air

About these samples. Ready-made examples are copied to our own storage only when their source permits reuse. The exact prompt appears above each result, and the original source and license are linked below the media.

sh
curl -X POST https://api.api-stock.com/api/v1/generation/create \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "veo3.1-quality",
"input": {
"prompt": "A lighthouse on a basalt cliff at dawn, slow push-in, fog rolling over the water",
"aspectRatio": "16:9",
"resolution": "4k"
}
}'
json
{
"code": 200,
"data": {
"taskId": "019ca881-9503-7270-a560-f00fc2b15785",
"status": "not_started",
"createdAt": "2026-02-28T11:22:33.000Z"
}
}
json
{
"model": "seedance-2.0",
"input": {
"prompt": "A lighthouse on a basalt cliff at dawn, fog rolling over the water",
"size": "16:9",
"resolution": "1080p",
"duration": 8,
"generateAudio": true,
"cameraFixed": false
}
}
sh
curl https://api.api-stock.com/api/v1/task/status/019ca881-9503-7270-a560-f00fc2b15785 \
-H "Authorization: Bearer sk-your-key"
json
{
"code": 200,
"data": {
"taskId": "019ca881-9503-7270-a560-f00fc2b15785",
"status": "processing",
"createdTime": "2026-02-28T11:22:33.000Z"
}
}
json
{
"code": 200,
"data": {
"taskId": "019ca881-9503-7270-a560-f00fc2b15785",
"status": "finished",
"files": [
{
"fileUrl": "https://storage.api-stock.com/generated/video-abc123.mp4",
"fileType": "video"
}
],
"createdTime": "2026-02-28T11:22:33.000Z"
}
}
ts
const BASE = "https://api.api-stock.com/api/v1";
const KEY = process.env.API_STOCK_KEY!;
type TaskFile = { fileUrl: string; fileType: "image" | "video" | "music" };
type TaskData = {
taskId: string;
status: "not_started" | "processing" | "finished" | "failed";
files?: TaskFile[];
output?: Record<string, unknown>;
createdTime: string;
errorMessage?: string;
};
async function createVideo(prompt: string): Promise<string> {
const res = await fetch(`${BASE}/generation/create`, {
method: "POST",
headers: {
Authorization: `Bearer ${KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "veo3.1-quality",
input: { prompt, aspectRatio: "16:9", resolution: "4k" },
}),
});
const body = await res.json();
if (!res.ok) {
// { code, error: { message, type, code } }
throw new Error(`${body.error.code}: ${body.error.message}`);
}
return body.data.taskId; // → "019ca881-9503-7270-a560-f00fc2b15785"
}
async function waitForTask(
taskId: string,
{ intervalMs = 10_000, timeoutMs = 20 * 60_000 } = {},
): Promise<TaskData> {
const deadline = Date.now() + timeoutMs;
while (Date.now() < deadline) {
const res = await fetch(`${BASE}/task/status/${taskId}`, {
headers: { Authorization: `Bearer ${KEY}` },
});
const body = await res.json().catch(() => null);
if (!res.ok) {
const message = body?.error?.message ?? `${res.status} ${res.statusText}`;
throw new Error(message);
}
const data = body.data as TaskData;
if (data.status === "finished") return data;
if (data.status === "failed") {
throw new Error(data.errorMessage ?? "generation failed");
}
await new Promise((r) => setTimeout(r, intervalMs));
}
// The task is still alive server-side — resume polling later with the id.
throw new Error(`timed out waiting for ${taskId}`);
}
const taskId = await createVideo(
"A lighthouse on a basalt cliff at dawn, slow push-in, fog rolling over the water",
);
const task = await waitForTask(taskId);
console.log(task.files?.[0].fileUrl); // → https://storage.api-stock.com/...mp4
json
{
"model": "veo3.1-fast",
"input": {
"prompt": "Neon-lit rain on an empty parking garage, handheld",
"aspectRatio": "9:16",
"resolution": "1080p"
},
"webhook": "https://example.com/hooks/api-stock/8f2c1e9a-secret"
}
json
{
"code": 400,
"error": {
"message": "Input parameters do not match the requirements for model veo3.1-quality",
"type": "BadRequest",
"code": "invalid_input"
}
}
json
{
"code": 200,
"data": {
"taskId": "019ca881-9503-7270-a560-f00fc2b15785",
"status": "failed",
"createdTime": "2026-02-28T11:22:33.000Z",
"errorMessage": "This generation may violate our content policy. Please try a different prompt."
}
}

직접 발급한 키로 실행해 보세요

API Stock 카탈로그에서 모델과 가격을 확인하고 브라우저나 API로 사용해 보세요.

이어서 읽기