---
title: LTX Video Image-to-Video | RunAPI
description: 使用 LTX 2.5 Fast 或 Pro，将源图像制作成视频。
url: https://runapi.ai/zh-CN/docs/api/ltx-video/image-to-video.md
canonical: https://runapi.ai/zh-CN/docs/api/ltx-video/image-to-video
locale: zh-CN
---

> HTML 版本: https://runapi.ai/zh-CN/docs/api/ltx-video/image-to-video
> 智能体网站索引: https://runapi.ai/llms.txt

# LTX Video Image-to-Video

## 概览

使用支持的模型提交Image to Video请求。使用返回的 Task ID 查询状态，或提供 callback_url 接收下方列出的投递。

### 快速开始

1. 创建 API Key，并将其设置为 RUNAPI_API_KEY。
2. 选择一个支持的模型，并发送与该模型 Schema 匹配的 POST 请求。
3. 保存返回的任务 ID，随后轮询到终态，或处理下方列出的回调。

## 端点

POST /api/v1/ltx_video/image_to_video

基础 URL: https://runapi.ai

API 版本: v1

身份验证: Authorization: Bearer YOUR_API_TOKEN

## 支持的模型

打开模型页可查看当前价格、限流和商业使用详情。

- [ltx-2.5-fast-image-to-video](https://runapi.ai/zh-CN/models/ltx-video/ltx-2.5-fast-image-to-video)
- [ltx-2.5-pro-image-to-video](https://runapi.ai/zh-CN/models/ltx-video/ltx-2.5-pro-image-to-video)

## 请求 Schema

字段和允许的取值取决于所选模型。提供 callback_url 后，它会收到下方列出的 Task 投递。

### ltx-2.5-fast-image-to-video

```json
{
  "callback_url": {
    "description": "RunAPI callback URL for the terminal task result.",
    "type": "string"
  },
  "duration_seconds": {
    "default": 10,
    "description": "Output duration in seconds. Fast 1440p or 48/50 fps is limited to 10 seconds.",
    "enum": [
      6,
      8,
      10,
      12,
      14,
      16,
      18,
      20
    ],
    "type": "integer"
  },
  "fps": {
    "default": 24,
    "description": "Frames per second. 48/50 fps is limited to 10 seconds. Frame rate does not affect the per-second price.",
    "enum": [
      24,
      25,
      48,
      50
    ],
    "type": "integer"
  },
  "model": {
    "description": "LTX 2.5 model slug.",
    "required": true,
    "type": "string"
  },
  "output_resolution": {
    "default": "1080p",
    "description": "Output video resolution. Fast 1440p is limited to 10 seconds.",
    "enum": [
      "720p",
      "1080p",
      "1440p"
    ],
    "type": "string"
  },
  "prompt": {
    "description": "Video description, from 1 to 5,000 characters.",
    "length": true,
    "max": 5000,
    "min": 1,
    "required": true,
    "type": "string"
  },
  "seed": {
    "description": "Optional random seed.",
    "max": 2147483647,
    "min": 0,
    "type": "integer"
  },
  "source_image_url": {
    "description": "HTTP(S) URL of a JPG, PNG or WEBP source image, up to 10 MB. The provider validates the remote file and derives the output aspect ratio.",
    "required": true,
    "type": "string"
  }
}
```

### ltx-2.5-pro-image-to-video

```json
{
  "callback_url": {
    "description": "RunAPI callback URL for the terminal task result.",
    "type": "string"
  },
  "duration_seconds": {
    "default": 10,
    "description": "Output duration in seconds, up to 10 seconds for Pro.",
    "enum": [
      6,
      8,
      10
    ],
    "type": "integer"
  },
  "fps": {
    "default": 24,
    "description": "Frames per second. 48/50 fps is limited to 10 seconds. Frame rate does not affect the per-second price.",
    "enum": [
      24,
      25,
      48,
      50
    ],
    "type": "integer"
  },
  "model": {
    "description": "LTX 2.5 model slug.",
    "required": true,
    "type": "string"
  },
  "output_resolution": {
    "default": "1080p",
    "description": "Output video resolution.",
    "enum": [
      "720p",
      "1080p"
    ],
    "type": "string"
  },
  "prompt": {
    "description": "Video description, from 1 to 5,000 characters.",
    "length": true,
    "max": 5000,
    "min": 1,
    "required": true,
    "type": "string"
  },
  "seed": {
    "description": "Optional random seed.",
    "max": 2147483647,
    "min": 0,
    "type": "integer"
  },
  "source_image_url": {
    "description": "HTTP(S) URL of a JPG, PNG or WEBP source image, up to 10 MB. The provider validates the remote file and derives the output aspect ratio.",
    "required": true,
    "type": "string"
  }
}
```

#### 条件规则

当列出的全部条件同时匹配时，应用这些要求。

- **当**: `model` = `ltx-2.5-fast-image-to-video`; **不可提供**: `aspect_ratio`, `source_audio_url`
- **当**: `model` = `ltx-2.5-pro-image-to-video`; **不可提供**: `aspect_ratio`, `source_audio_url`

## 创建已接受

HTTP 202 - POST /api/v1/ltx_video/image_to_video

### 响应 Schema

```json
{
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    },
    "task_replayed": {
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "status"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "id": "tsk_reference_demo",
  "status": "processing"
}
```

## 轮询处理中

HTTP 200 - GET /api/v1/ltx_video/image_to_video/:id

### 响应 Schema

```json
{
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "id": "tsk_reference_demo",
  "status": "processing"
}
```

## 轮询已完成

HTTP 200 - GET /api/v1/ltx_video/image_to_video/:id

### 响应 Schema

```json
{
  "properties": {
    "first_frame_image_url": {
      "type": "string",
      "x-runapi-generated-media": true
    },
    "id": {
      "type": "string"
    },
    "last_frame_image_url": {
      "type": "string",
      "x-runapi-generated-media": true
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    },
    "usage": {
      "properties": {
        "cost": {
          "type": "number"
        }
      },
      "required": [
        "cost"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "videos": {
      "items": {
        "properties": {
          "url": {
            "type": "string",
            "x-runapi-generated-media": true
          }
        },
        "required": [
          "url"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "status",
    "videos",
    "usage"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "id": "tsk_reference_demo",
  "status": "completed",
  "usage": {
    "cost": 0.05
  },
  "videos": [
    {
      "url": "https://file.runapi.ai/reference-video.mp4"
    }
  ]
}
```

## 轮询失败

HTTP 200 - GET /api/v1/ltx_video/image_to_video/:id

### 响应 Schema

```json
{
  "properties": {
    "error": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": "Task processing failed.",
  "id": "tsk_reference_demo",
  "status": "failed"
}
```

## 客户回调：已完成

HTTP 200 - POST callback_url

### 响应 Schema

```json
{
  "properties": {
    "first_frame_image_url": {
      "type": "string",
      "x-runapi-generated-media": true
    },
    "id": {
      "type": "string"
    },
    "last_frame_image_url": {
      "type": "string",
      "x-runapi-generated-media": true
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    },
    "usage": {
      "properties": {
        "cost": {
          "type": "number"
        }
      },
      "required": [
        "cost"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "videos": {
      "items": {
        "properties": {
          "url": {
            "type": "string",
            "x-runapi-generated-media": true
          }
        },
        "required": [
          "url"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "status",
    "videos",
    "usage"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "id": "tsk_reference_demo",
  "status": "completed",
  "usage": {
    "cost": 0.05
  },
  "videos": [
    {
      "url": "https://file.runapi.ai/reference-video.mp4"
    }
  ]
}
```

## 客户回调：失败

HTTP 200 - POST callback_url

### 响应 Schema

```json
{
  "properties": {
    "error": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "properties": {
            "code": {
              "type": "string"
            },
            "limit_cents": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            },
            "reset_at": {
              "format": "date-time",
              "type": [
                "string",
                "null"
              ]
            },
            "used_cents": {
              "type": "integer"
            },
            "window": {
              "enum": [
                "1h",
                "1d",
                "7d",
                "daily",
                "weekly",
                "monthly",
                "lifetime"
              ],
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "type": "object",
          "unevaluatedProperties": false
        }
      ]
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": {
    "code": "generation_failed",
    "message": "Task processing failed."
  },
  "id": "tsk_reference_demo",
  "status": "failed"
}
```

## 错误

HTTP 401 - POST /api/v1/ltx_video/image_to_video

### 响应 Schema

```json
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": "Authentication required"
}
```

## 错误

HTTP 401 - GET /api/v1/ltx_video/image_to_video/:id

### 响应 Schema

```json
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": "Authentication required"
}
```

## 错误

HTTP 400 - POST /api/v1/ltx_video/image_to_video

### 响应 Schema

```json
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "Human-readable error message.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "Human-readable validation summary.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "Validation messages keyed by public request field, with an array of human-readable strings for each field.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}
```

### 响应示例

```json
{
  "error": "model must be one of: ltx-2.5-fast-image-to-video, ltx-2.5-pro-image-to-video"
}
```

## 错误

HTTP 402 - POST /api/v1/ltx_video/image_to_video

### 响应 Schema

```json
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": "Insufficient balance"
}
```

## 错误

HTTP 429 - POST /api/v1/ltx_video/image_to_video

### 响应 Schema

```json
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": "API key credit limit exceeded"
}
```

## 错误

HTTP 409 - POST /api/v1/ltx_video/image_to_video

### 响应 Schema

```json
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": "The request uses features that are not supported for the selected model"
}
```

## 错误

HTTP 429 - POST /api/v1/ltx_video/image_to_video

### 响应 Schema

```json
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": "Rate limit reached. Please retry later."
}
```

## 错误

HTTP 503 - POST /api/v1/ltx_video/image_to_video

### 响应 Schema

```json
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": "Service under maintenance, please try again later"
}
```

## 错误

HTTP 503 - POST /api/v1/ltx_video/image_to_video

### 响应 Schema

```json
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": "The request timed out"
}
```

## 错误

HTTP 404 - GET /api/v1/ltx_video/image_to_video/:id

### 响应 Schema

```json
{
  "properties": {
    "error": {
      "description": "Human-readable error message.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 响应示例

```json
{
  "error": "Task with id 'tsk_reference_demo' not found"
}
```

## 生成的代码示例

直接使用 cURL，或安装所用语言的 SDK。每个示例都会提交本参考中经过验证的请求。

### curl

```curl
curl -X POST https://runapi.ai/api/v1/ltx_video/image_to_video \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"model":"ltx-2.5-fast-image-to-video","prompt":"The camera slowly moves forward.","source_image_url":"https://cdn.runapi.ai/public/samples/image.jpg","output_resolution":"720p","duration_seconds":6,"fps":24}'
```

### javascript

#### 安装

```bash
npm install @runapi.ai/ltx-video
```

```javascript
import { LtxVideoClient } from "@runapi.ai/ltx-video";

const client = new LtxVideoClient({ apiKey: process.env.RUNAPI_API_KEY });
const task = await client.imageToVideo.create({
  "model": "ltx-2.5-fast-image-to-video",
  "prompt": "The camera slowly moves forward.",
  "source_image_url": "https://cdn.runapi.ai/public/samples/image.jpg",
  "output_resolution": "720p",
  "duration_seconds": 6,
  "fps": 24
});
```

### python

#### 安装

```bash
pip install runapi-ltx-video
```

```python
import os
from runapi.ltx_video import LtxVideoClient

client = LtxVideoClient(api_key=os.environ["RUNAPI_API_KEY"])
task = client.image_to_video.create(
  model="ltx-2.5-fast-image-to-video",
  prompt="The camera slowly moves forward.",
  source_image_url="https://cdn.runapi.ai/public/samples/image.jpg",
  output_resolution="720p",
  duration_seconds=6,
  fps=24
)
```

### go

#### 安装

```bash
go get github.com/runapi-ai/ltx-video-sdk/go@latest
```

```go
package main

import (
  "context"
  "log"
  "os"

  "github.com/runapi-ai/core-sdk/go/option"
  ltxvideo "github.com/runapi-ai/ltx-video-sdk/go/ltxvideo"
)

func main() {
  client, err := ltxvideo.NewClient(option.WithAPIKey(os.Getenv("RUNAPI_API_KEY")))
  if err != nil {
    log.Fatal(err)
  }

  task, err := client.ImageToVideo.Create(context.Background(), ltxvideo.ImageToVideoParams{
    Model: ltxvideo.ImageToVideoModel("ltx-2.5-fast-image-to-video"),
    Prompt: "The camera slowly moves forward.",
    SourceImageURL: "https://cdn.runapi.ai/public/samples/image.jpg",
    OutputResolution: "720p",
    DurationSeconds: func(value int) *int { return &value }(6),
    FPS: func(value int) *int { return &value }(24),
  })
  if err != nil {
    log.Fatal(err)
  }
  _ = task
}
```

### ruby

#### 安装

```bash
gem install runapi-ltx-video
```

```ruby
require "runapi/ltx_video"

client = RunApi::LtxVideo::Client.new(api_key: ENV.fetch("RUNAPI_API_KEY"))
task = client.image_to_video.create(
  model: "ltx-2.5-fast-image-to-video",
  prompt: "The camera slowly moves forward.",
  source_image_url: "https://cdn.runapi.ai/public/samples/image.jpg",
  output_resolution: "720p",
  duration_seconds: 6,
  fps: 24
)
```

### java

#### 安装

```kotlin
implementation("ai.runapi:runapi-ltx-video")
```

```java
import ai.runapi.ltxvideo.LtxVideoClient;
import ai.runapi.ltxvideo.types.ImageToVideoParams;
import ai.runapi.core.polling.TaskCreateResponse;

public final class Example {
  public static void main(String[] args) {
    LtxVideoClient client = LtxVideoClient.builder()
        .apiKey(System.getenv("RUNAPI_API_KEY"))
        .build();
    TaskCreateResponse task = client.imageToVideo().create(
        ImageToVideoParams.builder()
        .model("ltx-2.5-fast-image-to-video")
        .prompt("The camera slowly moves forward.")
        .sourceImageUrl("https://cdn.runapi.ai/public/samples/image.jpg")
        .outputResolution("720p")
        .durationSeconds(6)
        .fps(24)
            .build()
    );
  }
}
```

### php

#### 安装

```bash
composer require runapi-ai/ltx-video
```

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use RunApi\Core\ClientOptions;
use RunApi\LtxVideo\LtxVideoClient;

$client = new LtxVideoClient(new ClientOptions(apiKey: getenv('RUNAPI_API_KEY')));
$task = $client->imageToVideo->create([
  "model" => "ltx-2.5-fast-image-to-video",
  "prompt" => "The camera slowly moves forward.",
  "source_image_url" => "https://cdn.runapi.ai/public/samples/image.jpg",
  "output_resolution" => "720p",
  "duration_seconds" => 6,
  "fps" => 24
]);
```

## 相关指南

- [API 身份验证](https://runapi.ai/zh-CN/docs/guides/authentication.md)
- [快速开始](https://runapi.ai/zh-CN/docs/guides/task-api/quickstart.md)

---

## RunAPI 的更多内容

- [首页](https://runapi.ai/zh-CN/.md)
- [模型目录](https://runapi.ai/zh-CN/models.md)
- [定价](https://runapi.ai/zh-CN/pricing.md)
- [提供方](https://runapi.ai/zh-CN/models)
- [提示词库](https://runapi.ai/zh-CN/prompts.md)
- [文档](https://runapi.ai/zh-CN/docs/guides)
- [SDK](https://runapi.ai/zh-CN/sdk.md)
- [CLI](https://runapi.ai/zh-CN/cli.md)
- [MCP Server](https://runapi.ai/zh-CN/mcp.md)
- [x402](https://runapi.ai/zh-CN/x402.md)
- [Claude Code 与 Cursor](https://runapi.ai/zh-CN/claude-code-vs-cursor.md)
- [Cursor API 设置](https://runapi.ai/zh-CN/cursor-api-setup.md)
- [RunAPI 与 OpenRouter](https://runapi.ai/zh-CN/openrouter-alternative.md)
- [企业版](https://runapi.ai/zh-CN/contact.md)
- [邀请返利](https://runapi.ai/zh-CN/referral-program.md)
- [联系](https://runapi.ai/zh-CN/contact.md)
- [服务条款](https://runapi.ai/zh-CN/terms.md)
- [隐私政策](https://runapi.ai/zh-CN/privacy.md)
- [智能体网站索引](https://runapi.ai/llms.txt)

联系我们: contact@runapi.ai

## 结构化数据

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-CN",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-CN",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/zh-CN/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-CN",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-CN",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/icon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-CN",
    "@type": "TechArticle",
    "headline": "LTX Video Image-to-Video",
    "description": "使用 LTX 2.5 Fast 或 Pro，将源图像制作成视频。",
    "url": "https://runapi.ai/zh-CN/docs/api/ltx-video/image-to-video",
    "mainEntityOfPage": "https://runapi.ai/zh-CN/docs/api/ltx-video/image-to-video"
  }
]
```
