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

# Generate embedding for video

> Generates embeddings for video in the same latent space as text, so that it is possible to perform text-to-video searches by embedding the text and comparing it to the video embeddings. 
 Embedding results can be retrieved from [get media endpoint](/api-reference/index-or-embed-videos/get-processing-status-embedding-and-metadata-of-video) 
 The videos url must be http(s) url to raw video files (e.g. mp4, mov, avi); Youtube web pages or cloud storage services URIs would not work.



## OpenAPI

````yaml post /media/embed
openapi: 3.1.0
info:
  title: tl;dw
  version: 0.0.1
  x-logo:
    url: https://app.trytldw.ai/static/images/sidebar_logo.svg
    backgroundColor: transparent
    altText: tl;dw Logo
  contact:
    name: tl;dw Support
    url: https://app.trytldw.ai/support
  termsOfService: https://app.trytldw.ai/terms
  x-apisguru-categories:
    - video
    - ai
servers:
  - url: https://api.trytldw.ai/v1
security: []
tags:
  - name: Collection
    description: Collection
  - name: Video
    description: Media
  - name: Account
    description: Account
paths:
  /media/embed:
    post:
      tags:
        - Index or Embed Videos
      summary: Generate embedding for video
      description: >-
        Generates embeddings for video in the same latent space as text, so that
        it is possible to perform text-to-video searches by embedding the text
        and comparing it to the video embeddings. 
         Embedding results can be retrieved from [get media endpoint](/api-reference/index-or-embed-videos/get-processing-status-embedding-and-metadata-of-video) 
         The videos url must be http(s) url to raw video files (e.g. mp4, mov, avi); Youtube web pages or cloud storage services URIs would not work.
      operationId: embed_media_media_embed_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/src__public_api__media_router__EmbedMediaRequest
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/src__public_api__media_router__EmbedMediaResponse
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    src__public_api__media_router__EmbedMediaRequest:
      properties:
        media_list:
          items:
            $ref: '#/components/schemas/NewMediaItem'
          type: array
          title: Media List
          description: List of videos to add. Maximum 10 media can be added per request
          examples:
            - external_id: video_1
              title: My Video1
              url: https//example.com/video1.mp4
            - external_id: video_2
              title: My Video2
              url: https//example.com/video2.mp4
      type: object
      required:
        - media_list
      title: EmbedMediaRequest
    src__public_api__media_router__EmbedMediaResponse:
      properties:
        media_list:
          items:
            $ref: '#/components/schemas/MediaStub'
          type: array
          title: Media List
      type: object
      required:
        - media_list
      title: EmbedMediaResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    NewMediaItem:
      properties:
        url:
          type: string
          title: Url
          description: >-
            The http or https URL to the raw video file. URL link to web page
            containing the video (e.g. Youtube Link), cloud storage services uri
            (e.g. uri starts with gs://) are not supported.
          examples:
            - https://example.com/video.mp4
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: User-defined media identifier
          examples:
            - video_12345
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
          description: The title of the media displayed in the search results
          examples:
            - My Video
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: >-
            User-defined media metadata, including ownership, geo location, etc.
            Key names can NOT start with underscore
          examples:
            - location:
                lat: 1
                lon: 2
              owner_id: user_123
      type: object
      required:
        - url
      title: NewMediaItem
    MediaStub:
      properties:
        id:
          type: string
          title: Id
          description: >-
            The ID of the video. Use this ID to retrieve task status, metadata
            and embedding of video
          examples:
            - c1a2b3c4-1a2b-3c4d-5e6f-7g8h9i0j1k2l
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          examples:
            - video_12345
        status:
          $ref: '#/components/schemas/MediaStatus'
          description: The status of the video understanding (e.g. indexing, embedding) job
      type: object
      required:
        - id
        - external_id
        - status
      title: MediaStub
    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
    MediaStatus:
      type: string
      enum:
        - PENDING
        - PROCESSING
        - COMPLETED
        - FAILED
      title: MediaStatus
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````