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

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

> اعرض نماذج CometAPI المتاحة باستخدام endpoint فهرس النماذج، واستخدم دليل النماذج لتأكيد الإمكانات والأسعار.

اعرض النماذج المتاحة من خلال استدعاء endpoint الفهرس العام `GET /api/models`. استخدم model IDs المُعادة في طلبات API، ثم أكِّد تفاصيل الإمكانات والأسعار في دليل النماذج.

## استدعاء فهرس النماذج

يعرض الطلب التالي النماذج المتاحة:

```bash theme={null}
curl https://api.cometapi.com/api/models
```

تحتوي الاستجابة على سجلات النماذج:

```json theme={null}
{
  "success": true,
  "page": 0,
  "page_size": 0,
  "total": 301,
  "data": [
    {
      "id": "gpt-image-2",
      "provider": "OpenAI",
      "model_type": "image",
      "features": [
        "text-to-image"
      ],
      "pricing": {
        "currency": "USD / M Tokens",
        "input": 4,
        "output": 24,
        "per_request": null,
        "per_second": null
      },
      "api_doc_url": "https://apidoc.cometapi.com/api/image/openai/images"
    }
  ]
}
```

## قائمة النماذج في Python

يعرض مثال Python التالي model IDs من الفهرس:

```python theme={null}
import requests

response = requests.get("https://api.cometapi.com/api/models", timeout=30)
response.raise_for_status()

models = response.json()["data"]
for model in models:
    print(model["id"])
```

الناتج عبارة عن قائمة من model IDs:

```text theme={null}
your-model-id
another-model-id
```

## استخدام model ID

يرسل المثال التالي طلبًا باستخدام model ID واحد من الفهرس:

```bash theme={null}
curl https://api.cometapi.com/v1/chat/completions \
  -H "Authorization: Bearer $COMETAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "your-model-id",
    "messages": [
      {
        "role": "user",
        "content": "Say hello."
      }
    ]
  }'
```

تستخدم الاستجابة model ID المحدد:

```json theme={null}
{
  "model": "your-model-id",
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "Hello."
      }
    }
  ]
}
```

## الأخطاء الشائعة

| الخطأ                                  | الحل                                                                                                                         |
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| التعامل مع الفهرس على أنه بيانات أسعار | استخدم دليل النماذج للحصول على تفاصيل الأسعار والإمكانات.                                                                    |
| إعادة استخدام model IDs قديمة          | اجلب الفهرس أثناء النشر أو عند بدء التشغيل.                                                                                  |
| الخلط بين `/api/models` و `/v1/models` | استخدم `/api/models` للفهرس العام. واستخدم `/v1/models` الموثَّق فقط عندما تحتاج إلى صيغة قائمة النماذج المتوافقة مع OpenAI. |
| endpoint غير صحيح لنوع النموذج         | طابِق إمكانات النموذج مع صفحة مرجع API.                                                                                      |

## روابط ذات صلة

* [صفحة النماذج](/ar/overview/models)
* [دليل النماذج](https://www.cometapi.com/models/)
* [الأسعار](https://www.cometapi.com/pricing/)
* [نماذج النص](/api/text)
* [نماذج الصور](/api/image)
* [نماذج الفيديو](/api/video)
* [نماذج الصوت](/api/audio)

<script type="application/ld+json">
  {`
    {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "TechArticle",
        "@id": "https://apidoc.cometapi.com/guides/how-to-list-available-models",
        "headline": "كيف يمكنني عرض النماذج المتاحة؟",
        "description": "اعرض نماذج CometAPI المتاحة باستخدام نقطة نهاية فهرس النماذج العامة، واستخدم دليل النماذج للتأكد من الإمكانات والأسعار.",
        "url": "https://apidoc.cometapi.com/guides/how-to-list-available-models",
        "author": {
          "@type": "Organization",
          "name": "CometAPI"
        },
        "publisher": {
          "@type": "Organization",
          "name": "CometAPI",
          "url": "https://www.cometapi.com"
        }
      },
      {
        "@type": "BreadcrumbList",
        "itemListElement": [
          {
            "@type": "ListItem",
            "position": 1,
            "name": "مستندات CometAPI",
            "item": "https://apidoc.cometapi.com/"
          },
          {
            "@type": "ListItem",
            "position": 2,
            "name": "الأدلة",
            "item": "https://apidoc.cometapi.com/guides/use-cometapi-with-openai-sdk"
          },
          {
            "@type": "ListItem",
            "position": 3,
            "name": "كيف يمكنني عرض النماذج المتاحة؟",
            "item": "https://apidoc.cometapi.com/guides/how-to-list-available-models"
          }
        ]
      }
    ]
    }
    `}
</script>
