# عرض النماذج المتاحة

**API:** Model API

**Endpoint:** `GET /api/v1/models`

يعيد افتراضيًا جميع فئات النماذج، بما فيها chat وimage_generation وvideo_generation وdecisions. يجب أن تكون النماذج ممكّنة ومدرجة وغير محذوفة ولها تسعير حالٍ (الصفر قيمة صالحة). يحتفظ مرشّح المزوّد الاختياري بشروط التسعير والتعيين القائمة. تُرتَّب النتائج تصاعديًا حسب sort_order الإداري، ثم حسب اسم النموذج ومعرّفه. تبقى النماذج المتزامنة حديثًا مخفية حتى يدرجها أحد المسؤولين. يؤثر الإخفاء في قوائم الاكتشاف فقط؛ أما التعطيل فيرفض الطلبات الجديدة أيضًا. لا يتغير البحث عن تفاصيل النموذج. اقرأ model_kind قبل اختيار نقطة النهاية المستدعاة: يستخدم video_generation المسار /api/v1/videos/generations؛ ويستخدم decisions المسار /api/v1/decisions. تتوفر قوائم اكتشاف مخصصة على /api/v1/videos/models و/api/v1/decisions/models. اضبط exclude_video_and_decisions=true لاستبعاد نماذج الفيديو والقرارات بعد تجاوزات فئة المزوّد؛ وتبقى نماذج الصور مؤهلة.

## Base URL

- `https://openapi.felo.ai` — بيئة الإنتاج

## Authentication

- `FeloBearerAuth` (http bearer) — مفتاح API من Felo يُرسل في الترويسة `Authorization: Bearer <key>`.
- `FeloApiKey` (apiKey in header `X-API-Key`) — مفتاح API من Felo يُرسل في الترويسة `X-API-Key: <key>`.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `exclude_video_and_decisions` | query | no | boolean, default: false | مرشّح مزوّد اختياري، مثل ephone أو openrouter. |

## Responses

### 200 — النماذج المتاحة

**application/json**

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

### 401 — مفتاح API من Felo غير صالح أو مفقود

**application/json**

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

### 422 — معامل استعلام غير صالح، مثل provider فارغ أو قيمة منطقية غير صالحة

**application/json**

Schema: object

```json
{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    }
  }
}
```

### 503 — دليل النماذج غير متاح مؤقتًا

**application/json**

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

## Schema definitions

### Model

`#/components/schemas/Model`

```json
{
  "type": "object",
  "required": [
    "id",
    "object",
    "created",
    "owned_by"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "معرّف نموذج Felo."
    },
    "object": {
      "type": "string",
      "const": "model"
    },
    "created": {
      "type": "integer",
      "format": "int64",
      "description": "طابع زمني لإنشاء دليل النماذج بثواني يونكس."
    },
    "owned_by": {
      "type": "string"
    },
    "model_kind": {
      "type": "string",
      "description": "فئة قدرة النموذج الفعلية بعد تجاوزات تعيين المزوّد الممكّن: chat أو image_generation أو video_generation أو decisions. استخدم نقطة النهاية المستدعاة المطابقة لهذه الفئة."
    }
  },
  "additionalProperties": true
}
```

### ModelList

`#/components/schemas/ModelList`

```json
{
  "type": "object",
  "required": [
    "object",
    "data"
  ],
  "properties": {
    "object": {
      "type": "string",
      "const": "list"
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Model"
      }
    }
  },
  "additionalProperties": true
}
```

### OpenAIErrorResponse

`#/components/schemas/OpenAIErrorResponse`

```json
{
  "type": "object",
  "description": "مغلّف أخطاء متوافق مع OpenAI. قد يضمّن Router الحقلين code وmessage دون جميع حقول المنبع الاختيارية.",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "message"
      ],
      "properties": {
        "message": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "description": "نوع خطأ متوافق مع OpenAI عند توفيره."
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "code": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
```
