Skip to main content

Endpoint

POST /api/v1/chat/completions
OpenAI-compatible chat. Supports streaming and non-streaming responses.

Request body

FieldTypeDescription
modelstringModel id from GET /models
messagesarrayOpenAI-style message objects
streambooleanDefault false for pure OpenAI clients; set true for SSE
temperaturenumberOptional sampling
top_pnumberOptional nucleus sampling
max_tokensintegerOptional max output tokens
icelake_parametersobjectOptional Icelake extensions

Example

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": "user", "content": "Hello"}],
    "stream": false,
    "max_tokens": 256
  }'
const res = await client.chat.completions.create({
  model: "zai-org-glm-5-2",
  messages: [{ role: "user", content: "Hello" }],
  stream: false,
  max_tokens: 256,
});
res = client.chat.completions.create(
    model="zai-org-glm-5-2",
    messages=[{"role": "user", "content": "Hello"}],
    stream=False,
    max_tokens=256,
)

Streaming

Set stream: true. Response is text/event-stream with OpenAI-style chunks, ending with:
data: [DONE]

Response headers

HeaderMeaning
x-request-idSupport / debugging id
x-icelake-model-idResolved public model id
x-icelake-balance-creditsWallet balance after reserve/charge
x-ratelimit-limit-requestsConfigured RPM for the key

Billing

API key chat usage is metered in credits (not free daily chat quotas used by the web app).