01 — Platform models
Call a Platform model
The shared catalog speaks the OpenAI API, so your client and your code stay as they are. Only three things change: the base URL, a Platform API key, and the model value.
python
import os
from openai import OpenAI
client = OpenAI(
base_url=os.environ["ONX_BASE_URL"],
api_key=os.environ["ONX_API_KEY"],
)
resp = client.chat.completions.create(
model="glm-5.3",
messages=[{"role": "user", "content": "Refactor this module"}],
)
print(resp.choices[0].message.content)
curl
curl $ONX_BASE_URL/chat/completions \
-H "Authorization: Bearer $ONX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.3",
"messages": [{"role": "user", "content": "Hello"}]
}'
# Base URL and API keys both come from the console
ONX_BASE_URL → https://catalog.onenexus-do.cloud/v1
Follow the Platform model quickstart.