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

# Vollständiger AIHubMix-Integrationsleitfaden

> Komplettleitfaden zum Verständnis der universellen Modellaufrufmethoden von AIHubMix

AIHubMix verwendet die OpenAI-Modellaufrufschnittstelle als Standard und aggregiert mehrere Modelle, darunter OpenAI, Google Gemini, Anthropic Claude und andere Modellreihen. Der Aufruf eines beliebigen Modells erfolgt auf dieselbe Weise – es muss lediglich die entsprechende `model ID` geändert werden.

<Tip>
  Wichtigste Punkte: Sie müssen lediglich die Weiterleitungs-`base_url` und den [API-Schlüssel](https://aihubmix.com/token) der AiHubMix-Plattform im Client hinzufügen. Modell-IDs erhalten Sie durch Klicken auf die „Kopier-Schaltfläche" auf den [Modell-Marktplatz-Karten](https://aihubmix.com/models).
</Tip>

## Grundlegende Integration: Verwendung der offiziellen OpenAI-Bibliothek

### Python-Beispiel

```py Python theme={null}
from openai import OpenAI

client = OpenAI(
    api_key="sk-***", # Replace with your AiHubMix generated API key
    base_url="https://aihubmix.com/v1"
)

chat_completion = client.chat.completions.create(
    messages=[
        {
            "role": "user",
            "content": "Say this is a test",
        }
    ],
    model="gpt-4o-mini",  # Replace with any supported model ID
)

print(chat_completion)
```

<Info>
  Aktuellen Servicestatus von OpenAI offiziell [prüfen](https://status.openai.com/)
</Info>

## Universelle Modell-Forwarding-API

Endpunkt: `POST` /v1/chat/completions

**Body-Anfrageparameter:**

```json theme={null}
{
  "model": "gpt-4o-mini",
  "messages": [
    {
      "role": "user",
      "content": "What is the meaning of life?"
    }
  ]
}
```

### Anfrageparameter

| Name          | Ort    | Typ    | Erforderlich | Beschreibung              |
| ------------- | ------ | ------ | ------------ | ------------------------- |
| Authorization | header | string | Nein         | Bearer AIHUBMIX\_API\_KEY |
| Content-Type  | header | string | Nein         | keine                     |
| body          | body   | object | Nein         | keine                     |

**Antwortbeispiel:**

```json theme={null}
200 Response
```

```json theme={null}
{
  "id": "chatcmpl-AzJqsyf2h02BKjrqHMA1HVUQpiDfL",
  "model": "gpt-4o-mini",
  "object": "chat.completion",
  "created": 1739177682,
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The meaning of life is a philosophical question that has been debated for centuries. Different people and cultures may have different beliefs about the purpose and significance of life. Some believe that the meaning of life is to seek happiness and fulfillment, while others believe in spiritual or religious meanings such as serving a higher power or fulfilling a destiny. Ultimately, the meaning of life may be a deeply personal and individual question that each person must answer for themselves."
      },
      "finish_reason": "stop"
    }
  ],
  "system_fingerprint": "fp_0165350fbb",
  "usage": {
    "prompt_tokens": 14,
    "completion_tokens": 86,
    "total_tokens": 100
  }
}
```

### Antwortergebnisse

| Statuscode | Bedeutung des Statuscodes | Beschreibung | Datenmodell |
| ---------- | ------------------------- | ------------ | ----------- |
| 200        | OK                        | keine        | Inline      |

***

Zuletzt aktualisiert: 2026-06-01
