Developer documentation
OpenAPI schemakisch.chat
Appearance
Documentation
Get started

Quickstart

Send your first chat completion request.

On this page

This guide assumes an administrator has given you an active Kisch virtual key and the deployment has at least one model enabled for that key. The base local Compose stack intentionally starts with no model configured. A key cannot make an unavailable model available.

1. Set the gateway URL and key

The local Compose gateway listens at http://localhost:4000 by default. For a hosted deployment, use the base URL supplied by its operator. Store the key in a secret manager or environment variable; do not commit it or put it in browser code.

export KISCH_BASE_URL="http://localhost:4000"
export KISCH_API_KEY="sk-your-virtual-key"

2. Check the visible model list

curl --fail-with-body "$KISCH_BASE_URL/v1/models" \
  -H "Authorization: Bearer $KISCH_API_KEY"

The base stack returns no configured models. When an operator enables a validated deployment, the list reflects its current configuration. A listed alias does not prove the model runtime is healthy or ready to answer requests.

3. Send a non-streaming request

Use a model id returned by the previous request:

export KISCH_MODEL="$(curl --fail-with-body "$KISCH_BASE_URL/v1/models" -H "Authorization: Bearer $KISCH_API_KEY" | jq -er '.data[0].id')"

curl --fail-with-body "$KISCH_BASE_URL/v1/chat/completions" \
  -H "Authorization: Bearer $KISCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --arg model "$KISCH_MODEL" '{model:$model,messages:[{role:"user",content:"Give me a one-sentence summary of photosynthesis."}],stream:false}')"

The JSON shape follows the chat-completions request format. Provider-specific fields and capabilities are not promised unless the active model's documentation says they are supported.

OpenAI SDK clients

Point an OpenAI SDK at the Kisch gateway URL and use the Kisch key. The SDK is only a transport client here; the gateway does not provide every OpenAI API or guarantee identical model behavior.

import os
from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:4000/v1",
    api_key="sk-your-virtual-key",
)

response = client.chat.completions.create(
    model=os.environ["KISCH_MODEL"],
    messages=[{"role": "user", "content": "Say hello in five words."}],
)
print(response.choices[0].message.content)

Replace the sample alias with an id returned by GET /v1/models. Never use the LiteLLM master key in an application client.