OpenAI SDK to GrexLabs in ten minutes: one base URL, zero rewrites
If you already use the OpenAI SDK, migration is a base-URL change.
Python
from openai import OpenAI
client = OpenAI(
api_key="sk-gl-...",
base_url="https://www.grexlabs.in/api/v1",
)
resp = client.chat.completions.create(
model="auto:free",
messages=[{"role": "user", "content": "hello"}],
)
print(resp.choices[0].message.content)
Node
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.GREX_KEY,
baseURL: "https://www.grexlabs.in/api/v1",
});
Free :free models work with any non-empty key string โ or use the keyless endpoints in /docs.