Aihubmix uses OpenAI model calling interface as the standard, aggregating multiple models including OpenAI, Google Gemini, Anthropic Claude and other series models. Calling any model uses the same method, just need to modify the corresponding model ID.
Key points: Only need to add the forwarding base_url and AiHubMix platform API key inside the client. Model IDs can be obtained by clicking the “Copy Button” on model marketplace cards.

Basic Integration: Using OpenAI Official Library

Python Example

Python
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)
OpenAI official current service status check

Universal Model Forwarding API

Endpoint: POST /v1/chat/completions Body Request Parameters:
{
  "model": "gpt-4o-mini",
  "messages": [
    {
      "role": "user",
      "content": "What is the meaning of life?"
    }
  ]
}

Request Parameters

NameLocationTypeRequiredDescription
AuthorizationheaderstringNoBearer AIHUBMIX_API_KEY
Content-TypeheaderstringNonone
bodybodyobjectNonone
Response Example:
200 Response
{
  "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
  }
}

Response Results

Status CodeStatus Code MeaningDescriptionData Model
200OKnoneInline