# Create with Video Agent

Generate a video with a one-shot prompt.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "heygen-api",
    "version": "4.0.8"
  },
  "servers": [
    {
      "url": "https://api.heygen.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "x-api-key",
        "in": "header",
        "x-default": "<your-api-key>"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v1/video_agent/generate": {
      "post": {
        "description": "",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Displays error message when the request fails; null if the request is successful."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "video_id": {
                          "type": "string",
                          "description": "Unique identifier of the generated video."
                        }
                      },
                      "description": "Contains the video ID."
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        },
        "parameters": [],
        "operationId": "post_v1-video-agent-generate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "description": "Prompt provided to Video Agent. Refer to our [Prompt Guide ](https://www.heygen.com/blog/video-agent-prompt-guide) for best practices."
                  },
                  "config": {
                    "type": "object",
                    "properties": {
                      "avatar_id": {
                        "type": "string",
                        "description": "Unique identifier of the avatar. Can be retrieved from [List All Avatars (V2)](https://docs.heygen.com/reference/list-avatars-v2) endpoint."
                      },
                      "duration_sec": {
                        "type": "integer",
                        "description": "Approximate Duration in Seconds. If supplied, the minimum value is 5.",
                        "default": ""
                      },
                      "orientation": {
                        "type": "string",
                        "description": "",
                        "enum": [
                          "portrait",
                          "landscape"
                        ]
                      }
                    },
                    "description": "Optional configurations for the video, including setting a specific avatar for the video."
                  },
                  "files": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "asset_id": {
                          "type": "string",
                          "description": "Unique identifier of the uploaded asset. Can be retrieved from the response of [Upload Asset](https://docs.heygen.com/reference/upload-asset) endpoint."
                        }
                      },
                      "type": "object"
                    },
                    "description": "List of assets that Video Agent can reference."
                  },
                  "callback_id": {
                    "type": "string",
                    "description": "Custom ID for callback and webhook purposes. Returned in the status payload for tracking."
                  },
                  "callback_url": {
                    "type": "string",
                    "description": "URL to notify when video rendering is complete, useful when your callback endpoint is dynamic and each video requires a separate callback. Using a webhook endpoint is still the recommended approach, as it provides more customization options such as secrets, event filtering, and more. If both webhook and callback_url are used, events will be sent to both endpoints."
                  }
                },
                "required": [
                  "prompt"
                ]
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```