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

# Get Video Details API Reference - Magic Hour Docs

> Check the progress of a video project. The `downloads` field is populated after a successful render.
  
**Statuses**
- `queued` — waiting to start
- `rendering` — in progress
- `complete` — ready; see `downloads`
- `error` — a failure occurred (see `error`)
- `canceled` — user canceled
- `draft` — not used



## OpenAPI

````yaml get /v1/video-projects/{id}
openapi: 3.0.2
info:
  title: Magic Hour API
  version: beta
  description: >

    Magic Hour provides an API (beta) that can be integrated into your own
    application to generate videos and images using AI. 


    Webhook documentation can be found
    [here](https://magichour.ai/docs/webhook).


    If you have any questions, please reach out to us via
    [discord](https://discord.gg/JX5rgsZaJp).


    # Authentication


    Every request requires an API key.


    To get started, first generate your API key
    [here](https://magichour.ai/settings/developer).


    Then, add the `Authorization` header to the request.


    | Key | Value |

    |-|-|

    | Authorization | Bearer mhk_live_apikey |


    > **Warning**: any API call that renders a video will utilize credits in
    your account.
  termsOfService: https://magichour.ai/terms-of-service
servers:
  - url: https://api.magichour.ai
security: []
tags:
  - name: Files
    description: API related to uploading assets used for video generation
  - name: Image Projects
    description: API related to image projects
  - name: Video Projects
    description: API related to video projects
  - name: Audio Projects
    description: API related to audio projects
paths:
  /v1/video-projects/{id}:
    get:
      tags:
        - Video Projects
      summary: Get video details
      description: >-
        Check the progress of a video project. The `downloads` field is
        populated after a successful render.
          
        **Statuses**

        - `queued` — waiting to start

        - `rendering` — in progress

        - `complete` — ready; see `downloads`

        - `error` — a failure occurred (see `error`)

        - `canceled` — user canceled

        - `draft` — not used
      operationId: videoProjects.getDetails
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            example: cuid-example
          description: >-
            Unique ID of the video project. This value is returned by all of the
            POST APIs that create a video.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: cuid-example
                    description: >-
                      Unique ID of the video. Use it with the [Get video Project
                      API](https://docs.magichour.ai/api-reference/video-projects/get-video-details)
                      to fetch status and downloads.
                  name:
                    type: string
                    nullable: true
                    description: The name of the video.
                    example: Example Name
                  status:
                    type: string
                    enum:
                      - draft
                      - queued
                      - rendering
                      - complete
                      - error
                      - canceled
                    description: The status of the video.
                    example: complete
                  type:
                    type: string
                    description: >-
                      The type of the video project. Possible values are
                      ANIMATION, AUTO_SUBTITLE, VIDEO_TO_VIDEO, FACE_SWAP,
                      TEXT_TO_VIDEO, IMAGE_TO_VIDEO, LIP_SYNC, TALKING_PHOTO,
                      VIDEO_UPSCALER, EXTEND, AUDIO_TO_VIDEO, VIDEO_EXPANDER,
                      UGC_AD
                    example: FACE_SWAP
                  created_at:
                    type: string
                    format: date-time
                  width:
                    type: integer
                    description: >-
                      The width of the final output video. A value of -1
                      indicates the width can be ignored.
                    example: 512
                  height:
                    type: integer
                    description: >-
                      The height of the final output video. A value of -1
                      indicates the height can be ignored.
                    example: 960
                  enabled:
                    type: boolean
                    description: Whether this resource is active. If false, it is deleted.
                  start_seconds:
                    type: number
                    minimum: 0
                    description: Start time of your clip (seconds). Must be ≥ 0.
                    format: float
                    example: 0
                  end_seconds:
                    type: number
                    minimum: 0.1
                    description: >-
                      End time of your clip (seconds). Must be greater than
                      start_seconds.
                    format: float
                    example: 15
                  credits_charged:
                    type: integer
                    description: >-
                      The amount of credits deducted from your account to
                      generate the video. If the status is not 'complete', this
                      value is an estimate and may be adjusted upon completion
                      based on the actual FPS of the output video. 


                      If video generation fails, credits will be refunded, and
                      this field will be updated to include the refund.
                    example: 450
                  fps:
                    type: number
                    description: >-
                      Frame rate of the video. If the status is not 'complete',
                      the frame rate is an estimate and will be adjusted when
                      the video completes.
                    example: 30
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                        description: Details on the reason why a failure happened.
                        example: Please use an image with a detectable face
                      code:
                        type: string
                        example: no_source_face
                        description: An error code to indicate why a failure happened.
                    required:
                      - message
                      - code
                    nullable: true
                    description: >-
                      In the case of an error, this object will contain the
                      error encountered during video render
                    example: null
                  downloads:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                          format: uri
                          example: https://videos.magichour.ai/id/output.mp4
                        expires_at:
                          type: string
                          format: date-time
                          example: '2024-10-19T05:16:19.027Z'
                      required:
                        - url
                        - expires_at
                      description: >-
                        The download url and expiration date of the image
                        project
                required:
                  - id
                  - name
                  - status
                  - type
                  - created_at
                  - width
                  - height
                  - enabled
                  - start_seconds
                  - end_seconds
                  - total_frame_cost
                  - credits_charged
                  - fps
                  - error
                  - downloads
                  - download
                description: Success
        '400':
          description: Invalid Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
                description: The request is invalid
                example:
                  message: Missing request body
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - Unauthorized
                required:
                  - message
                description: The request is not properly authenticated
                example:
                  message: Unauthorized
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
                description: The request requires payment
                example:
                  message: Payment required
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - Not Found
                required:
                  - message
                description: Requested resource is not found
                example:
                  message: Not Found
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: python
          source: |-
            from magic_hour import Client
            from os import getenv

            client = Client(token=getenv("API_TOKEN"))
            res = client.v1.video_projects.get(id="cuid-example")
        - lang: javascript
          source: >-
            import { Client } from "magic-hour";


            const client = new Client({ token: process.env["API_TOKEN"]!! });

            const res = await client.v1.videoProjects.get({ id: "cuid-example"
            });
        - lang: go
          source: "package main\n\nimport (\n\tos \"os\"\n\n\tsdk \"github.com/magichourhq/magic-hour-go/client\"\n\tvideo_projects \"github.com/magichourhq/magic-hour-go/resources/v1/video_projects\"\n)\n\nfunc main() {\n\tclient := sdk.NewClient(\n\t\tsdk.WithBearerAuth(os.Getenv(\"API_TOKEN\")),\n\t)\n\tres, err := client.V1.VideoProjects.Get(video_projects.GetRequest{\n\t\tId: \"cuid-example\",\n\t})\n}"
        - lang: rust
          source: |-
            let client = magic_hour::Client::default()
                .with_bearer_auth(&std::env::var("API_TOKEN").unwrap());
            let res = client
                .v1()
                .video_projects()
                .get(magic_hour::resources::v1::video_projects::GetRequest {
                    id: "cuid-example".to_string(),
                })
                .await;
        - lang: curl
          source: |-
            curl --request GET \
                 --url https://api.magichour.ai/v1/video-projects/id \
                 --header 'accept: application/json' \
                 --header 'authorization: Bearer <token>'
        - lang: php
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://api.magichour.ai/v1/video-projects/id",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "accept: application/json",
                "authorization: Bearer <token>"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: java
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://api.magichour.ai/v1/video-projects/id")
              .header("accept", "application/json")
              .header("authorization", "Bearer <token>")
              .asString();
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <api_key>`, where
        `<api_key>` is your API key. To get your API key, go to [Developer
        Hub](https://magichour.ai/developer?tab=api-keys) and click "Create new
        API Key".

````