---
updatedAt: 2026-08-06T10:00:39.000Z
---

# Request generation

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "NVIDIA NIM API for stabilityai/stable-video-diffusion",
    "description": "The NVIDIA NIM REST API. Please see https://docs.api.nvidia.com/nim for more details.",
    "version": "1.0.0",
    "termsOfService": "https://nvidia.com/legal/terms-of-use",
    "contact": {
      "name": "NVIDIA Support",
      "url": "https://help.nvidia.com/"
    },
    "license": {
      "name": "STABLE VIDEO DIFFUSION NON-COMMERCIAL COMMUNITY",
      "url": "https://github.com/Stability-AI/generative-models/blob/main/model_licenses/LICENSE-SVD"
    }
  },
  "servers": [
    {
      "url": "https://ai.api.nvidia.com/v1/"
    }
  ],
  "paths": {
    "/genai/stabilityai/stable-video-diffusion": {
      "post": {
        "summary": " Infer",
        "operationId": "_infer_infer_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-nvai-meta": {
          "name": "Generate a new video from an image",
          "returns": "Returns an video artifact that consists from a generated video (mp4) encoded in base64, finish reason and a seed used during the generation",
          "path": "infer",
          "examples": [
            {
              "name": "",
              "requestJson": "'{\n    \"image\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAEElEQVR4nGK6HcwNCAAA//8DTgE8HuxwEQAAAABJRU5ErkJggg==\",\n}'\n",
              "responseJson": "'{\n            \"video\":  \"...very long string...\",\n            \"finish_reason\": \"SUCCESS\",\n            \"seed\": 1100106574\n}'\n"
            }
          ],
          "templates": [
            {
              "title": "Example",
              "requestEjs": {
                "python": "\nimport requests\n\ninvoke_url = \"https://api.nvcf.nvidia.com/v2/nvcf/pexec/functions/$STABLE_VIDEO_DIFFUSION_FUNCTION_ID\"\nfetch_url_format = \"https://api.nvcf.nvidia.com/v2/nvcf/pexec/status/\"\n\nheaders = {\n    \"Authorization\": \"Bearer $API_KEY_REQUIRED_IF_EXECUTING_OUTSIDE_NGC\",\n    \"Accept\": \"application/json\",\n}\n\npayload = {\n  \"image\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAEElEQVR4nGK6HcwNCAAA//8DTgE8HuxwEQAAAABJRU5ErkJggg==\",\n  \"cfg_scale\": 2.5,\n  \"seed\": 0\n}\n\n# re-use connections\nsession = requests.Session()\n\nresponse = session.post(invoke_url, headers=headers, json=payload)\n\nwhile response.status_code == 202:\n    request_id = response.headers.get(\"NVCF-REQID\")\n    fetch_url = fetch_url_format + request_id\n    response = session.get(fetch_url, headers=headers)\n\nresponse.raise_for_status()\nresponse_body = response.json()\nprint(response_body)\n",
                "node.js": "import fetch from \"node-fetch\";\n\nconst invokeUrl = \"https://api.nvcf.nvidia.com/v2/nvcf/pexec/functions/$STABLE_VIDEO_DIFFUSION_FUNCTION_ID\"\nconst fetchUrlFormat = \"https://api.nvcf.nvidia.com/v2/nvcf/pexec/status/\"\n\nconst headers = {\n    \"Authorization\": \"Bearer $API_KEY_REQUIRED_IF_EXECUTING_OUTSIDE_NGC\",\n    \"Accept\": \"application/json\",\n}\n\nconst payload = {\n  \"image\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAEElEQVR4nGK6HcwNCAAA//8DTgE8HuxwEQAAAABJRU5ErkJggg==\",\n  \"cfg_scale\": 2.5,\n  \"seed\": 0\n}\n\nlet response = await fetch(invokeUrl, {\n    method: \"post\",\n    body: JSON.stringify(payload),\n    headers: { \"Content-Type\": \"application/json\", ...headers }\n});\n\nwhile (response.status == 202) {\n  let requestId = response.headers.get(\"NVCF-REQID\")\n  let fetchUrl = fetchUrlFormat + requestId;\n  response = await fetch(fetchUrl, {\n      method: \"get\",\n      headers: headers\n  })\n}\n\nif (response.status != 200) {\n  let errBody = await (await response.blob()).text()\n  throw \"invocation failed with status \" + response.status + \" \" + errBody\n}\n\nlet response_body = await response.json()\n\nconsole.log(JSON.stringify(response_body))\n",
                "curl": "\ninvoke_url='https://api.nvcf.nvidia.com/v2/nvcf/pexec/functions/$STABLE_VIDEO_DIFFUSION_FUNCTION_ID'\nfetch_url_format='https://api.nvcf.nvidia.com/v2/nvcf/pexec/status/'\n\nauthorization_header='Authorization: Bearer $API_KEY_REQUIRED_IF_EXECUTING_OUTSIDE_NGC'\naccept_header='Accept: application/json'\ncontent_type_header='Content-Type: application/json'\n\ndata='{\n  \"image\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAEElEQVR4nGK6HcwNCAAA//8DTgE8HuxwEQAAAABJRU5ErkJggg==\",\n  \"cfg_scale\": 2.5,\n  \"seed\": 0\n}'\n\nresponse=$(curl --silent -i -w \"\n%{http_code}\" --request POST   --url \"$invoke_url\"   --header \"$authorization_header\"   --header \"$accept_header\"   --header \"$content_type_header\"   --data \"$data\"\n)\n\nhttp_code=$(echo \"$response\" | tail -n 1)\nreq_id=$(echo \"$response\" | grep -i '^nvcf-reqid:' | awk '{print $2}' | tr -d '\r')\n\nwhile [ \"$http_code\" -eq 202 ]; do\n  response=$(curl --silent -i -w \"\n%{http_code}\" --request GET     --url \"$fetch_url_format$req_id\"     --header \"$authorization_header\"     --header \"$accept_header\"     --header \"$content_type_header\"   )\n\n  http_code=$(echo \"$response\" | tail -n 1)\n  req_id=$(echo \"$response\" | grep -i '^nvcf-reqid:' | awk '{print $2}' | tr -d '\r')\ndone\n\necho \"$response\" | awk '/{/,EOF-1'\n"
              },
              "response": "'{\n            \"video\":  \"...very long string...\",\n            \"finish_reason\": \"SUCCESS\",\n            \"seed\": 1100106574\n}'\n"
            }
          ]
        }
      }
    }
  },
  "security": [
    {
      "Token": []
    }
  ],
  "components": {
    "securitySchemes": {
      "Token": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "FinishReason": {
        "enum": [
          "CONTENT_FILTERED",
          "ERROR",
          "SUCCESS"
        ],
        "title": "FinishReason",
        "type": "string"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "VideoRequest": {
        "additionalProperties": false,
        "properties": {
          "image": {
            "description": "A base64-encoded string of the initial image that will be scaled to 1024x576. Images should be in form of `data:image/{format};base64,{base64encodedimage}` if it's smaller than 200KB. Otherwise, it needs to be uploaded to a presigned S3 bucket using NVCF Asset APIs.Once uploaded you can refer to it using the following format: `data:image/png;asset_id,{asset_id}`.Accepted formats are `jpg`, `png` and `jpeg`.",
            "examples": [
              "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAEElEQVR4nGK6HcwNCAAA//8DTgE8HuxwEQAAAABJRU5ErkJggg==",
              "data:image/png;asset_id,5576911c-6031-47a4-8796-bb506b026ad0"
            ],
            "title": "Image",
            "type": "string"
          },
          "seed": {
            "exclusiveMaximum": 4294967296,
            "minimum": 0,
            "type": "integer",
            "default": 0,
            "description": "The seed which governs generation. Omit this option or use 0 for a random seed",
            "title": "Seed"
          },
          "cfg_scale": {
            "exclusiveMinimum": 1,
            "maximum": 9,
            "type": "number",
            "default": 1.8,
            "description": "How strongly the video sticks to the original image. Use lower values to allow the model more freedom to make changes and higher values to correct motion distortions.",
            "title": "Cfg Scale"
          },
          "motion_bucket_id": {
            "maximum": 127,
            "minimum": 127,
            "type": "integer",
            "default": 127,
            "description": "Controls how much motion to add/remove from the image. Only motion_bucket_id=127 is supported",
            "title": "Motion Bucket Id"
          }
        },
        "required": [
          "image"
        ],
        "title": "VideoRequest",
        "type": "object"
      },
      "VideoResponse": {
        "properties": {
          "video": {
            "description": "A base64-encoded string of the generated video (mp4)",
            "examples": [
              "/9j/4AAQSkZ...b+AVZ/9k="
            ],
            "title": "Video",
            "type": "string"
          },
          "finish_reason": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FinishReason"
              }
            ],
            "description": "The result of the generation process. `SUCCESS` indicates success. `ERROR` indicates an error. `CONTENT_FILTERED` indicates the result affected by the content filter"
          },
          "seed": {
            "description": "The seed used during generation",
            "title": "Seed",
            "type": "integer"
          }
        },
        "required": [
          "video",
          "finish_reason",
          "seed"
        ],
        "title": "VideoResponse",
        "type": "object"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```