> ## Documentation Index
> Fetch the complete documentation index at: https://evo-0136956d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Kling 文生视频

> 使用 Kling 模型从文本描述生成视频。

支持的模型：kling-v1, kling-v1-5 等




## OpenAPI

````yaml /zh/openapi/relay-api.mintlify.json post /kling/v1/videos/text2video
openapi: 3.0.1
info:
  title: AI 调用接口
  description: 统一的 AI 模型调用接口，支持 OpenAI、Claude、Gemini、Kling、即梦等多种格式
  version: 1.0.0
servers:
  - url: https://api.nusabase.com
    description: API Base URL
security:
  - BearerAuth: []
tags:
  - name: Models
    description: 获取可用模型列表（支持 OpenAI / Gemini / Anthropic 格式）
  - name: Chat
    description: 对话补全与文本补全（OpenAI Chat Completions 兼容）
  - name: Responses
    description: OpenAI Responses API（支持工具调用、推理、多轮对话）
  - name: Realtime
    description: WebSocket 实时对话（OpenAI Realtime API 兼容）
  - name: Claude
    description: Anthropic Claude Messages API 兼容格式
  - name: Gemini
    description: Google Gemini API 兼容格式
  - name: Images
    description: 图片生成与编辑
  - name: Video
    description: 视频生成（OpenAI Sora 兼容格式 + 通用格式）
  - name: Video / Kling
    description: Kling 视频生成（文生视频 / 图生视频）
  - name: Video / Jimeng
    description: 即梦（Jimeng）视频生成
  - name: Audio
    description: 语音转文字 / 语音翻译 / 文字转语音
  - name: Embeddings
    description: 文本向量嵌入
  - name: Rerank
    description: 文档相关性重排序
  - name: Moderations
    description: 内容安全审核
  - name: Not Implemented
    description: 暂未实现的接口（保留兼容性占位）
paths:
  /kling/v1/videos/text2video:
    post:
      tags:
        - Video / Kling
      summary: Kling 文生视频
      description: |
        使用 Kling 模型从文本描述生成视频。

        支持的模型：kling-v1, kling-v1-5 等
      operationId: createKlingText2Video
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoRequest'
            example:
              model: kling-v1
              prompt: 宇航员站起身走了
              duration: 5
              width: 1280
              height: 720
              fps: 30
      responses:
        '200':
          description: 成功创建视频生成任务
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoResponse'
          headers: {}
        '400':
          description: 请求参数错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    VideoRequest:
      type: object
      description: 视频生成请求
      properties:
        model:
          type: string
          description: 模型/风格 ID
          example: kling-v1
        prompt:
          type: string
          description: 文本描述提示词
          example: 宇航员站起身走了
        image:
          type: string
          description: 图片输入 (URL 或 Base64)
          example: https://example.com/image.jpg
        duration:
          type: number
          description: 视频时长（秒）
          example: 5
        width:
          type: integer
          description: 视频宽度
          example: 1280
        height:
          type: integer
          description: 视频高度
          example: 720
        fps:
          type: integer
          description: 视频帧率
          example: 30
        seed:
          type: integer
          description: 随机种子
          example: 20231234
        'n':
          type: integer
          description: 生成视频数量
          example: 1
        response_format:
          type: string
          description: 响应格式
          example: url
        user:
          type: string
          description: 用户标识
          example: user-1234
        metadata:
          type: object
          description: 扩展参数 (如 negative_prompt, style, quality_level 等)
          additionalProperties: true
          properties: {}
    VideoResponse:
      type: object
      description: 视频生成任务提交响应
      properties:
        task_id:
          type: string
          description: 任务 ID
          example: abcd1234efgh
        status:
          type: string
          description: 任务状态
          example: queued
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: 错误信息
            type:
              type: string
              description: 错误类型
            param:
              type: string
              description: 相关参数
              nullable: true
            code:
              type: string
              description: 错误代码
              nullable: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        使用 Bearer Token 认证。
        格式: `Authorization: Bearer sk-xxxxxx`

````

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