> ## 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.

# Estimate video credits

> Get the credits a video create request charges when it is submitted. Pass `tool`, then the fields below that the tool's create request uses, with the same values. Tools billed per frame charge an estimate at submission, assuming 30 fps for an uploaded video, and settle to the frames that render. Does not create a project or spend credits. It prices the fields passed here. It does not check your plan, your balance or the rest of the create request.



## OpenAPI

````yaml get /v1/estimate/video
openapi: 3.0.2
info:
  title: Magic Hour API
  version: beta
  description: >

    Magic Hour provides a REST API (beta) for generating and editing video,
    images, and audio using AI.


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


    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/developer?tab=api-keys&utm_source=docs&utm_medium=referral&utm_campaign=api-reference).


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


    | Key | Value |

    |-|-|

    | Authorization | Bearer mhk_live_apikey |


    > **Warning**: API generation and editing requests consume account credits.
    Cost varies by tool, model, and settings; see [API
    pricing](https://magichour.ai/api#api-cost-calculator).
  termsOfService: https://magichour.ai/terms-of-service
servers:
  - url: https://api.magichour.ai
security: []
tags:
  - name: Video Projects
    description: API related to video projects
  - name: Image Projects
    description: API related to image projects
  - name: Audio Projects
    description: API related to audio projects
  - name: Files
    description: API related to uploading and reusing assets
  - name: Account
    description: API related to the account that owns the API key
paths:
  /v1/estimate/video:
    get:
      tags:
        - Video Projects
      summary: Estimate video credits
      description: >-
        Get the credits a video create request charges when it is submitted.
        Pass `tool`, then the fields below that the tool's create request uses,
        with the same values. Tools billed per frame charge an estimate at
        submission, assuming 30 fps for an uploaded video, and settle to the
        frames that render. Does not create a project or spend credits. It
        prices the fields passed here. It does not check your plan, your balance
        or the rest of the create request.
      operationId: estimate.video
      parameters:
        - name: tool
          in: query
          description: >-
            The create endpoint to price, named by its path. For example
            `image-to-video` for `POST /v1/image-to-video`.
          required: true
          schema:
            type: string
            enum:
              - image-to-video
              - text-to-video
              - ai-ugc-ad
              - ai-video-editor
              - character-replace
              - audio-to-video
              - ai-video-translator
              - ai-video-upscaler
              - face-swap
              - auto-subtitle-generator
            example: image-to-video
        - name: end_seconds
          in: query
          description: The `end_seconds` of the create request. Used by every tool.
          required: true
          schema:
            type: number
            example: 5
        - name: start_seconds
          in: query
          description: >-
            The `start_seconds` of the create request, for tools whose create
            request has it. Defaults to 0.
          schema:
            type: number
        - name: model
          in: query
          description: >-
            The `model` of the create request. Used by `image-to-video`,
            `text-to-video`, `ai-ugc-ad`, `ai-video-editor`,
            `character-replace`.
          schema:
            type: string
            example: kling-3.0
        - name: resolution
          in: query
          description: >-
            The `resolution` of the create request. Used by `image-to-video`,
            `text-to-video`, `ai-ugc-ad`, `ai-video-editor`,
            `character-replace`, `audio-to-video`, `ai-video-translator`,
            `ai-video-upscaler`. `ai-video-translator` defaults to `480p`.
          schema:
            type: string
            example: 720p
        - name: audio
          in: query
          description: >-
            The `audio` of the create request. Used by `image-to-video`,
            `text-to-video`. Defaults to `false`.
          schema:
            type: boolean
        - name: has_video_reference
          in: query
          description: >-
            Whether any of the create request's `references` is a video. Used by
            `text-to-video`. Defaults to `false`.
          schema:
            type: boolean
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  estimated_credits:
                    type: integer
                    description: Credits a create request with these fields charges.
                    example: 150
                required:
                  - estimated_credits
                description: Success
        '400':
          description: Invalid Request
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    type: string
                    enum:
                      - invalid_request
                    description: >-
                      Machine-readable error code.


                      - `invalid_request`: Fix request syntax or validation
                      errors before retrying.
                  message:
                    type: string
                    description: Human-readable error message.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    type: string
                    enum:
                      - unauthorized
                    description: |-
                      Machine-readable error code.

                      - `unauthorized`: Provide a valid API key before retrying.
                  message:
                    type: string
                    description: Human-readable error message.
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    type: string
                    enum:
                      - unprocessable_entity
                    description: >-
                      Machine-readable error code.


                      - `unprocessable_entity`: Change the request values before
                      retrying.
                  message:
                    type: string
                    description: Human-readable error message.
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    type: string
                    enum:
                      - internal_server_error
                    description: >-
                      Machine-readable error code.


                      - `internal_server_error`: Retry later or contact support
                      if the error continues.
                  message:
                    type: string
                    description: Human-readable error message.
      security:
        - bearerAuth: []
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&utm_source=docs&utm_medium=referral&utm_campaign=api-reference)
        and click "Create new API Key".

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.