> ## Documentation Index
> Fetch the complete documentation index at: https://docs.icelake.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Create an API key, set your base URL, and make your first chat completion request.

Get up and running with the Icelake API in minutes.

## 1. Get an API key

1. Sign in at [chat.icelake.io](https://chat.icelake.io)
2. Open **Settings → API keys**
3. Create a key and copy it immediately — the full secret is shown **once**

## 2. Configure the environment

```bash theme={null}
export ICELAKE_API_KEY='icl_...'
```

## 3. Install the OpenAI SDK (optional)

<CodeGroup>
  ```bash npm theme={null}
  npm install openai
  ```

  ```bash pip theme={null}
  pip install openai
  ```
</CodeGroup>

You can also use raw HTTP / cURL.

## 4. Send a chat completion

<CodeGroup>
  ```ts TypeScript theme={null}
  import OpenAI from "openai";

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

  const res = await client.chat.completions.create({
    model: "zai-org-glm-5-2",
    messages: [
      { role: "system", content: "You are a helpful assistant." },
      { role: "user", content: "Why is privacy important?" },
    ],
  });

  console.log(res.choices[0].message.content);
  ```

  ```python Python theme={null}
  import os
  from openai import OpenAI

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

  res = client.chat.completions.create(
      model="zai-org-glm-5-2",
      messages=[
          {"role": "system", "content": "You are a helpful assistant."},
          {"role": "user", "content": "Why is privacy important?"},
      ],
  )

  print(res.choices[0].message.content)
  ```

  ```bash cURL theme={null}
  curl https://chat.icelake.io/api/v1/chat/completions \
    -H "Authorization: Bearer $ICELAKE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "zai-org-glm-5-2",
      "messages": [
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Why is privacy important?"}
      ]
    }'
  ```
</CodeGroup>

## 5. List models

Use IDs from `GET /models` as the `model` field on chat and image requests.

```bash theme={null}
curl https://chat.icelake.io/api/v1/models \
  -H "Authorization: Bearer $ICELAKE_API_KEY"
```

## 6. Optional: streaming

Set `stream: true` to receive SSE chunks ending with `data: [DONE]`.

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

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

## Next

* [Authentication](/authentication)
* [Chat reference](/api-reference/chat)
* [OpenRouter & tools](/guides/openrouter)
