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

# Using OpenAI library

Here is the latest OpenAI package usage guide.

<Tip>
  Simply configure the forwarding base\_url and your AiHubMix [token](https://aihubmix.com/token) within the client.
  This configuration is compatible with all models on the AiHubMix platform.
</Tip>

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

client = OpenAI(
    api_key="AIHUBMIX_API_KEY", # Replace with the key you generated in AiHubMix
    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",
)

print(chat_completion)
```

<Info>
  OpenAI official current service status [check](https://status.openai.com/)
</Info>
