---
title: Kling نص إلى فيديو | RunAPI
description: استخدم نقطة نهاية تحويل النص إلى فيديو لإنشاء مهمة غير متزامنة.
url: https://runapi.ai/ar/docs/api/kling/text-to-video.md
canonical: https://runapi.ai/ar/docs/api/kling/text-to-video
locale: ar
---

> نسخة HTML: https://runapi.ai/ar/docs/api/kling/text-to-video
> فهرس الموقع للوكلاء: https://runapi.ai/llms.txt

# Kling نص إلى فيديو

## نظرة عامة

استخدم نقطة نهاية تحويل النص إلى فيديو مع نموذج مدعوم. استخدم معرّف المهمة المُعاد لاسترداد حالتها، أو أدخل callback_url للتسليمات الموثقة أدناه.

### البدء السريع

1. أنشئ مفتاح API واضبطه كـ RUNAPI_API_KEY.
2. اختر نموذجاً مدعوماً وأرسل طلب POST يطابق مخطط ذلك النموذج.
3. احفظ معرّف المهمة المُعاد، ثم استطلع الحالة حتى تبلغ حالة نهائية أو تعالج عمليات الاستدعاء الموثقة أدناه.

## نقطة النهاية

POST /api/v1/kling/text_to_video

عنوان URL الأساسي: https://runapi.ai

إصدار API: v1

المصادقة: Authorization: Bearer YOUR_API_TOKEN

## النماذج المدعومة

افتح صفحة النموذج للاطلاع على التسعير الحالي وحدود المعدل وتفاصيل الاستخدام التجاري.

- [kling-3.0](https://runapi.ai/ar/models/kling/3.0)
- [kling-o1](https://runapi.ai/ar/models/kling/o1)
- [kling-v2.1-master-text-to-video](https://runapi.ai/ar/models/kling/v2.1-master-text-to-video)
- [kling-v2.5-turbo-text-to-video-pro](https://runapi.ai/ar/models/kling/v2.5-turbo-text-to-video-pro)
- [kling-v2.6](https://runapi.ai/ar/models/kling/v2.6)
- [kling-v3-omni](https://runapi.ai/ar/models/kling/v3-omni)
- [kling-v3-omni-reference](https://runapi.ai/ar/models/kling/v3-omni-reference)
- [kling-v3-turbo-text-to-video](https://runapi.ai/ar/models/kling/v3-turbo-text-to-video)

## مخطط الطلب

تعتمد الحقول والقيم المسموح بها على النموذج المحدد. عند التوفير، يستقبل callback_url عمليات تسليم المهمة الموثّقة أدناه.

### kling-3.0

```json
{
  "aspect_ratio": {
    "description": "نسبة أبعاد المخرجات.",
    "enum": [
      "16:9",
      "9:16",
      "1:1"
    ],
    "type": "string"
  },
  "callback_url": {
    "description": "رابط Webhook لإشعارات غير متزامنة.",
    "type": "string"
  },
  "cfg_scale": {
    "description": "مقياس التوجيه (0-1).",
    "type": "number"
  },
  "duration_seconds": {
    "description": "المدة بالثواني.",
    "enum": [
      3,
      4,
      5,
      6,
      7,
      8,
      9,
      10,
      11,
      12,
      13,
      14,
      15
    ],
    "type": "integer"
  },
  "enable_sound": {
    "description": "تفعيل توليد الصوت.",
    "type": "boolean"
  },
  "first_frame_image_url": {
    "description": "عنوان URL لصورة الإطار الأول.",
    "type": "string"
  },
  "kling_elements": {
    "description": "مراجع العناصر مع مواد الصور والفيديو والصوت.",
    "type": "array"
  },
  "last_frame_image_url": {
    "description": "عنوان URL للإطار الأخير للصورة في وضع اللقطة الواحدة.",
    "type": "string"
  },
  "model": {
    "description": "معرّف النموذج.",
    "required": true,
    "type": "string"
  },
  "multi_prompt": {
    "description": "مقاطع الموجّه لوضع التصوير المتعدد.",
    "type": "array"
  },
  "multi_shots": {
    "description": "تفعيل التوليد متعدد اللقطات.",
    "type": "boolean"
  },
  "negative_prompt": {
    "description": "الموجّه السلبي.",
    "type": "string"
  },
  "output_resolution": {
    "description": "دقة الإخراج.",
    "enum": [
      "720p",
      "1080p",
      "4k"
    ],
    "type": "string"
  },
  "prompt": {
    "description": "وصف الفيديو. مطلوب ما لم يكن multi_shots مفعّلاً.",
    "type": "string"
  }
}
```

### kling-o1

```json
{
  "aspect_ratio": {
    "default": "16:9",
    "description": "نسبة أبعاد المخرجات.",
    "enum": [
      "16:9",
      "9:16",
      "1:1"
    ],
    "type": "string"
  },
  "callback_url": {
    "description": "رابط Webhook لإشعارات غير متزامنة.",
    "type": "string"
  },
  "duration_seconds": {
    "default": 5,
    "description": "المدة بالثواني.",
    "enum": [
      5
    ],
    "type": "integer"
  },
  "enable_sound": {
    "default": false,
    "description": "يجب أن يظل توليد الصوت معطَّلاً.",
    "type": "boolean"
  },
  "mode": {
    "default": "std",
    "description": "وضع التوليد.",
    "enum": [
      "std",
      "pro"
    ],
    "type": "string"
  },
  "model": {
    "description": "معرّف النموذج.",
    "required": true,
    "type": "string"
  },
  "preserve_reference_video_audio": {
    "default": false,
    "description": "الاحتفاظ بالصوت الأصلي لمقطع الفيديو المرجعي.",
    "type": "boolean"
  },
  "prompt": {
    "description": "وصف الفيديو؛ أشر إلى الوسائط المرجعية بعلامات مرقّمة مطابقة.",
    "length": true,
    "max": 2500,
    "min": 1,
    "required": true,
    "type": "string"
  },
  "reference_image_urls": {
    "description": "عناوين URL مرتَّبة لصور مرجعية بتنسيق JPG أو JPEG أو PNG عبر HTTP(S) العام.",
    "items": {
      "type": "string"
    },
    "max_items": 7,
    "min_items": 1,
    "type": "array"
  },
  "reference_video_type": {
    "default": "base",
    "description": "استخدم الفيديو كتحرير أساسي أو مرجع للميزات.",
    "enum": [
      "base",
      "feature"
    ],
    "type": "string"
  },
  "reference_video_url": {
    "description": "عنوان URL عام عبر HTTP(S) لمقطع فيديو مرجعي بصيغة MP4 أو MOV.",
    "type": "string"
  }
}
```

### kling-v2.1-master-text-to-video

```json
{
  "aspect_ratio": {
    "description": "نسبة أبعاد المخرجات.",
    "enum": [
      "16:9",
      "9:16",
      "1:1"
    ],
    "type": "string"
  },
  "callback_url": {
    "description": "رابط Webhook لإشعارات غير متزامنة.",
    "type": "string"
  },
  "cfg_scale": {
    "description": "مقياس التوجيه (0-1).",
    "type": "number"
  },
  "duration_seconds": {
    "description": "المدة بالثواني.",
    "enum": [
      5,
      10
    ],
    "type": "integer"
  },
  "enable_sound": {
    "description": "تفعيل توليد الصوت.",
    "type": "boolean"
  },
  "model": {
    "description": "معرّف النموذج.",
    "required": true,
    "type": "string"
  },
  "negative_prompt": {
    "description": "الموجّه السلبي.",
    "type": "string"
  },
  "prompt": {
    "description": "وصف الفيديو.",
    "type": "string"
  }
}
```

### kling-v2.5-turbo-text-to-video-pro

```json
{
  "aspect_ratio": {
    "description": "نسبة أبعاد المخرجات.",
    "enum": [
      "16:9",
      "9:16",
      "1:1"
    ],
    "type": "string"
  },
  "callback_url": {
    "description": "رابط Webhook لإشعارات غير متزامنة.",
    "type": "string"
  },
  "cfg_scale": {
    "description": "مقياس التوجيه (0-1).",
    "type": "number"
  },
  "duration_seconds": {
    "description": "المدة بالثواني.",
    "enum": [
      5,
      10
    ],
    "type": "integer"
  },
  "enable_sound": {
    "description": "تفعيل توليد الصوت.",
    "type": "boolean"
  },
  "model": {
    "description": "معرّف النموذج.",
    "required": true,
    "type": "string"
  },
  "negative_prompt": {
    "description": "الموجّه السلبي.",
    "type": "string"
  },
  "prompt": {
    "description": "وصف الفيديو.",
    "type": "string"
  }
}
```

### kling-v2.6

```json
{
  "aspect_ratio": {
    "default": "16:9",
    "description": "نسبة أبعاد المخرجات.",
    "enum": [
      "16:9",
      "9:16",
      "1:1"
    ],
    "type": "string"
  },
  "callback_url": {
    "description": "رابط Webhook لإشعارات غير متزامنة.",
    "type": "string"
  },
  "duration_seconds": {
    "default": 5,
    "description": "المدة بالثواني.",
    "enum": [
      5,
      10
    ],
    "type": "integer"
  },
  "enable_sound": {
    "default": false,
    "description": "تفعيل توليد الصوت؛ يتطلب وضع pro.",
    "type": "boolean"
  },
  "mode": {
    "default": "std",
    "description": "وضع التوليد.",
    "enum": [
      "std",
      "pro"
    ],
    "type": "string"
  },
  "model": {
    "description": "معرّف النموذج.",
    "required": true,
    "type": "string"
  },
  "prompt": {
    "description": "وصف الفيديو.",
    "length": true,
    "max": 2500,
    "min": 1,
    "required": true,
    "type": "string"
  }
}
```

### kling-v3-omni

```json
{
  "aspect_ratio": {
    "default": "16:9",
    "description": "نسبة أبعاد المخرجات.",
    "enum": [
      "16:9",
      "9:16",
      "1:1"
    ],
    "type": "string"
  },
  "callback_url": {
    "description": "رابط Webhook لإشعارات غير متزامنة.",
    "type": "string"
  },
  "duration_seconds": {
    "default": 5,
    "description": "المدة بالثواني.",
    "enum": [
      3,
      4,
      5,
      6,
      7,
      8,
      9,
      10,
      11,
      12,
      13,
      14,
      15
    ],
    "type": "integer"
  },
  "enable_sound": {
    "default": false,
    "description": "تفعيل توليد الصوت المتزامن.",
    "type": "boolean"
  },
  "model": {
    "description": "معرّف النموذج.",
    "required": true,
    "type": "string"
  },
  "output_resolution": {
    "default": "720p",
    "description": "دقة الإخراج.",
    "enum": [
      "720p",
      "1080p",
      "4k"
    ],
    "type": "string"
  },
  "prompt": {
    "description": "وصف الفيديو.",
    "length": true,
    "max": 2500,
    "min": 1,
    "required": true,
    "type": "string"
  }
}
```

### kling-v3-omni-reference

```json
{
  "aspect_ratio": {
    "description": "نسبة أبعاد المخرجات.",
    "enum": [
      "16:9",
      "9:16",
      "1:1"
    ],
    "required": true,
    "type": "string"
  },
  "callback_url": {
    "description": "رابط Webhook لإشعارات غير متزامنة.",
    "type": "string"
  },
  "duration_seconds": {
    "default": 5,
    "description": "مدة المخرجات بالثواني.",
    "enum": [
      3,
      4,
      5,
      6,
      7,
      8,
      9,
      10,
      11,
      12,
      13,
      14,
      15
    ],
    "type": "integer"
  },
  "enable_sound": {
    "default": false,
    "description": "تفعيل توليد الصوت المتزامن.",
    "type": "boolean"
  },
  "model": {
    "description": "معرّف النموذج.",
    "required": true,
    "type": "string"
  },
  "output_resolution": {
    "default": "720p",
    "description": "دقة الإخراج.",
    "enum": [
      "720p",
      "1080p",
      "4k"
    ],
    "type": "string"
  },
  "prompt": {
    "description": "وصف الفيديو.",
    "length": true,
    "max": 2500,
    "min": 1,
    "required": true,
    "type": "string"
  },
  "reference_image_urls": {
    "description": "عناوين URL مرتَّبة للصور المرجعية.",
    "items": {
      "type": "string"
    },
    "max_items": 7,
    "min_items": 1,
    "required": true,
    "type": "array"
  }
}
```

### kling-v3-turbo-text-to-video

```json
{
  "aspect_ratio": {
    "default": "16:9",
    "description": "نسبة أبعاد المخرجات.",
    "enum": [
      "16:9",
      "9:16",
      "1:1"
    ],
    "type": "string"
  },
  "callback_url": {
    "description": "رابط Webhook لإشعارات غير متزامنة.",
    "type": "string"
  },
  "duration_seconds": {
    "default": 5,
    "description": "المدة بالثواني.",
    "enum": [
      3,
      4,
      5,
      6,
      7,
      8,
      9,
      10,
      11,
      12,
      13,
      14,
      15
    ],
    "type": "integer"
  },
  "model": {
    "description": "معرّف النموذج.",
    "required": true,
    "type": "string"
  },
  "output_resolution": {
    "default": "720p",
    "description": "دقة الإخراج.",
    "enum": [
      "720p",
      "1080p"
    ],
    "type": "string"
  },
  "prompt": {
    "description": "وصف الفيديو.",
    "length": true,
    "max": 2500,
    "min": 1,
    "required": true,
    "type": "string"
  }
}
```

#### القواعد الشرطية

تسري هذه المتطلبات عندما تتطابق جميع الشروط المدرجة.

- **عندما**: `model` = `kling-3.0`; **غير مقبول**: `reference_image_urls`, `reference_video_url`, `reference_video_type`, `preserve_reference_video_audio`
- **عندما**: `model` = `kling-o1`; **غير مقبول**: `output_resolution`, `negative_prompt`, `cfg_scale`, `multi_shots`, `multi_prompt`, `first_frame_image_url`, `last_frame_image_url`, `kling_elements`
- **عندما**: `model` = `kling-v2.1-master-text-to-video`; **غير مقبول**: `mode`, `reference_image_urls`, `reference_video_url`, `reference_video_type`, `preserve_reference_video_audio`
- **عندما**: `model` = `kling-v2.5-turbo-text-to-video-pro`; **غير مقبول**: `mode`, `reference_image_urls`, `reference_video_url`, `reference_video_type`, `preserve_reference_video_audio`
- **عندما**: `model` = `kling-v2.6`; **غير مقبول**: `output_resolution`, `negative_prompt`, `cfg_scale`, `multi_shots`, `multi_prompt`, `first_frame_image_url`, `last_frame_image_url`, `kling_elements`, `reference_image_urls`, `reference_video_url`, `reference_video_type`, `preserve_reference_video_audio`
- **عندما**: `model` = `kling-v3-omni`; **غير مقبول**: `negative_prompt`, `cfg_scale`, `multi_shots`, `multi_prompt`, `first_frame_image_url`, `last_frame_image_url`, `kling_elements`, `reference_image_urls`, `reference_video_url`, `reference_video_type`, `preserve_reference_video_audio`
- **عندما**: `model` = `kling-v3-turbo-text-to-video`; **غير مقبول**: `enable_sound`, `negative_prompt`, `cfg_scale`, `multi_shots`, `multi_prompt`, `first_frame_image_url`, `last_frame_image_url`, `kling_elements`, `reference_image_urls`, `reference_video_url`, `reference_video_type`, `preserve_reference_video_audio`

## إنشاء قبول

HTTP 202 - POST /api/v1/kling/text_to_video

### مخطط الاستجابة

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    },
    "task_replayed": {
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "status",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "processing"
}
```

## الاستطلاع قيد المعالجة

HTTP 200 - GET /api/v1/kling/text_to_video/:id

### مخطط الاستجابة

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "processing"
}
```

## اكتمل الاستطلاع

HTTP 200 - GET /api/v1/kling/text_to_video/:id

### مخطط الاستجابة

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    },
    "videos": {
      "items": {
        "properties": {
          "url": {
            "type": "string",
            "x-runapi-generated-media": true
          }
        },
        "required": [
          "url"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "status",
    "videos",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "completed",
  "videos": [
    {
      "url": "https://file.runapi.ai/reference-video.mp4"
    }
  ]
}
```

## فشل الاستطلاع

HTTP 200 - GET /api/v1/kling/text_to_video/:id

### مخطط الاستجابة

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "error": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "error": "Task processing failed.",
  "id": "tsk_reference_demo",
  "status": "failed"
}
```

## استدعاء العميل: مكتمل

HTTP 200 - POST callback_url

### مخطط الاستجابة

```json
{
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    },
    "videos": {
      "items": {
        "properties": {
          "url": {
            "type": "string",
            "x-runapi-generated-media": true
          }
        },
        "required": [
          "url"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "status",
    "videos"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "id": "tsk_reference_demo",
  "status": "completed",
  "videos": [
    {
      "url": "https://file.runapi.ai/reference-video.mp4"
    }
  ]
}
```

## استدعاء العميل: فشل

HTTP 200 - POST callback_url

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "properties": {
            "code": {
              "type": "string"
            },
            "limit_cents": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            },
            "reset_at": {
              "format": "date-time",
              "type": [
                "string",
                "null"
              ]
            },
            "used_cents": {
              "type": "integer"
            },
            "window": {
              "enum": [
                "1h",
                "1d",
                "7d",
                "daily",
                "weekly",
                "monthly",
                "lifetime"
              ],
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "type": "object",
          "unevaluatedProperties": false
        }
      ]
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": {
    "code": "generation_failed",
    "message": "Task processing failed."
  },
  "id": "tsk_reference_demo",
  "status": "failed"
}
```

## الأخطاء

HTTP 401 - POST /api/v1/kling/text_to_video

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "Authentication required"
}
```

## الأخطاء

HTTP 401 - GET /api/v1/kling/text_to_video/:id

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "Authentication required"
}
```

## الأخطاء

HTTP 400 - POST /api/v1/kling/text_to_video

### مخطط الاستجابة

```json
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "رسالة خطأ قابلة للقراءة البشرية.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "ملخص التحقق القابل للقراءة البشرية.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "رسائل التحقق مفتاحها حقل الطلب العام، مع مصفوفة من السلاسل القابلة للقراءة البشرية لكل حقل.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}
```

### مثال على الاستجابة

```json
{
  "error": "model must be one of: kling-3.0, kling-o1, kling-v2.1-master-text-to-video, kling-v2.5-turbo-text-to-video-pro, kling-v2.6, kling-v3-omni, kling-v3-omni-reference, kling-v3-turbo-text-to-video"
}
```

## الأخطاء

HTTP 402 - POST /api/v1/kling/text_to_video

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "Insufficient balance"
}
```

## الأخطاء

HTTP 429 - POST /api/v1/kling/text_to_video

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "API key credit limit exceeded"
}
```

## الأخطاء

HTTP 409 - POST /api/v1/kling/text_to_video

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "The request uses features that are not supported for the selected model"
}
```

## الأخطاء

HTTP 429 - POST /api/v1/kling/text_to_video

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "Rate limit reached. Please retry later."
}
```

## الأخطاء

HTTP 503 - POST /api/v1/kling/text_to_video

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "Service under maintenance, please try again later"
}
```

## الأخطاء

HTTP 504 - POST /api/v1/kling/text_to_video

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "The request timed out"
}
```

## الأخطاء

HTTP 404 - GET /api/v1/kling/text_to_video/:id

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "Task with id 'tsk_reference_demo' not found"
}
```

## نماذج الأكواد المولَّدة

استخدم cURL مباشرةً، أو ثبّت SDK للغة البرمجة التي تستخدمها. كل نموذج يُرسل الطلب الذي تم التحقق من صحته كما هو موضح في هذا المرجع.

### curl

```curl
curl -X POST https://runapi.ai/api/v1/kling/text_to_video \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"model":"kling-v3-turbo-text-to-video","prompt":"A paper kite flying above a quiet coastal town at sunrise","duration_seconds":5,"aspect_ratio":"16:9","output_resolution":"720p"}'
```

### javascript

#### التثبيت

```bash
npm install @runapi.ai/kling
```

```javascript
import { KlingClient } from "@runapi.ai/kling";

const client = new KlingClient({ apiKey: process.env.RUNAPI_API_KEY });
const task = await client.textToVideo.create({
  "model": "kling-v3-turbo-text-to-video",
  "prompt": "A paper kite flying above a quiet coastal town at sunrise",
  "duration_seconds": 5,
  "aspect_ratio": "16:9",
  "output_resolution": "720p"
});
```

### python

#### التثبيت

```bash
pip install runapi-kling
```

```python
import os
from runapi.kling import KlingClient

client = KlingClient(api_key=os.environ["RUNAPI_API_KEY"])
task = client.text_to_video.create(
  model="kling-v3-turbo-text-to-video",
  prompt="A paper kite flying above a quiet coastal town at sunrise",
  duration_seconds=5,
  aspect_ratio="16:9",
  output_resolution="720p"
)
```

### go

#### التثبيت

```bash
go get github.com/runapi-ai/kling-sdk/go@latest
```

```go
package main

import (
  "context"
  "log"
  "os"

  "github.com/runapi-ai/core-sdk/go/option"
  kling "github.com/runapi-ai/kling-sdk/go/kling"
)

func main() {
  client, err := kling.NewClient(option.WithAPIKey(os.Getenv("RUNAPI_API_KEY")))
  if err != nil {
    log.Fatal(err)
  }

  task, err := client.TextToVideo.Create(context.Background(), kling.TextToVideoParams{
    Model: kling.TextToVideoModel("kling-v3-turbo-text-to-video"),
    Prompt: "A paper kite flying above a quiet coastal town at sunrise",
    DurationSeconds: 5,
    AspectRatio: "16:9",
    OutputResolution: kling.KlingTextToVideoOutputResolution("720p"),
  })
  if err != nil {
    log.Fatal(err)
  }
  _ = task
}
```

### ruby

#### التثبيت

```bash
gem install runapi-kling
```

```ruby
require "runapi/kling"

client = RunApi::Kling::Client.new(api_key: ENV.fetch("RUNAPI_API_KEY"))
task = client.text_to_video.create(
  model: "kling-v3-turbo-text-to-video",
  prompt: "A paper kite flying above a quiet coastal town at sunrise",
  duration_seconds: 5,
  aspect_ratio: "16:9",
  output_resolution: "720p"
)
```

### java

#### التثبيت

```kotlin
implementation("ai.runapi:runapi-kling")
```

```java
import ai.runapi.kling.KlingClient;
import ai.runapi.kling.types.TextToVideoParams;
import ai.runapi.core.polling.TaskCreateResponse;

public final class Example {
  public static void main(String[] args) {
    KlingClient client = KlingClient.builder()
        .apiKey(System.getenv("RUNAPI_API_KEY"))
        .build();
    TaskCreateResponse task = client.textToVideo().create(
        TextToVideoParams.builder()
        .model("kling-v3-turbo-text-to-video")
        .prompt("A paper kite flying above a quiet coastal town at sunrise")
        .durationSeconds(5)
        .aspectRatio("16:9")
        .outputResolution("720p")
            .build()
    );
  }
}
```

### php

#### التثبيت

```bash
composer require runapi-ai/kling
```

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use RunApi\Core\ClientOptions;
use RunApi\Kling\KlingClient;

$client = new KlingClient(new ClientOptions(apiKey: getenv('RUNAPI_API_KEY')));
$task = $client->textToVideo->create([
  "model" => "kling-v3-turbo-text-to-video",
  "prompt" => "A paper kite flying above a quiet coastal town at sunrise",
  "duration_seconds" => 5,
  "aspect_ratio" => "16:9",
  "output_resolution" => "720p"
]);
```

## الأدلة ذات الصلة

- [المصادقة](https://runapi.ai/ar/docs/guides/authentication.md)
- [البدء السريع](https://runapi.ai/ar/docs/guides/task-api/quickstart.md)

---

## المزيد من RunAPI

- [الرئيسية](https://runapi.ai/ar/.md)
- [كتالوج النماذج](https://runapi.ai/ar/models.md)
- [الأسعار](https://runapi.ai/ar/pricing.md)
- [مزودو الخدمة](https://runapi.ai/ar/models)
- [التوثيق](https://runapi.ai/ar/docs/guides)
- [حزم SDK](https://runapi.ai/ar/sdk.md)
- [CLI](https://runapi.ai/ar/cli.md)
- [خادم MCP](https://runapi.ai/ar/mcp.md)
- [Claude Code مقابل Cursor](https://runapi.ai/ar/claude-code-vs-cursor.md)
- [إعداد Cursor API](https://runapi.ai/ar/cursor-api-setup.md)
- [RunAPI مقابل OpenRouter](https://runapi.ai/ar/openrouter-alternative.md)
- [المؤسسات](https://runapi.ai/ar/contact.md)
- [اتصل بنا](https://runapi.ai/ar/contact.md)
- [الشروط](https://runapi.ai/ar/terms.md)
- [الخصوصية](https://runapi.ai/ar/privacy.md)
- [فهرس الموقع للوكلاء](https://runapi.ai/llms.txt)

التواصل: contact@runapi.ai

## البيانات المنظمة

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "ar",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/ar",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/ar/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "ar",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/ar",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/aricon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "ar",
    "@type": "TechArticle",
    "headline": "Kling نص إلى فيديو",
    "description": "استخدم نقطة نهاية تحويل النص إلى فيديو لإنشاء مهمة غير متزامنة.",
    "url": "https://runapi.ai/ar/docs/api/kling/text-to-video",
    "mainEntityOfPage": "https://runapi.ai/ar/docs/api/kling/text-to-video"
  }
]
```
