---
agentTools:
  projectIndex: https://elai.readme.io/llms.txt
---

# Create from text, HTML or URL

Generate a new video from URL, HTML or plain text.

The `{type}` segment selects the parser, and only `html` is special: anything else is read as plain text, which is why an invented `type` appears to work. It also becomes the video's tag unless you send `tags` — with one exception, the legacy value `gpt`, which is remapped to the tag `from prompt`.

Video will be generated in [story](https://elai.readme.io/reference/story-api) mode.

# HTML or URL

To create a video story from HTML or URL just set the type to "html" and send your content or URL in "from" param.

# Plain Text

To have complete control over the generation, you can send plain text in a specific format for a predictable result.

You can use headers (strings up to 105 characters) followed by paragraphs (unlimited text without linebreaks). Each header and paragraph should be separated by \n\n. Using such a format you can predict a number of slides and text for each. If you need more flexibility in converting plain text to slides, please send us a message at <support@elai.io>

Optionally you can have the first header as your video title.

#### Real-life plain text example.

```
AI Presenters\n\n Introduction\n\n Technology has changed the way we communicate, allowing us easily connect with others across the globe in an instant. Artificial intelligence (AI) is becoming increasingly import ant in this area, with AI presenters now available to deliver content in a professional and engaging way. AI presenters allow businesses to communicate with their audiences without the need for a human presenter, and can be trained to have a variety of skills. This presentation will discuss the benefits, applications, and limitations of AI presenters.\n\n Benefits\n\n Al presenters offer a number of benefits for businesses. They can be programmed to deliver content in any language, with a range of accents, styles, and personalities. They provide a consistent and engaging experience for audiences, as well as reducing costs, since program ming and maintaining the presenter is much cheaper than hiring a human presenter. AI presenters also ensure that content is delivered with accuracy and clarity.
```

> 🚧 Generate slides
>
> After successfull video creation in story mode, you won't be able to render video right away. First you need to [generate slides](https://elai.readme.io/reference/generate-slides) from your story.

# OpenAPI definition

````json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Elai Public API",
    "version": "1.0",
    "description": "Every endpoint below is served under `https://apis.elai.io/api/v1`.\n\n## Authentication\n\nSend your workspace API token as a bearer token on every request:\n\n```\nAuthorization: Bearer <your-api-token>\n```\n\nGenerate and rotate the token in the Elai web app under **Settings → API**, or through\n`POST /generateToken`. The token is scoped to one **workspace** and authenticates as that\nworkspace's admin user — it is not tied to an individual person, and it carries admin rights\ninside that workspace.\n\nA request with a missing, unknown or revoked token gets a bare `401` with no response body.\n\n> **Organizations on the Unlimited plan cannot use the API.** Their requests are rejected with the\n> same bare `401` as an invalid token, with nothing to distinguish the two. If a valid, freshly\n> generated token returns `401` on every endpoint, check the plan first.\n\n## Errors\n\nFailures carry a JSON body of the shape `{ \"message\": \"...\" }`. Validation failures on the newer\nendpoints may add an `errors` array naming the offending fields. `401` is the exception: it has no\nbody at all.\n\nBoth render endpoints are **fire-and-forget** — they queue work and return immediately, so a\n`200` means \"accepted\", not \"rendered\". Render failures surface only through the `video_error`\nwebhook, never as an HTTP error on the call that started the render.\n\n## Scope\n\nThis reference is generated from the running code rather than maintained by hand, so it cannot\nquietly fall behind the API it describes. It documents 96 operations across the\n`/api/v1` surface.\n\nEndpoints are grouped by subject in the sidebar. If something you need is missing, or an endpoint\ndoes not behave as described here, tell us.\n\n---\n\n_Generated from `chore/web-4760/api-v1-reference-build` at `5289745d` on 2026-09-04._"
  },
  "servers": [
    {
      "url": "https://apis.elai.io/api/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer",
        "x-default": "SECRET_KEY"
      }
    },
    "schemas": {
      "Slide": {
        "type": "object",
        "description": "One slide. The model stores slides as an untyped array, so this lists the keys the API and the renderer actually read rather than a closed contract — extra keys are preserved. See [Slide structure](ref:slide-structure) for the canvas in full.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique within the video, and must be a number."
          },
          "canvas": {
            "type": "object",
            "additionalProperties": true,
            "description": "Fabric.js canvas: `objects[]`, `background`, `version`."
          },
          "avatar": {
            "type": "object",
            "additionalProperties": true,
            "description": "The speaking avatar. A flat object — `code` identifies it (`id` is accepted but deprecated).",
            "properties": {
              "code": {
                "type": "string",
                "example": "gia.casual"
              },
              "name": {
                "type": "string",
                "example": "Gia Casual"
              },
              "gender": {
                "type": "string",
                "example": "female"
              },
              "version": {
                "type": "integer",
                "example": 2
              },
              "canvas": {
                "type": "string",
                "description": "Preview image for the avatar."
              }
            }
          },
          "speech": {
            "type": "string",
            "description": "What the avatar says. Stripped from `GET /videos` list responses."
          },
          "voice": {
            "type": "string",
            "example": "en-US-AriaNeural"
          },
          "voiceType": {
            "type": "string",
            "description": "How the speech is produced, e.g. `text`, `audio`, `silence`."
          },
          "voiceProvider": {
            "type": "string",
            "enum": [
              "azure",
              "google",
              "elevenlabs"
            ]
          },
          "language": {
            "type": "string",
            "example": "English"
          },
          "animation": {
            "type": "string",
            "example": "fade_in"
          },
          "status": {
            "type": "string",
            "description": "Set on story and outline slides while they are still placeholders."
          },
          "duration": {
            "type": [
              "number",
              "null"
            ],
            "description": "Seconds. `null` until the slide's speech has been synthesised."
          }
        }
      },
      "Video": {
        "type": "object",
        "description": "A video. Fields are as stored, so a draft carries far fewer of them than a rendered video.",
        "additionalProperties": true,
        "properties": {
          "_id": {
            "type": "string",
            "example": "420c6769343dc7bb51513e63"
          },
          "name": {
            "type": "string",
            "example": "Hello from API!"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "validating",
              "rendering",
              "moderation",
              "error",
              "ready"
            ],
            "description": "Only `ready` means the MP4 exists. `error` carries no reason here — that arrives on the `video_error` webhook."
          },
          "url": {
            "type": "string",
            "description": "The rendered MP4. Absent until `status` is `ready`."
          },
          "audioUrl": {
            "type": "string",
            "description": "Rendered audio track, when one was produced separately."
          },
          "thumbnail": {
            "type": "string"
          },
          "duration": {
            "type": "number",
            "description": "Seconds. Known once the speech has been synthesised."
          },
          "slides": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Slide"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Videos created over the API always carry `api`."
          },
          "public": {
            "type": "boolean",
            "default": false
          },
          "deleted": {
            "type": "boolean",
            "default": false
          },
          "verified": {
            "type": "boolean",
            "default": false
          },
          "version": {
            "type": "integer",
            "default": 0
          },
          "data": {
            "type": "object",
            "additionalProperties": true,
            "description": "Render settings — subtitles, background music, and similar. Passed through to the renderer untouched."
          },
          "template": {
            "type": "object",
            "additionalProperties": true,
            "description": "Present only on templates.",
            "properties": {
              "enabled": {
                "type": "boolean",
                "default": false
              },
              "private": {
                "type": "boolean",
                "default": true
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "order": {
                "type": "integer",
                "default": 1
              }
            }
          },
          "sourceId": {
            "type": "string",
            "description": "The template this video was created or copied from."
          },
          "userId": {
            "type": "string"
          },
          "accountId": {
            "type": "string",
            "description": "The workspace that owns it."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/videos/text/{type}": {
      "post": {
        "summary": "Create from text, HTML or URL",
        "description": "Generate a new video from URL, HTML or plain text.\n\nThe `{type}` segment selects the parser, and only `html` is special: anything else is read as plain text, which is why an invented `type` appears to work. It also becomes the video's tag unless you send `tags` — with one exception, the legacy value `gpt`, which is remapped to the tag `from prompt`.",
        "operationId": "create-from-text-url",
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "description": "Type of source you are generating video from: html (also works for URL), text (plain text).",
            "schema": {
              "type": "string",
              "enum": [
                "html",
                "text"
              ],
              "default": "html"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "description": "Html, plain text or URL to the source (eg https://blog.johndoe.me/about-ai-tools). By default story will be with no content."
                  },
                  "folderId": {
                    "type": "string",
                    "description": "Id of the folder where to create your video. By default video will be created in the root."
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Tags for the new video. If you omit this, the video is tagged with the `{type}` path segment itself. Either way `api` is prepended, so an API-created video always carries it."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "_id": "6464c9f3aacea2fbc41e7048",
                      "name": "Storyboard Draft",
                      "type": "story",
                      "data": {
                        "musicName": "Stay With Me",
                        "musicUrl": "https://elai-media.s3.eu-west-2.amazonaws.com/music/mixkit-stay-with-me-838.mp3",
                        "musicVolume": 0.08,
                        "musicShift": 0,
                        "resolution": "FullHD",
                        "templateType": "text-to-video"
                      },
                      "slides": [
                        {
                          "id": 130590379833,
                          "speech": "",
                          "avatar": {
                            "_id": "63bfb9c15c9b032d1df2f28a",
                            "id": "alma.business",
                            "name": "Business",
                            "type": null,
                            "version": 2,
                            "status": 2,
                            "gender": "female",
                            "thumbnail": "https://elai-avatars.s3.us-east-2.amazonaws.com/common/alma/business/alma_business.jpg",
                            "canvas": "https://elai-avatars.s3.us-east-2.amazonaws.com/common/alma/business/alma_business.png"
                          },
                          "voiceType": "text",
                          "animation": "fade_in",
                          "newlyAdded": false,
                          "screenshot": "https://elai-media.s3.eu-west-2.amazonaws.com/production/videos/6400c0b3de5e9629bff1e7dc/slide1052688866146_screenshot_1677771256781.jpg",
                          "status": "story",
                          "story": {
                            "templateSlideId": 1052688866146,
                            "header": "",
                            "subHeader": ""
                          }
                        }
                      ],
                      "tags": [],
                      "deleted": false,
                      "status": "draft",
                      "verified": false,
                      "public": false,
                      "sourceId": "",
                      "userId": "",
                      "accountId": "",
                      "createdAt": "2023-05-17T12:34:59.931Z",
                      "updatedAt": "2023-05-17T12:34:59.931Z"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Video"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {}
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false,
        "tags": [
          "Videos"
        ]
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "tags": [
    {
      "name": "Videos",
      "description": "Create, read, update and delete videos, and read their exports, history and player payload."
    }
  ],
  "_id": {
    "buffer": {
      "0": 106,
      "1": 154,
      "2": 229,
      "3": 101,
      "4": 201,
      "5": 178,
      "6": 243,
      "7": 252,
      "8": 223,
      "9": 58,
      "10": 69,
      "11": 151
    }
  }
}
````