Endpoints

Chat and messages

The main text endpoint. Accepts an array of messages and returns the model reply in the OpenAI-compatible format; streaming is supported.

Request parameters

ParameterTypeRequiredDescription
modelstringYesModel ID from the catalog, e.g. deepseek-chat.
messagesarrayYesConversation messages: role (system/user/assistant) and content.
streambooleanNoIf true, the reply is streamed as SSE token by token.
temperaturenumberNoCreativity: 0–2, default depends on the model.
top_pnumberNoNucleus sampling, an alternative to temperature.
max_tokensnumberNoUpper bound on reply length.

cURL request

POST/v1/chat/completions
cURL
curl -X POST https://kiree.net/v1/chat/completions \
  -H "Authorization: Bearer sk-your-kiree-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-chat",
    "messages": [
      {"role": "system", "content": "You are a kiree.net assistant."},
      {"role": "user", "content": "Write a short greeting."}
    ],
    "stream": true
  }'

Streaming reply (Python)

Python
from openai import OpenAI

client = OpenAI(api_key="sk-your-kiree-key", base_url="https://kiree.net/v1")

stream = client.chat.completions.create(
    model="deepseek-chat",
    messages=[{"role": "user", "content": "Tell me about yourself in two lines."}],
    stream=True
)
for chunk in stream:
    delta = chunk.choices[0].delta.content
    if delta:
        print(delta, end="", flush=True)

Streaming output (SSE)

With stream: true the gateway returns the reply as Server-Sent Events: each portion arrives as a separate chunk with the delta in choices[0].delta.content. The final chunk signals completion. For the stream format see the OpenAI Chat Completions specification.

Beyond the chat format, the gateway supports /v1/completions (legacy), /v1/responses (Responses API) and /v1/messages (Anthropic format). The Messages format is covered in the Messages format section; the full endpoint list is on the overview.