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

# Kling Text-to-Video

> This series supports OpenAI video generation formats (see the link [Video generation Sora compatible formats](/api-reference/en/video-generation-sora-compatible-format/create-video)).

Kling 4.0 native task API. Authenticate using this site's Bearer API Key. The request body does not require model; settings.resolution=720p uses kling-4.0, while 1080p uses kling-4.0-1080p, with 1080p as the default. After successful creation, use the returned data.id to call GET /tasks?task_ids=task ID; separate multiple IDs with commas. The returned data is an array, and the result video is available at data[].outputs[].url.

The following generation scenarios are currently supported: prompt, first_frame, last_frame, refer_image, and feature_video. The model generates audio and video together by default. The current native endpoint does not expose settings.audio, refer_audio, or voice. Do not additionally provide audio switches or audio assets. middle_frame, base_video, element, callbacks, and custom external task IDs are not supported. A non-empty options.callback_url, non-empty options.external_task_id, non-empty contents.id, or any other unsupported field will return 400. options can be omitted or passed as an empty object; watermark_info.enabled=false is also supported. Enabling watermarks is not currently supported. Supported durations are currently 4 to 30 seconds, with a default of 10 seconds; 3 seconds is not supported. The default aspect ratio for text-to-video and reference scenarios is 16:9. Explicitly setting adaptive will return 400. First-and-last-frame scenarios do not accept an explicit settings.aspect_ratio; the aspect ratio is determined by the dimensions of the first frame image.

For text-to-video, pass prompt at the top level; contents is not required.



## OpenAPI

````yaml api-reference/en/openapi.json POST /text-to-video/kling-4.0
openapi: 3.0.0
info:
  title: Overseas Expansion Camp API Reference Documentation
  version: 1.0.0
  description: Public AI Gateway API Reference
servers:
  - url: https://api.newapi.si
security:
  - BearerAuth: []
tags:
  - name: OpenAI format (Chat)
  - name: OpenAI Format (Responses)
  - name: Gemini Format for Image Generation
  - name: Image generationOpenAI DALL-E format
  - name: List models
  - name: Video generationHappyHorse and Wan
  - name: Video generation Kling format
  - name: Video generation Omni and Veo formats
  - name: Video generation Seedance
  - name: Video generation Sora compatible formats
  - name: Video generation Vidu
  - name: Music generation task format
paths:
  /text-to-video/kling-4.0:
    post:
      tags:
        - Video generation Kling format
      summary: Kling Text-to-Video
      description: >-
        This series supports OpenAI video generation formats (see the link
        [Video generation Sora compatible
        formats](/api-reference/en/video-generation-sora-compatible-format/create-video)).


        Kling 4.0 native task API. Authenticate using this site's Bearer API
        Key. The request body does not require model; settings.resolution=720p
        uses kling-4.0, while 1080p uses kling-4.0-1080p, with 1080p as the
        default. After successful creation, use the returned data.id to call GET
        /tasks?task_ids=task ID; separate multiple IDs with commas. The returned
        data is an array, and the result video is available at
        data[].outputs[].url.


        The following generation scenarios are currently supported: prompt,
        first_frame, last_frame, refer_image, and feature_video. The model
        generates audio and video together by default. The current native
        endpoint does not expose settings.audio, refer_audio, or voice. Do not
        additionally provide audio switches or audio assets. middle_frame,
        base_video, element, callbacks, and custom external task IDs are not
        supported. A non-empty options.callback_url, non-empty
        options.external_task_id, non-empty contents.id, or any other
        unsupported field will return 400. options can be omitted or passed as
        an empty object; watermark_info.enabled=false is also supported.
        Enabling watermarks is not currently supported. Supported durations are
        currently 4 to 30 seconds, with a default of 10 seconds; 3 seconds is
        not supported. The default aspect ratio for text-to-video and reference
        scenarios is 16:9. Explicitly setting adaptive will return 400.
        First-and-last-frame scenarios do not accept an explicit
        settings.aspect_ratio; the aspect ratio is determined by the dimensions
        of the first frame image.


        For text-to-video, pass prompt at the top level; contents is not
        required.
      operationId: create_kling4_native_text_to_video
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - prompt
              properties:
                settings:
                  type: object
                  additionalProperties: false
                  properties:
                    resolution:
                      type: string
                      enum:
                        - 720p
                        - 1080p
                      default: 1080p
                    duration:
                      type: integer
                      minimum: 4
                      maximum: 30
                      default: 10
                    aspect_ratio:
                      type: string
                      enum:
                        - '21:9'
                        - '16:9'
                        - '9:16'
                        - '1:1'
                      default: '16:9'
                options:
                  type: object
                  additionalProperties: false
                  description: >-
                    You can omit it, pass an empty object, or explicitly disable
                    the watermark.
                  properties:
                    watermark_info:
                      type: object
                      additionalProperties: false
                      required:
                        - enabled
                      properties:
                        enabled:
                          type: boolean
                          enum:
                            - false
                prompt:
                  type: string
                  minLength: 1
            examples:
              kling4_native_720p:
                summary: Kling 720p
                value:
                  settings:
                    resolution: 720p
                    duration: 10
                    aspect_ratio: '16:9'
                  options: {}
                  prompt: A cinematic landscape with natural motion
              kling4_native_1080p:
                summary: Kling 1080p
                value:
                  settings:
                    resolution: 1080p
                    duration: 10
                    aspect_ratio: '16:9'
                  options: {}
                  prompt: A cinematic landscape with natural motion
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - request_id
                  - data
                properties:
                  code:
                    type: integer
                    example: 0
                  message:
                    type: string
                  request_id:
                    type: string
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Task ID on this site. Pass it as-is when querying.
                      status:
                        type: string
                        enum:
                          - submitted
                          - processing
                          - succeeded
                          - failed
                      create_time:
                        type: integer
                        format: int64
                        description: Creation time, in Unix milliseconds.
                      update_time:
                        type: integer
                        format: int64
                        description: Update time, in Unix milliseconds.
                      external_id:
                        type: string
                        maxLength: 0
              examples:
                success:
                  summary: Success
                  value:
                    code: 0
                    message: SUCCEED
                    request_id: request_example
                    data:
                      id: task_example
                      status: submitted
                      create_time: 1792710000000
                      update_time: 1792710000000
                      external_id: ''
        '400':
          description: The request parameters are invalid or contain unsupported fields.
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |-
        Use Bearer Token authentication.
        Format: `Authorization: Bearer sk-xxxxxx`

````

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