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

# वीडियो बनाएँ

> एसिंक्रोनस वीडियो जनरेशन जॉब बनाता है। जॉब अंतिम स्थिति तक पहुँचने तक लौटाए गए `polling_url` को हर 20 सेकंड में पोल करें।

वर्कस्पेस में पूर्वावलोकन सुविधा का ऐक्सेस आवश्यक है। सेटअप, वेबहुक और परिणामों को संभालने के लिए [वीडियो और बैच कार्य](../../guides/async-video-and-batch.mdx) देखें।


## OpenAPI

````yaml hi/openapi/v1/openapi.localized.yaml POST /videos
openapi: 3.0.3
info:
  title: Phaseo Gateway API
  description: >-
    OpenAI-संगत एंडपॉइंट के माध्यम से विभिन्न AI मॉडल तक पहुँचने के लिए एक गेटवे
    API।
  version: 1.0.0
  contact:
    name: Phaseo
    url: https://phaseo.app
    email: danielbutler500@gmail.com
servers:
  - url: https://api.phaseo.app/v1
    description: वैश्विक रूटिंग
security:
  - BearerAuth: []
tags:
  - name: Gateway
    description: Core Phaseo Gateway operations.
paths:
  /videos:
    post:
      tags:
        - Gateway
      summary: वीडियो बनाएँ
      description: >-
        एसिंक्रोनस वीडियो जनरेशन जॉब बनाता है। जॉब अंतिम स्थिति तक पहुँचने तक
        लौटाए गए `polling_url` को हर 20 सेकंड में पोल करें।
      operationId: createVideo
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoGenerationRequest'
      responses:
        '202':
          description: वीडियो का जवाब
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoGenerationResponse'
components:
  schemas:
    VideoGenerationRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
        prompt:
          type: string
        duration:
          type: integer
          description: वांछित अवधि सेकंड में (प्रदाता/मॉडल पर निर्भर)।
        input_video_duration:
          type: number
          format: double
          minimum: 0
          maximum: 3600
          exclusiveMinimum: true
          description: >-
            स्रोत वीडियो की अवधि सेकंड में। जब प्रदाता स्रोत वीडियो की अवधि को
            उत्पन्न आउटपुट से अलग बिल करता है तब आवश्यक।
        input_audio_duration:
          type: number
          format: double
          minimum: 2
          maximum: 20
          description: >-
            स्रोत ऑडियो की घोषित अवधि सेकंड में, प्रदाता की सीमा जाँचने के लिए।
            आधिकारिक उपयोग न बताने वाले प्रदाता अपनी समर्थित इनपुट-अवधि की
            अधिकतम सीमा पर बिल कर सकते हैं।
        size:
          type: string
          description: >-
            स्पष्ट आयाम (जैसे 1280x720)। resolution या aspect_ratio के साथ नहीं
            दिया जा सकता।
        resolution:
          type: string
          description: >-
            480p, 720p, 1080p, 1K, 2K, 4K। aspect_ratio के साथ दिया जा सकता है।
            size के साथ नहीं दिया जा सकता।
        aspect_ratio:
          type: string
          description: >-
            आस्पेक्ट अनुपात जैसे 16:9, 9:16, 1:1। resolution के साथ दिया जा सकता
            है। size के साथ नहीं दिया जा सकता।
        seed:
          type: integer
        sample_count:
          type: integer
          minimum: 1
          maximum: 4
        negative_prompt:
          type: string
        generate_audio:
          type: boolean
        enhance_prompt:
          type: boolean
        compression_quality:
          type: integer
        person_generation:
          type: string
        resize_mode:
          type: string
        input_references:
          type: array
          description: >-
            जनरेशन को निर्देशित करने वाले HTTPS चित्र, ऑडियो या वीडियो इनपुट।
            समर्थित प्रकार, भूमिकाएँ, संख्या और संयोजन चुने गए मॉडल पर निर्भर
            हैं। जॉब भेजने से पहले GET /videos/models देखें। इस स्कीमा में छोड़ा
            गया एकवचन संगतता alias input_reference एक multipart चित्र या file_id
            और image_url में से ठीक एक वाला ऑब्जेक्ट स्वीकार करता है। समर्थन
            प्रदाता पर निर्भर है।
          items:
            $ref: '#/components/schemas/VideoInputReference'
        frame_images:
          type: array
          minItems: 1
          maxItems: 2
          description: >-
            पहले/अंतिम फ़्रेम के HTTPS चित्र। हर frame_type एक बार आ सकता है।
            साथ में input_reference या input_references में फ़्रेम भूमिकाएँ न
            दें।
          items:
            type: object
            additionalProperties: false
            required:
              - type
              - frame_type
              - image_url
            properties:
              type:
                type: string
                enum:
                  - image_url
              frame_type:
                type: string
                enum:
                  - first_frame
                  - last_frame
              image_url:
                type: object
                required:
                  - url
                properties:
                  url:
                    type: string
                    format: uri
        provider_params:
          type: object
          additionalProperties: true
          description: >-
            केवल प्रदाता-विशिष्ट एक्सटेंशन। पूरे अनुरोध का passthrough और दोहराए
            गए रूटिंग, prompt, callback या बिलिंग फ़ील्ड अस्वीकार किए जाते हैं।
        provider_options:
          type: object
          additionalProperties:
            type: object
            additionalProperties: true
          description: >-
            कैनोनिकल प्रदाता ID (जैसे atlascloud या byteplus) से पहचाने जाने
            वाले एक्सटेंशन। केवल चुने गए प्रदाता के विकल्प आगे भेजे जाते हैं।
            provider_params के साथ नहीं दिया जा सकता। रूटिंग, prompt, callback,
            अवधि, रिज़ॉल्यूशन और आउटपुट-संख्या के लिए सत्यापित शीर्ष-स्तरीय
            फ़ील्ड उपयोग करने होंगे।
        output:
          $ref: '#/components/schemas/VideoOutputConfig'
        webhook:
          type: object
          required:
            - endpoint_id
          additionalProperties: false
          properties:
            endpoint_id:
              type: string
              description: >-
                वर्कस्पेस द्वारा प्रबंधित सक्रिय webhook एंडपॉइंट। इसका
                एन्क्रिप्टेड और बदला जा सकने वाला साइनिंग सीक्रेट वीडियो जॉब के
                मेटाडेटा में कभी संग्रहीत नहीं होता।
            events:
              type: array
              description: >-
                वैकल्पिक इवेंट सदस्यताएँ। सामान्य job.* या संबंधित video.* इवेंट
                उपयोग करें, जैसे video.status_changed, video.progress या
                video.completed। छोड़ने पर job.status_changed और अंतिम job.*
                इवेंट उपयोग होते हैं। प्रगति callbacks के लिए job.progress या
                video.progress स्पष्ट रूप से शामिल करें। सूची देने पर कम से कम
                एक इवेंट वीडियो जॉब के लिए मान्य होना चाहिए; केवल अन्य प्रकार के
                इवेंट वाली या गलत प्रारूप वाली सूचियाँ अस्वीकार होती हैं।
              items:
                type: string
        provider:
          $ref: '#/components/schemas/ProviderRoutingOptions'
    VideoGenerationResponse:
      type: object
      properties:
        id:
          type: string
        polling_url:
          type: string
        websocket_url:
          type: string
          format: uri
          description: >-
            एसिंक्रोनस जॉब के सामान्यीकृत जीवनचक्र अपडेट की सदस्यता लेने के लिए
            WebSocket URL।
        model:
          type: string
        request_id:
          type: string
        session_id:
          type: string
        status:
          type: string
          enum:
            - queued
            - processing
            - completed
            - failed
            - cancelled
            - expired
        lifecycle_status:
          type: string
          enum:
            - pending
            - running
            - completed
            - failed
            - cancelled
            - expired
          description: >-
            पोलिंग, WebSocket और webhook उपभोक्ताओं के लिए सामान्यीकृत
            एसिंक्रोनस जीवनचक्र स्थिति।
        cancel_url:
          type: string
          format: uri
          nullable: true
          description: संगतता के लिए आरक्षित; वर्तमान में हमेशा null।
        output_access:
          type: string
          enum:
            - bytes
            - signed_url
            - both
        generation_id:
          type: string
          nullable: true
        native_video_id:
          type: string
          nullable: true
          description: >-
            प्रदाता का मूल वीडियो/जॉब ID, जब वह गेटवे के स्वामित्व वाले ID से
            अलग हो।
        created_at:
          oneOf:
            - type: integer
            - type: string
        started_at:
          nullable: true
          oneOf:
            - type: integer
            - type: string
        completed_at:
          nullable: true
          oneOf:
            - type: integer
            - type: string
        object:
          type: string
          example: video
        poll_after_seconds:
          type: integer
          example: 20
        provider:
          type: string
        seconds:
          type: number
        size:
          type: string
        audio:
          type: boolean
        content_url:
          type: string
          description: जब output_access में bytes शामिल हों तब मौजूद (प्रमाणित एंडपॉइंट)।
        download_url:
          type: string
          nullable: true
          description: >-
            स्थिति completed होने पर सीधे डाउनलोड के लिए प्रथम-पक्ष हस्ताक्षरित
            URL।
        expires_at:
          type: integer
          nullable: true
          description: >-
            हस्ताक्षरित download_url की समय-सीमा समाप्त होने का Unix टाइमस्टैम्प
            (सेकंड)।
        progress:
          type: integer
          nullable: true
        progress_source:
          type: string
        asset:
          type: object
          nullable: true
          properties:
            id:
              type: string
            mime_type:
              type: string
            bytes:
              type: integer
            sha256:
              type: string
            width:
              type: integer
            height:
              type: integer
            duration_seconds:
              type: number
        outputs:
          type: array
          items:
            $ref: '#/components/schemas/VideoOutput'
        billing:
          $ref: '#/components/schemas/VideoBillingSummary'
        webhook:
          $ref: '#/components/schemas/AsyncWebhookPublicState'
        next_webhook_retry_at:
          type: string
          nullable: true
          description: >-
            अगले निर्धारित उपयोगकर्ता-webhook पुनः प्रयास का ISO टाइमस्टैम्प,
            यदि कतार में हो।
        last_webhook_progress:
          type: number
          nullable: true
          description: webhook उपभोक्ताओं को भेजा गया सबसे हालिया मोटा प्रगति स्तर।
        last_webhook_progress_at:
          type: string
          nullable: true
          description: सबसे हालिया webhook प्रगति स्तर भेजे जाने का ISO टाइमस्टैम्प।
        last_webhook_dispatched_at:
          type: string
          nullable: true
          description: सबसे हालिया webhook भेजने के प्रयास का ISO टाइमस्टैम्प।
        usage:
          type: object
          properties:
            cost:
              type: number
            is_byok:
              type: boolean
          additionalProperties: true
        error:
          nullable: true
    VideoInputReference:
      description: >-
        प्रकार सहित HTTPS मीडिया इनपुट। चित्रों के लिए image_url और ऑडियो या
        वीडियो के लिए media_url उपयोग करें। भूमिकाएँ बताती हैं कि मॉडल इनपुट का
        कैसे उपयोग करे; समर्थन प्रदाता और मॉडल के अनुसार बदलता है।
      oneOf:
        - type: object
          required:
            - type
            - image_url
          properties:
            type:
              type: string
              enum:
                - image_url
            role:
              type: string
              description: चुने गए मॉडल द्वारा इस चित्र का वांछित उपयोग।
              enum:
                - first_frame
                - last_frame
                - reference
                - source
                - mask
            reference_type:
              type: string
            image_url:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  format: uri
                  description: सार्वजनिक रूप से उपलब्ध HTTPS चित्र URL।
        - type: object
          required:
            - type
            - media_url
          properties:
            type:
              type: string
              enum:
                - video_url
                - audio_url
            role:
              type: string
              description: चुने गए मॉडल द्वारा इस ऑडियो या वीडियो का वांछित उपयोग।
              enum:
                - first_frame
                - last_frame
                - reference
                - source
                - mask
            reference_type:
              type: string
            media_url:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  format: uri
                  description: सार्वजनिक रूप से उपलब्ध HTTPS ऑडियो या वीडियो URL।
    VideoOutputConfig:
      type: object
      properties:
        access:
          type: string
          enum:
            - bytes
            - signed_url
            - both
          default: both
          description: >-
            bytes=केवल प्रमाणित content_url, signed_url=केवल हस्ताक्षरित डाउनलोड
            लिंक, both=दोनों शामिल करें।
    ProviderRoutingOptions:
      type: object
      description: गेटवे चयन के लिए प्रदाता रूटिंग प्राथमिकताएँ।
      properties:
        order:
          type: array
          items:
            type: string
        only:
          type: array
          items:
            type: string
        ignore:
          type: array
          items:
            type: string
        include_alpha:
          type: boolean
          description: रूटिंग में alpha प्रदाताओं को शामिल करें (डिफ़ॉल्ट रूप से बंद)।
        allow_fallbacks:
          type: boolean
          nullable: true
          description: विफलता के बाद किसी अन्य योग्य प्रदाता पर fallback की अनुमति दें।
        require_parameters:
          type: boolean
          nullable: true
          description: >-
            रूटिंग से पहले अनुरोधित पैरामीटरों के लिए प्रदाता का समर्थन आवश्यक
            करें।
        required_execution_region:
          type: string
          nullable: true
          description: रूटिंग को अनुरोधित execution region वाले प्रदाताओं तक सीमित करें।
        required_data_region:
          type: string
          nullable: true
          description: रूटिंग को अनुरोधित data region वाले प्रदाताओं तक सीमित करें।
        require_zero_data_retention:
          type: boolean
          nullable: true
          description: >-
            रूटिंग को उन प्रदाताओं तक सीमित करें जो शून्य डेटा प्रतिधारण का
            समर्थन करते हैं।
        data_collection:
          type: string
          nullable: true
          enum:
            - allow
            - deny
        zdr:
          type: boolean
          nullable: true
        enforce_distillable_text:
          type: boolean
          nullable: true
        quantizations:
          type: array
          nullable: true
          items:
            type: string
        sort:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
          description: >-
            इस अनुरोध के लिए प्रदाताओं को क्रम दें, जैसे कीमत, विलंबता या
            थ्रूपुट के आधार पर।
        max_price:
          type: object
          properties:
            prompt:
              oneOf:
                - type: number
                - type: string
            completion:
              oneOf:
                - type: number
                - type: string
            image:
              oneOf:
                - type: number
                - type: string
            audio:
              oneOf:
                - type: number
                - type: string
            request:
              oneOf:
                - type: number
                - type: string
        preferred_min_throughput:
          oneOf:
            - type: number
            - type: object
              additionalProperties:
                type: number
        preferred_max_latency:
          oneOf:
            - type: number
            - type: object
              additionalProperties:
                type: number
    VideoOutput:
      type: object
      properties:
        index:
          type: integer
        mime_type:
          type: string
        bytes_available:
          type: boolean
        content_url:
          type: string
          description: जब output_access में bytes शामिल हों तब मौजूद।
        download_url:
          type: string
          description: इस आउटपुट के लिए प्रथम-पक्ष हस्ताक्षरित URL।
        expires_at:
          type: integer
          description: इस आउटपुट URL की समय-सीमा समाप्त होने का Unix टाइमस्टैम्प (सेकंड)।
    VideoBillingSummary:
      type: object
      properties:
        currency:
          type: string
        estimated_provider_cost:
          type: string
          nullable: true
        estimated_user_cost:
          type: string
          nullable: true
        settled_provider_cost:
          type: string
          nullable: true
        settled_user_cost:
          type: string
          nullable: true
        state:
          type: string
          enum:
            - pending
            - estimated
            - settled
            - void
        billable:
          type: boolean
        total_nanos:
          type: integer
          nullable: true
        estimated_nanos:
          type: integer
          nullable: true
        reserved_nanos:
          type: integer
          nullable: true
        reservation_id:
          type: string
          nullable: true
        reservation_status:
          type: string
          nullable: true
        charge_reason:
          type: string
          nullable: true
        charged:
          type: boolean
          nullable: true
        billed_at:
          type: string
      additionalProperties: true
    AsyncWebhookPublicState:
      type: object
      description: >-
        सुरक्षित रूप से साफ़ किया गया एसिंक्रोनस webhook कॉन्फ़िगरेशन और डिलीवरी
        स्थिति। सीक्रेट कभी नहीं लौटाए जाते; `has_secret` बताता है कि
        हस्ताक्षरित डिलीवरी सक्षम हैं या नहीं। हस्ताक्षरित डिलीवरी में
        x-phaseo-signature, x-phaseo-timestamp, x-phaseo-event-id,
        x-phaseo-event-type, x-phaseo-delivery-key, x-phaseo-attempt और
        x-phaseo-max-attempts हेडर शामिल होते हैं।
      properties:
        url:
          type: string
          format: uri
          nullable: true
        events:
          type: array
          items:
            type: string
        has_secret:
          type: boolean
        delivery:
          $ref: '#/components/schemas/AsyncWebhookDeliverySummary'
        attempts:
          type: array
          items:
            $ref: '#/components/schemas/AsyncWebhookDeliveryAttempt'
    AsyncWebhookDeliverySummary:
      type: object
      description: >-
        गेटवे द्वारा प्रबंधित एसिंक्रोनस webhooks की सार्वजनिक डिलीवरी जानकारी।
        इससे जॉब निष्पादन स्थिति को webhook डिलीवरी स्वास्थ्य से अलग समझें।
      properties:
        total_attempts:
          type: integer
          description: इस जॉब के लिए दर्ज कुल डिलीवरी प्रयास।
        delivered_events:
          type: integer
          description: डिलीवरी पूर्ण स्थिति तक पहुँचने वाली डिलीवरी कुंजियों की संख्या।
        delivered_event_types:
          type: array
          description: कम से कम एक बार डिलीवर हुई डिलीवरी कुंजियाँ।
          items:
            type: string
          example:
            - video.completed
        pending_retries:
          type: integer
          description: वर्तमान में पुनः प्रयास के लिए निर्धारित डिलीवरी कुंजियों की संख्या।
        next_retry_at:
          type: string
          nullable: true
          description: अगले निर्धारित पुनः प्रयास का ISO टाइमस्टैम्प, यदि मौजूद हो।
        last_attempt_at:
          type: string
          nullable: true
          description: सबसे हालिया डिलीवरी प्रयास का ISO टाइमस्टैम्प।
        last_attempt_status:
          type: string
          nullable: true
          enum:
            - delivered
            - scheduled_retry
            - failed_permanently
          description: सबसे हालिया डिलीवरी प्रयास का परिणाम।
        last_response_status:
          type: integer
          nullable: true
          description: webhook गंतव्य द्वारा लौटाई गई HTTP स्थिति, यदि उपलब्ध हो।
        last_delivered_at:
          type: string
          nullable: true
          description: सबसे हालिया सफल डिलीवरी का ISO टाइमस्टैम्प।
        last_failure_at:
          type: string
          nullable: true
          description: सबसे हालिया विफल या पुनः प्रयास वाले प्रयास का ISO टाइमस्टैम्प।
        last_error_message:
          type: string
          nullable: true
          description: सबसे हालिया डिलीवरी त्रुटि संदेश, यदि उपलब्ध हो।
    AsyncWebhookDeliveryAttempt:
      type: object
      description: गेटवे द्वारा प्रबंधित एसिंक्रोनस webhook का हालिया डिलीवरी प्रयास।
      properties:
        id:
          type: string
          description: ऑडिट और डिबगिंग के लिए स्थिर प्रयास पहचानकर्ता।
        delivery_key:
          type: string
          description: इस इवेंट की डिलीवरी के लिए आइडेम्पोटेंसी कुंजी।
          example: video.completed
        event_type:
          type: string
          description: webhook गंतव्य को डिलीवर किया गया इवेंट प्रकार।
          example: video.completed
        status:
          type: string
          enum:
            - delivered
            - scheduled_retry
            - failed_permanently
        attempt_number:
          type: integer
          description: इस डिलीवरी कुंजी के लिए एक से शुरू होने वाला प्रयास क्रमांक।
        max_attempts:
          type: integer
          description: डिलीवरी को स्थायी रूप से विफल चिह्नित करने से पहले अधिकतम प्रयास।
        tried_at:
          type: string
          description: यह प्रयास किए जाने का ISO टाइमस्टैम्प।
        delivered_at:
          type: string
          nullable: true
          description: इस प्रयास की सफल डिलीवरी का ISO टाइमस्टैम्प।
        next_retry_at:
          type: string
          nullable: true
          description: >-
            इस प्रयास के बाद अगले पुनः प्रयास का ISO टाइमस्टैम्प, यदि निर्धारित
            हो।
        response_status:
          type: integer
          nullable: true
          description: webhook गंतव्य द्वारा लौटाई गई HTTP स्थिति, यदि उपलब्ध हो।
        error_message:
          type: string
          nullable: true
          description: डिलीवरी त्रुटि संदेश, यदि उपलब्ध हो।
        response_body_preview:
          type: string
          nullable: true
          description: >-
            webhook गंतव्य के जवाब के बॉडी का संवेदनशील जानकारी हटाया गया
            पूर्वावलोकन।
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer टोकन से प्रमाणीकरण

````

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