> ## 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.

# Verfügbare CometAPI-Modelle auflisten

> Listen Sie verfügbare CometAPI-Modelle mit dem Endpunkt für den Modellkatalog auf und verwenden Sie das Modellverzeichnis, um Fähigkeiten und Preise zu bestätigen.

Listen Sie verfügbare Modelle auf, indem Sie den öffentlichen Katalog-Endpunkt `GET /api/models` aufrufen. Verwenden Sie die zurückgegebenen model IDs für API-Anfragen und prüfen Sie anschließend Details zu Fähigkeiten und Preisen im Modellverzeichnis.

## Den Modellkatalog aufrufen

Die folgende Anfrage listet verfügbare Modelle auf:

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

Die Antwort enthält Modelleinträge:

```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-Modellliste

Das folgende Python-Beispiel gibt model IDs aus dem Katalog aus:

```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"])
```

Die Ausgabe ist eine Liste von model IDs:

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

## Eine model ID verwenden

Das folgende Beispiel sendet eine Anfrage mit einer model ID aus dem Katalog:

```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."
      }
    ]
  }'
```

Die Antwort verwendet die ausgewählte model ID:

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

## Häufige Fehler

| Fehler                                     | Behebung                                                                                                                                                                        |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Den Katalog als Preisdaten behandeln       | Verwenden Sie das Modellverzeichnis für Preis- und Fähigkeitsdetails.                                                                                                           |
| Veraltete model IDs wiederverwenden        | Rufen Sie den Katalog während der Bereitstellung oder beim Start ab.                                                                                                            |
| `/api/models` und `/v1/models` verwechseln | Verwenden Sie `/api/models` für den öffentlichen Katalog. Verwenden Sie das authentifizierte `/v1/models` nur, wenn Sie die OpenAI-kompatible Form einer Modellliste benötigen. |
| Falscher Endpunkt für den Modelltyp        | Stimmen Sie die Modellfähigkeit mit der API-Referenzseite ab.                                                                                                                   |

## Verwandte Links

* [Modelle-Seite](/de/overview/models)
* [Modelverzeichnis](https://www.cometapi.com/models/)
* [Preise](https://www.cometapi.com/pricing/)
* [Textmodelle](/api/text)
* [Bildmodelle](/api/image)
* [Videomodelle](/api/video)
* [Audiomodelle](/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": "Wie liste ich verfügbare Modelle auf?",
        "description": "Listen Sie verfügbare CometAPI-Modelle mit dem öffentlichen Endpunkt des Modellkatalogs auf und verwenden Sie das Modellverzeichnis, um Fähigkeiten und Preise zu überprüfen.",
        "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-Dokumentation",
            "item": "https://apidoc.cometapi.com/"
          },
          {
            "@type": "ListItem",
            "position": 2,
            "name": "Anleitungen",
            "item": "https://apidoc.cometapi.com/guides/use-cometapi-with-openai-sdk"
          },
          {
            "@type": "ListItem",
            "position": 3,
            "name": "Wie liste ich verfügbare Modelle auf?",
            "item": "https://apidoc.cometapi.com/guides/how-to-list-available-models"
          }
        ]
      }
    ]
    }
    `}
</script>
