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

# Upload Asset



## OpenAPI

````yaml openapi.json post /assets/{id}/upload
openapi: 3.1.0
info:
  title: Hedra Web API
  version: 0.1.0
servers:
  - url: https://api.hedra.com/web-app/public
    description: Hedra Public API
security: []
paths:
  /assets/{id}/upload:
    post:
      tags:
        - Public
      summary: Upload Asset
      operationId: upload_asset_public_assets__id__upload_post
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Id
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_upload_asset_public_assets__id__upload_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Asset'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    Body_upload_asset_public_assets__id__upload_post:
      properties:
        file:
          type: string
          format: binary
          title: File
      type: object
      required:
        - file
      title: Body_upload_asset_public_assets__id__upload_post
    Asset:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: The id of the asset.
        type:
          $ref: '#/components/schemas/AssetType'
          description: The type of the asset.
        name:
          type: string
          title: Name
          description: Name of the asset. Default to user-provided file name.
        thumbnail_url:
          type: string
          title: Thumbnail Url
          description: URL of the thumbnail image.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description of the asset.
        is_favorite:
          type: boolean
          title: Is Favorite
          description: Whether the asset is favorited by the user.
          default: false
        recent:
          type: boolean
          title: Recent
          description: Whether this asset was recently used by the user.
          default: false
        created_at:
          type: string
          title: Created At
          description: Date the asset was created.
        favorited_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Favorited At
          description: Date the asset was favorited.
        asset:
          oneOf:
            - $ref: '#/components/schemas/UploadedImage'
            - $ref: '#/components/schemas/UploadedAudio'
            - $ref: '#/components/schemas/UploadedVideo'
            - $ref: '#/components/schemas/GeneratedAudio'
            - $ref: '#/components/schemas/GeneratedImage'
            - $ref: '#/components/schemas/GeneratedVideo'
            - $ref: '#/components/schemas/Voice'
          title: Asset
          description: The asset itself.
          discriminator:
            propertyName: type
            mapping:
              generated_audio:
                $ref: '#/components/schemas/GeneratedAudio'
              generated_image:
                $ref: '#/components/schemas/GeneratedImage'
              generated_video:
                $ref: '#/components/schemas/GeneratedVideo'
              uploaded_audio:
                $ref: '#/components/schemas/UploadedAudio'
              uploaded_image:
                $ref: '#/components/schemas/UploadedImage'
              uploaded_video:
                $ref: '#/components/schemas/UploadedVideo'
              voice:
                $ref: '#/components/schemas/Voice'
      type: object
      required:
        - id
        - type
        - name
        - thumbnail_url
        - created_at
        - asset
      title: Asset
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AssetType:
      type: string
      enum:
        - text
        - image
        - audio
        - video
        - voice
      title: AssetType
    UploadedImage:
      properties:
        type:
          type: string
          const: uploaded_image
          title: Type
          default: uploaded_image
        width:
          type: integer
          title: Width
          description: Width of the image.
        height:
          type: integer
          title: Height
          description: Height of the image.
        url:
          type: string
          title: Url
          description: URL of the image.
      type: object
      required:
        - width
        - height
        - url
      title: UploadedImage
    UploadedAudio:
      properties:
        type:
          type: string
          const: uploaded_audio
          title: Type
          default: uploaded_audio
        duration_ms:
          type: integer
          title: Duration Ms
          description: Duration of the audio in seconds.
        url:
          type: string
          title: Url
          description: URL of the audio.
        transcriptions:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Transcriptions
          description: Transcriptions of the audio.
      type: object
      required:
        - duration_ms
        - url
      title: UploadedAudio
    UploadedVideo:
      properties:
        type:
          type: string
          const: uploaded_video
          title: Type
          default: uploaded_video
        width:
          type: integer
          title: Width
          description: Width of the video.
        height:
          type: integer
          title: Height
          description: Height of the video.
        duration_ms:
          type: integer
          title: Duration Ms
          description: Duration of the video in milliseconds.
        url:
          type: string
          title: Url
          description: URL of the video.
        download_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Download Url
          description: URL to download the video.
        streaming_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Streaming Url
          description: URL to stream the video.
        poster_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Poster Url
          description: URL of the poster image.
      type: object
      required:
        - width
        - height
        - duration_ms
        - url
      title: UploadedVideo
    GeneratedAudio:
      properties:
        type:
          type: string
          const: generated_audio
          title: Type
          default: generated_audio
        duration_ms:
          type: integer
          title: Duration Ms
          description: Duration of the audio in seconds.
        url:
          type: string
          title: Url
          description: URL of the audio.
        generated_audio_inputs:
          $ref: '#/components/schemas/GeneratedAudioInputs'
          description: Inputs for generating the audio.
        transcriptions:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Transcriptions
          description: Transcriptions of the audio.
      type: object
      required:
        - duration_ms
        - url
        - generated_audio_inputs
      title: GeneratedAudio
    GeneratedImage:
      properties:
        type:
          type: string
          const: generated_image
          title: Type
          default: generated_image
        width:
          type: integer
          title: Width
          description: Width of the image.
        height:
          type: integer
          title: Height
          description: Height of the image.
        url:
          type: string
          title: Url
          description: URL of the image.
        generated_image_inputs:
          $ref: '#/components/schemas/GeneratedImageInputs'
          description: Inputs for generating the image.
      type: object
      required:
        - width
        - height
        - url
        - generated_image_inputs
      title: GeneratedImage
    GeneratedVideo:
      properties:
        type:
          type: string
          const: generated_video
          title: Type
          default: generated_video
        width:
          type: integer
          title: Width
          description: Width of the image.
        height:
          type: integer
          title: Height
          description: Height of the image.
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
          description: URL of the image.
        download_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Download Url
          description: URL to download the video
        streaming_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Streaming Url
          description: URL to stream the video
        poster_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Poster Url
          description: URL of the poster image
        duration_ms:
          type: integer
          title: Duration Ms
          description: Duration of the video.
        preview_url:
          type: string
          title: Preview Url
          description: URL of the preview for animated thumbnails.
        generated_video_inputs:
          $ref: '#/components/schemas/GeneratedVideoInputs'
          description: Inputs for generating the video.
        keyframe_start:
          anyOf:
            - $ref: '#/components/schemas/Asset'
            - type: 'null'
          description: URL of the Image asset used as the start keyframe.
        keyframe_end:
          anyOf:
            - $ref: '#/components/schemas/Asset'
            - type: 'null'
          description: URL of the Image asset used as the end keyframe.
        audio:
          anyOf:
            - $ref: '#/components/schemas/Asset'
            - type: 'null'
          description: URL of the Audio asset used as the basis for the video.
        reference_image_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Reference Image Ids
          description: The id(s) of the image(s) referenced in the generation.
        source_video_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Source Video Id
          description: >-
            The id of the Video asset used as source input for motion
            control/video-to-video generation.
      type: object
      required:
        - width
        - height
        - duration_ms
        - preview_url
        - generated_video_inputs
        - keyframe_start
        - audio
      title: GeneratedVideo
    Voice:
      properties:
        type:
          type: string
          const: voice
          title: Type
          default: voice
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: External ID of the Voice.
        labels:
          items:
            $ref: '#/components/schemas/VoiceLabel'
          type: array
          title: Labels
          description: Labels that help identify the characteristics of the Voice.
        preview_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Preview Url
          description: Preview URL of the Voice.
        source:
          anyOf:
            - type: string
            - type: 'null'
          title: Source
          description: Source of the Voice.
      type: object
      title: Voice
    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
    GeneratedAudioInputs:
      properties:
        text_prompt:
          type: string
          title: Text Prompt
          description: Prompt for audio generation.
        ai_model_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Ai Model Id
          description: The id of the model used for generation.
        voice_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Voice Id
          description: The id of the voice used for generation.
        stability:
          anyOf:
            - type: number
            - type: 'null'
          title: Stability
          description: Stability setting used for generation (0-1).
        speed:
          anyOf:
            - type: number
            - type: 'null'
          title: Speed
          description: Speed setting used for generation (0.7-1.2).
        language:
          anyOf:
            - type: string
            - type: 'null'
          title: Language
          description: Language used for generation.
      type: object
      required:
        - text_prompt
      title: GeneratedAudioInputs
    GeneratedImageInputs:
      properties:
        text_prompt:
          type: string
          title: Text Prompt
          description: Prompt for image generation.
        ai_model_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Ai Model Id
          description: The id of the model used for generation.
        aspect_ratio:
          anyOf:
            - type: string
            - type: 'null'
          title: Aspect Ratio
          description: Aspect ratio used for generation.
        resolution:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolution
          description: Resolution used for generation.
        start_keyframe_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Start Keyframe Id
          description: The id of the Image asset used as the start keyframe.
        reference_image_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Reference Image Ids
          description: The id(s) of the image(s) referenced in the generation.
      type: object
      required:
        - text_prompt
      title: GeneratedImageInputs
    GeneratedVideoInputs:
      properties:
        text_prompt:
          type: string
          title: Text Prompt
          description: Prompt for video generation.
        ai_model_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Ai Model Id
          description: The id of the model used for generation.
        resolution:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolution
          description: Resolution for the video.
        aspect_ratio:
          anyOf:
            - type: string
            - type: 'null'
          title: Aspect Ratio
          description: Aspect ratio for the video.
        duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration Ms
          description: Duration of the video in milliseconds.
        bounding_box_target:
          anyOf:
            - $ref: '#/components/schemas/NormalizedPoint'
            - type: 'null'
          description: >-
            Normalized coordinates for primary speaker position (Character3
            only)
        character_orientation:
          anyOf:
            - type: string
              enum:
                - video
                - image
            - type: 'null'
          title: Character Orientation
          description: >-
            For motion control models: 'video' matches reference video
            orientation (better for complex motions, max 30s), 'image' preserves
            character image orientation (better for camera movements, max 10s).
        enhance_prompt:
          type: boolean
          title: Enhance Prompt
          description: If true, automatically enhance the prompt before generation.
          default: false
      type: object
      required:
        - text_prompt
      title: GeneratedVideoInputs
    VoiceLabel:
      properties:
        name:
          type: string
          title: Name
          description: Label name.
        value:
          type: string
          title: Value
          description: Label value.
      type: object
      required:
        - name
        - value
      title: VoiceLabel
    NormalizedPoint:
      prefixItems:
        - type: number
          maximum: 1
          minimum: 0
          title: X
          description: Normalized x coordinate.
        - type: number
          maximum: 1
          minimum: 0
          title: 'Y'
          description: Normalized y coordinate.
      type: array
      maxItems: 2
      minItems: 2
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````