The three changes
| Setting | OpenAI | luv13 |
|---|---|---|
| Base URL | https://api.openai.com/v1 | https://api.luv13.ai/v1 |
| API key | sk-... from OpenAI | sk-luv13-... from the luv13 dashboard |
| Model | An OpenAI model name | One of the seven ids from GET /v1/models |
Python
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.luv13.ai/v1",
api_key=os.environ["LUV13_API_KEY"],
)
reply = client.chat.completions.create(
model="luv13/glm-5.3-flash",
messages=[{"role": "user", "content": "ping"}],
)
print(reply.choices[0].message.content)If your code builds the client with no arguments, you can set OPENAI_BASE_URL=https://api.luv13.ai/v1 and OPENAI_API_KEY to your luv13 key instead. Both SDKs read those variables. See Environment Variables.
Checklist
- Find every place a model name is hard-coded and replace it with a luv13 id. See Model IDs.
- Remove or reroute calls to endpoints luv13 doesn't serve. See Endpoints.
- If you send images, pick a model that accepts them. See the model list.
- Test the optional features you depend on, such as streaming, tools and JSON output. luv13 hasn't published per-model support yet. See Request Parameters.
- Update cost math: one rate, $0.33 per 1M tokens, input the same as output. See Estimating Costs.
