> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.kontinent.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.kontinent.ai/_mcp/server.

# Schnellstart

Die Data Plane von Kontinent ist OpenAI-kompatibel. Wenn Sie bereits mit OpenAI
kommunizieren, ändern Sie nur zwei Dinge: die Basis-URL und den API-Schlüssel.

## 1. Basis-URL und Schlüssel setzen

```ts title="TypeScript"
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.kontinent.ai/v1",
  apiKey: process.env.KONTINENT_API_KEY, // sk-kt-…
});
```

```python title="Python"
from openai import OpenAI

client = OpenAI(
    base_url="https://api.kontinent.ai/v1",
    api_key=os.environ["KONTINENT_API_KEY"],
)
```

Die lokale Entwicklung betreibt das Gateway unter `http://localhost:4000`. Der
Dev-Stack legt automatisch einen Schlüssel an — siehe die README des Repositorys.

## 2. Eine Chat-Completion senden

```ts title="TypeScript"
const res = await client.chat.completions.create({
  model: "mistral/mistral-large-latest",
  messages: [{ role: "user", content: "Hallo!" }],
});
console.log(res.choices[0].message.content);
```

```bash title="curl"
curl https://api.kontinent.ai/v1/chat/completions \
  -H "Authorization: Bearer $KONTINENT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"mistral/mistral-large-latest",
       "messages":[{"role":"user","content":"Hallo!"}]}'
```

## 3. Die Antwort streamen

Setzen Sie `stream: true`, um Server-Sent Events zu empfangen, während das
Modell generiert.

```ts title="TypeScript"
const stream = await client.chat.completions.create({
  model: "mistral/mistral-small-latest",
  messages: [{ role: "user", content: "Write a haiku about Europe." }],
  stream: true,
});

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

Siehe [Streaming](/streaming) für das SSE-Wire-Format und das Timeout-Verhalten.

## Nächste Schritte

#### [Authentifizierung](/authentication)

Wie `sk-kt-`-Schlüssel funktionieren und wie sich ein Widerruf verbreitet.

#### [Modelle & Souveränität](/models)

Modelle entdecken, Preise in Mikro-EUR und Souveränitätsstufen.

#### [Fehler](/errors)

Die OpenAI-förmige Fehler-Taxonomie und wie Sie auf jeden Fall reagieren.

#### [Rate-Limits & Guthaben](/rate-limits)

RPM pro Schlüssel und das Prepaid-Guthabenmodell.