The script
import os
import openai
from openai import OpenAI
client = OpenAI(
base_url="https://api.luv13.ai/v1",
api_key=os.environ["LUV13_API_KEY"],
)
for model in client.models.list():
print(model.id)
try:
reply = client.chat.completions.create(
model="luv13/glm-5.3-flash",
messages=[{"role": "user", "content": "ping"}],
)
print(reply.choices[0].message.content)
except openai.AuthenticationError:
raise SystemExit("401: check LUV13_API_KEY.")pip install openai
export LUV13_API_KEY=sk-luv13-...
python luv13_example.pyThe SDK retries 429 and 5xx responses twice by default; see Retrying Requests. For the SDKs in general, see Using the OpenAI SDKs.
