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

# Runway Image To Video

> Use DeerAPI to call the Runway Image To Video endpoint with request details, response details, examples, and an OpenAPI playground.

## Overview

Use this endpoint to call the Runway Image To Video workflow through DeerAPI. The API reference on this page shows the request schema, response schema, authentication requirements, and runnable examples for the configured endpoint.

## Before you start

Use the DeerAPI base URL and pass your API Key in the `Authorization` header:

```text theme={null}
https://api.deerapi.com
```

```text theme={null}
Authorization: Bearer $DEERAPI_KEY
```

## Model selection

Choose a current model ID from the [live pricing page](https://api.deerapi.com/pricing). Model availability changes over time, so avoid copying a model ID from an old project without checking the live list first.

## Implementation notes

* Use the OpenAPI playground for the exact request fields accepted by this endpoint.
* Keep API Keys on the server side when you build production applications.
* Log the request ID from failed calls so support can investigate the request.
* Retry `429`, `500`, and `503` responses with exponential backoff.


## OpenAPI

````yaml /api/openapi/video/runway/compat/post-image-to-video.openapi.json POST /runway/pro/generate
openapi: 3.1.0
info:
  title: Generate with Reference Image API
  version: 1.0.0
servers:
  - url: https://api.deerapi.com
security:
  - bearerAuth: []
paths:
  /runway/pro/generate:
    post:
      summary: Generate with Reference Image API
      operationId: generate
      parameters:
        - name: X-Runway-Version
          in: header
          required: false
          description: ''
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - image
                - model
                - prompt
                - callback_url
                - ratio
              properties:
                callback_url:
                  type: string
                  description: Use this field according to the endpoint schema.
                  default: example
                ratio:
                  type: string
                  description: Use this field according to the endpoint schema.
                  default: example
                prompt:
                  type: string
                  description: Use this field according to the endpoint schema.
                  default: Hello
                style:
                  type: string
                  description: Use this field according to the endpoint schema.
                model:
                  type: string
                  description: Use this field according to the endpoint schema.
                  default: gen4
                options:
                  type: object
                  description: Use this field according to the endpoint schema.
                  properties:
                    seconds:
                      type: integer
                      description: Use this field according to the endpoint schema.
                    motion_vector:
                      type: object
                      description: Use this field according to the endpoint schema.
                      properties:
                        x:
                          type: number
                          description: Use this field according to the endpoint schema.
                        'y':
                          type: integer
                          description: Use this field according to the endpoint schema.
                        z:
                          type: integer
                          description: Use this field according to the endpoint schema.
                        r:
                          type: integer
                          description: Use this field according to the endpoint schema.
                        bg_x_pan:
                          type: integer
                          description: Use this field according to the endpoint schema.
                        bg_y_pan:
                          type: integer
                          description: Use this field according to the endpoint schema.
                    image_as_end_frame:
                      type: boolean
                      description: Use this field according to the endpoint schema.
                    flip:
                      type: boolean
                      description: Use this field according to the endpoint schema.
                image:
                  type: string
                  description: Use this field according to the endpoint schema.
                  default: example
                last_image:
                  type: string
                  description: Use this field according to the endpoint schema.
              default:
                callback_url: https://your-server.com/callback
                image: https://db.xiaohuhd.com/1.jpeg
                style: cinematic
                model: gen4
                prompt: >-
                  A cinematic shot of a modern glass workspace at sunrise with
                  smooth camera movement.
                options:
                  seconds: 10
                  image_as_end_frame: false
                  flip: false
                  motion_vector:
                    x: -6.2
                    'y': 0
                    z: 0
                    r: 0
                    bg_x_pan: 0
                    bg_y_pan: 0
            examples:
              Default:
                summary: Default
                value:
                  callback_url: https://your-server.com/callback
                  image: https://db.xiaohuhd.com/1.jpeg
                  style: cinematic
                  model: gen4
                  prompt: >-
                    A cinematic shot of a modern glass workspace at sunrise with
                    smooth camera movement.
                  options:
                    seconds: 10
                    image_as_end_frame: false
                    flip: false
                    motion_vector:
                      x: -6.2
                      'y': 0
                      z: 0
                      r: 0
                      bg_x_pan: 0
                      bg_y_pan: 0
            example:
              callback_url: https://your-server.com/callback
              image: https://db.xiaohuhd.com/1.jpeg
              style: cinematic
              model: gen4
              prompt: >-
                A cinematic shot of a modern glass workspace at sunrise with
                smooth camera movement.
              options:
                seconds: 10
                image_as_end_frame: false
                flip: false
                motion_vector:
                  x: -6.2
                  'y': 0
                  z: 0
                  r: 0
                  bg_x_pan: 0
                  bg_y_pan: 0
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - msg
                  - data
                  - exec_time
                properties:
                  code:
                    type: integer
                    description: Use this field according to the endpoint schema.
                  msg:
                    type: string
                    description: Use this field according to the endpoint schema.
                  data:
                    type: object
                    required:
                      - task_id
                    properties:
                      task_id:
                        type: string
                        description: Use this field according to the endpoint schema.
                      state:
                        type:
                          - string
                          - 'null'
                        description: Use this field according to the endpoint schema.
                      status:
                        type:
                          - string
                          - 'null'
                        description: Use this field according to the endpoint schema.
                      prompt:
                        type:
                          - string
                          - 'null'
                        description: Use this field according to the endpoint schema.
                      prompt_en:
                        type:
                          - string
                          - 'null'
                        description: Use this field according to the endpoint schema.
                      video_url:
                        type:
                          - string
                          - 'null'
                        description: Use this field according to the endpoint schema.
                      raw_video_url:
                        type:
                          - string
                          - 'null'
                        description: Use this field according to the endpoint schema.
                      poster:
                        type:
                          - string
                          - 'null'
                        description: Use this field according to the endpoint schema.
                      last_frame:
                        type:
                          - string
                          - 'null'
                        description: Use this field according to the endpoint schema.
                      msg:
                        type:
                          - string
                          - 'null'
                        description: Use this field according to the endpoint schema.
                      point:
                        type:
                          - string
                          - 'null'
                      refund:
                        type:
                          - string
                          - 'null'
                      create_time:
                        type:
                          - string
                          - 'null'
                        description: Use this field according to the endpoint schema.
                      update_time:
                        type:
                          - string
                          - 'null'
                        description: Use this field according to the endpoint schema.
                    additionalProperties: true
                  exec_time:
                    type: number
                    description: Use this field according to the endpoint schema.
                example:
                  code: 200
                  msg: Request accepted.
                  data:
                    task_id: 221c136d-7888-43c3-acd3-1fcc90d51cfd
                    state: ''
                    status: '0'
                    prompt: ''
                    prompt_en: null
                    video_url: null
                    raw_video_url: null
                    poster: null
                    last_frame: null
                    msg: null
                    create_time: '0'
                    update_time: '0'
                  exec_time: 0
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl https://api.deerapi.com/runway/pro/generate \
              -H "Content-Type: application/json" \
              -H "Authorization: Bearer $DEERAPI_KEY" \
              -d '{
                "callback_url": "https://your-server.com/callback",
                "image": "https://db.xiaohuhd.com/1.jpeg",
                "style": "cinematic",
                "model": "gen4",
                "prompt": "A cinematic shot of a modern glass workspace at sunrise with smooth camera movement.",
                "options": {
                  "seconds": 10,
                  "image_as_end_frame": false,
                  "flip": false,
                  "motion_vector": {
                    "x": -6.2,
                    "y": 0,
                    "z": 0,
                    "r": 0,
                    "bg_x_pan": 0,
                    "bg_y_pan": 0
                  }
                }
              }'
        - lang: Python
          label: requests
          source: |
            import os
            import requests

            url = "https://api.deerapi.com/runway/pro/generate"
            headers = {
                "Authorization": "Bearer " + os.environ["DEERAPI_KEY"],
                "Content-Type": "application/json",
            }
            payload = {
              "callback_url": "https://your-server.com/callback",
              "image": "https://db.xiaohuhd.com/1.jpeg",
              "style": "cinematic",
              "model": "gen4",
              "prompt": "A cinematic shot of a modern glass workspace at sunrise with smooth camera movement.",
              "options": {
                "seconds": 10,
                "image_as_end_frame": false,
                "flip": false,
                "motion_vector": {
                  "x": -6.2,
                  "y": 0,
                  "z": 0,
                  "r": 0,
                  "bg_x_pan": 0,
                  "bg_y_pan": 0
                }
              }
            }

            response = requests.post(url, headers=headers, json=payload)
            print(response.json())
        - lang: JavaScript
          label: fetch
          source: >
            const response = await
            fetch("https://api.deerapi.com/runway/pro/generate", {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.DEERAPI_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                "callback_url": "https://your-server.com/callback",
                "image": "https://db.xiaohuhd.com/1.jpeg",
                "style": "cinematic",
                "model": "gen4",
                "prompt": "A cinematic shot of a modern glass workspace at sunrise with smooth camera movement.",
                "options": {
                  "seconds": 10,
                  "image_as_end_frame": false,
                  "flip": false,
                  "motion_vector": {
                    "x": -6.2,
                    "y": 0,
                    "z": 0,
                    "r": 0,
                    "bg_x_pan": 0,
                    "bg_y_pan": 0
                  }
                }
              }),
            });


            console.log(await response.json());
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Use a DeerAPI API Key as a Bearer token.

````