Skip to main content
Only the base URL and API key change.

TypeScript

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.ICELAKE_API_KEY,
  baseURL: "https://chat.icelake.io/api/v1",
});

const stream = await client.chat.completions.create({
  model: "zai-org-glm-5-2",
  stream: true,
  messages: [{ role: "user", content: "Stream a short poem" }],
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

Python

from openai import OpenAI
import os

client = OpenAI(
    api_key=os.environ["ICELAKE_API_KEY"],
    base_url="https://chat.icelake.io/api/v1",
)

completion = client.chat.completions.create(
    model="zai-org-glm-5-2",
    messages=[{"role": "user", "content": "Hello"}],
)
print(completion.choices[0].message.content)

Images

const image = await client.images.generate({
  model: "auto",
  prompt: "A crystalline lake under aurora",
  // @ts-expect-error response_format may vary by SDK version
  response_format: "b64_json",
});