# ویڈیو جنریشن ٹاسک جمع کریں

**API:** Model API

**Endpoint:** `POST /api/v1/videos/generations`

OpenRouter طرز کا فلیٹ ویڈیو ان پٹ۔ Felo ماڈل IDs، چینلز، ٹاسک IDs اور ریسپانسز Felo کے فارمیٹ میں ہی رہتے ہیں۔ پرانے input ریپرز اور فراہم کنندہ کے مقامی فیلڈز مسترد کر دیے جاتے ہیں۔ کال بیک، تسلسل، فراہم کنندہ کے اختیارات اور ویڈیو اپ اسکیلنگ معاون نہیں ہیں۔ ماڈل/چینل کی صلاحیتیں ان پیرامیٹرز کو مزید محدود کر سکتی ہیں۔ Felo task_id کے ساتھ HTTP 202 واپس کرتا ہے۔ GET /api/v1/videos/generations/{task_id} کو پول کریں۔ غیر معاون فیلڈز HTTP 400 واپس کرتے ہیں۔

## Base URL

- `https://openapi.felo.ai` — پروڈکشن

## Authentication

- `FeloBearerAuth` (http bearer) — Felo API کلید جو `Authorization: Bearer <key>` کے طور پر بھیجی جاتی ہے۔
- `FeloApiKey` (apiKey in header `X-API-Key`) — Felo API کلید جو `X-API-Key: <key>` کے طور پر بھیجی جاتی ہے۔

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `X-Request-Id` | header | no | string | اختیاری کالر درخواست ID جو تشخیص کے لیے واپس بھیجی جاتی ہے۔ |
| `X-Felo-Channel` | header | no | string, default: "default" | ترتیب شدہ، کوما سے الگ کیے گئے پبلک چینل کوڈز۔ default استعمال کرنے کے لیے یہ ہیڈر چھوڑ دیں؛ default کو تنہا ہی استعمال کرنا ہوگا۔ wallet موڈ میں default ماڈل کے مؤثر پبلک چینل کی ترتیب کو الٹی سمت میں اسکین کرتا ہے، غیر شائع شدہ یا غیر دستیاب چینلز کو نظر انداز کرتا ہے، اور پہلے دستیاب چینل کے پرووائیڈر کا انتخاب کرتا ہے۔ اس میں اسی اپ اسٹریم ماڈل ID اور سروس ٹیئر والے اس پرووائیڈر کے دستیاب endpoints شامل کیے جاتے ہیں۔ واضح چینلز کی توثیق کلائنٹ کی بتائی ہوئی ترتیب میں ہوتی ہے؛ صرف پہلے چینل کا پرووائیڈر گروپ جمع کیا جاتا ہے۔ دیگر پرووائیڈرز کی طرف کوئی خودکار fallback نہیں ہے۔ پرانے پرووائیڈر ہیڈرز چینل روٹنگ کو اوور رائیڈ نہیں کر سکتے۔ |

## Request body

Required: **yes**

### application/json

Schema: `VideoGenerationRequest` (`#/components/schemas/VideoGenerationRequest`)

```json
{
  "type": "object",
  "required": [
    "model"
  ],
  "additionalProperties": false,
  "description": "OpenRouter طرز کا فلیٹ ویڈیو ان پٹ۔ Felo ماڈل IDs، چینلز، ٹاسک IDs اور ریسپانسز Felo کے فارمیٹ میں ہی رہتے ہیں۔ پرانے input ریپرز اور فراہم کنندہ کے مقامی فیلڈز مسترد کر دیے جاتے ہیں۔ کال بیک، تسلسل، فراہم کنندہ کے اختیارات اور ویڈیو اپ اسکیلنگ معاون نہیں ہیں۔ ماڈل/چینل کی صلاحیتیں ان پیرامیٹرز کو مزید محدود کر سکتی ہیں۔",
  "properties": {
    "model": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S"
    },
    "prompt": {
      "type": "string"
    },
    "duration": {
      "type": "integer",
      "minimum": 1
    },
    "resolution": {
      "type": "string",
      "enum": [
        "360p",
        "480p",
        "720p",
        "768p",
        "1080p",
        "1K",
        "2K",
        "4K"
      ]
    },
    "aspect_ratio": {
      "type": "string",
      "enum": [
        "16:9",
        "9:16",
        "1:1",
        "4:3",
        "3:4",
        "3:2",
        "2:3",
        "21:9",
        "9:21"
      ]
    },
    "generate_audio": {
      "type": "boolean"
    },
    "character_orientation": {
      "type": "string",
      "enum": [
        "image",
        "video"
      ],
      "description": "Required by supported Kling motion-control models: orientation source."
    },
    "seed": {
      "type": "integer"
    },
    "size": {
      "type": "string",
      "pattern": "^[1-9][0-9]*x[1-9][0-9]*$"
    },
    "frame_images": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "image_url"
            ]
          },
          "image_url": {
            "type": "object",
            "additionalProperties": false,
            "oneOf": [
              {
                "required": [
                  "url"
                ]
              },
              {
                "required": [
                  "file_id"
                ]
              }
            ],
            "properties": {
              "url": {
                "type": "string",
                "minLength": 1,
                "pattern": "\\S",
                "not": {
                  "pattern": "^\\s*felo_file_"
                }
              },
              "file_id": {
                "type": "string",
                "maxLength": 80,
                "pattern": "^felo_file_[A-Za-z0-9_-]{1,70}$",
                "description": "Uploaded Felo file owned by the authenticated user."
              }
            }
          },
          "frame_type": {
            "type": "string",
            "enum": [
              "first_frame",
              "last_frame"
            ]
          }
        },
        "required": [
          "type",
          "image_url",
          "frame_type"
        ]
      }
    },
    "input_references": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "image_url"
                ]
              },
              "image_url": {
                "type": "object",
                "additionalProperties": false,
                "oneOf": [
                  {
                    "required": [
                      "url"
                    ]
                  },
                  {
                    "required": [
                      "file_id"
                    ]
                  }
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "\\S",
                    "not": {
                      "pattern": "^\\s*felo_file_"
                    }
                  },
                  "file_id": {
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^felo_file_[A-Za-z0-9_-]{1,70}$",
                    "description": "Uploaded Felo file owned by the authenticated user."
                  }
                }
              }
            },
            "required": [
              "type",
              "image_url"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "video_url"
                ]
              },
              "video_url": {
                "type": "object",
                "additionalProperties": false,
                "oneOf": [
                  {
                    "required": [
                      "url"
                    ]
                  },
                  {
                    "required": [
                      "file_id"
                    ]
                  }
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "\\S",
                    "not": {
                      "pattern": "^\\s*felo_file_"
                    }
                  },
                  "file_id": {
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^felo_file_[A-Za-z0-9_-]{1,70}$",
                    "description": "Uploaded Felo file owned by the authenticated user."
                  }
                }
              }
            },
            "required": [
              "type",
              "video_url"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "audio_url"
                ]
              },
              "audio_url": {
                "type": "object",
                "additionalProperties": false,
                "oneOf": [
                  {
                    "required": [
                      "url"
                    ]
                  },
                  {
                    "required": [
                      "file_id"
                    ]
                  }
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "\\S",
                    "not": {
                      "pattern": "^\\s*felo_file_"
                    }
                  },
                  "file_id": {
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^felo_file_[A-Za-z0-9_-]{1,70}$",
                    "description": "Uploaded Felo file owned by the authenticated user."
                  }
                }
              }
            },
            "required": [
              "type",
              "audio_url"
            ]
          }
        ]
      }
    },
    "user": {
      "type": "string",
      "maxLength": 256
    },
    "session_id": {
      "type": "string",
      "maxLength": 256
    },
    "trace": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "trace_id": {
          "type": "string"
        },
        "trace_name": {
          "type": "string"
        },
        "span_name": {
          "type": "string"
        },
        "generation_name": {
          "type": "string"
        },
        "parent_span_id": {
          "type": "string"
        }
      }
    },
    "provider": {
      "type": "object",
      "required": [
        "options"
      ],
      "additionalProperties": false,
      "properties": {
        "options": {
          "type": "object",
          "minProperties": 1,
          "maxProperties": 1,
          "additionalProperties": {
            "type": "object"
          },
          "description": "Options keyed by the slug published in the model catalog provider_options."
        }
      }
    }
  }
}
```

Example:

```json
{
  "model": "veo-3.1-lite",
  "prompt": "A cinematic camera move",
  "duration": 4,
  "resolution": "720p",
  "generate_audio": false,
  "frame_images": [
    {
      "type": "image_url",
      "frame_type": "first_frame",
      "image_url": {
        "url": "https://example.com/first.png"
      }
    }
  ]
}
```

## Responses

### 202 — ٹاسک قبول ہو گیا

**application/json**

Schema: `VideoGenerationAccepted` (`#/components/schemas/VideoGenerationAccepted`)

### 400 — غلط درخواست (نامعلوم ماڈل، ملے جلے ان پٹ موڈز، غلط فیلڈز)

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

### 401 — غلط یا غیر موجود Felo API کلید

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

### 402 — ناکافی بیلنس / بلنگ کی شرط پوری نہیں ہوئی

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

### 403 — اکاؤنٹ کو اجازت نہیں (سبسکرپشن درکار ہے یا صارف بین ہے)۔ غیر فعال ماڈلز بھی اپ اسٹریم کالز سے پہلے مسترد کر دیے جاتے ہیں۔ پہلے سے قبول شدہ درخواستیں اور ٹاسکس جاری رہتے ہیں۔

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

### 429 — درخواست یا اخراجات کی حد پوری ہو گئی

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

### 502 — اپ اسٹریم پرووائیڈر ناکام رہا

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

### 503 — جنریشن سروس یا بلنگ سروس عارضی طور پر دستیاب نہیں

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

## Schema definitions

### GenerationError

`#/components/schemas/GenerationError`

```json
{
  "type": "object",
  "description": "OpenAI سے مطابقت رکھنے والا خرابی کا لفافہ۔",
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "message",
        "type"
      ],
      "properties": {
        "message": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "invalid_request_error",
            "server_error"
          ]
        },
        "param": {
          "type": "string",
          "nullable": true
        },
        "code": {
          "type": "string"
        }
      }
    }
  }
}
```

### VideoGenerationAccepted

`#/components/schemas/VideoGenerationAccepted`

```json
{
  "type": "object",
  "required": [
    "task_id",
    "status",
    "kind",
    "outputs"
  ],
  "properties": {
    "task_id": {
      "type": "string",
      "description": "پولنگ کے لیے استعمال ہونے والی ٹاسک ID۔"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued"
      ]
    },
    "kind": {
      "type": "string",
      "enum": [
        "video"
      ]
    },
    "outputs": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "ٹاسک کامیاب ہونے تک خالی۔"
    }
  }
}
```
