> 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.

# Quickstart

Kontinent's data plane is OpenAI-compatible. If you already talk to OpenAI, you
change two things: the base URL and the API key.

## 1. Set your base URL and key

```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"],
)
```

Local development runs the gateway at `http://localhost:4000`. The dev stack
seeds a key automatically — see the repository README.

## 2. Send a chat completion

```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. Stream the response

Set `stream: true` to receive Server-Sent Events as the model generates.

```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 ?? "");
}
```

See [Streaming](/streaming) for the SSE wire format and timeout behavior.

## Next steps

#### [Authentication](/authentication)

How `sk-kt-` keys work, and how revocation propagates.

#### [Models & sovereignty](/models)

Discover models, pricing in micro-EUR, and sovereignty tiers.

#### [Errors](/errors)

The OpenAI-shaped error taxonomy and how to react to each.

#### [Rate limits & credits](/rate-limits)

Per-key RPM and the prepaid credit model.