> For the complete documentation index, see [llms.txt](https://docs.kontinent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kontinent.ai/documentation/dokumentation/reference/api-reference.md).

# API-Referenz

## Interaktive OpenAPI-Referenz

Die folgenden Operationen werden aus der maßgeblichen OpenAPI-Spezifikation generiert. Mit **Test it** können Sie eine echte Anfrage erstellen und senden sowie alle Felder, Antworten und Fehlerschemas einsehen.

{% hint style="warning" %}
Der Test eines authentifizierten Endpunkts sendet eine echte Anfrage und kann Guthaben verbrauchen.
{% endhint %}

### Chat-Completion erstellen

{% openapi src="<https://openapi.gitbook.com/o/Vw6A4MslJqK6lSyRGgOt/spec/kontinent-api.yaml>" path="/v1/chat/completions" method="post" %}
<https://openapi.gitbook.com/o/Vw6A4MslJqK6lSyRGgOt/spec/kontinent-api.yaml>
{% endopenapi %}

### Response erstellen

{% openapi src="<https://openapi.gitbook.com/o/Vw6A4MslJqK6lSyRGgOt/spec/kontinent-api.yaml>" path="/v1/responses" method="post" %}
<https://openapi.gitbook.com/o/Vw6A4MslJqK6lSyRGgOt/spec/kontinent-api.yaml>
{% endopenapi %}

### Embeddings erstellen

{% openapi src="<https://openapi.gitbook.com/o/Vw6A4MslJqK6lSyRGgOt/spec/kontinent-api.yaml>" path="/v1/embeddings" method="post" %}
<https://openapi.gitbook.com/o/Vw6A4MslJqK6lSyRGgOt/spec/kontinent-api.yaml>
{% endopenapi %}

### Modelle auflisten

{% openapi src="<https://openapi.gitbook.com/o/Vw6A4MslJqK6lSyRGgOt/spec/kontinent-api.yaml>" path="/v1/models" method="get" %}
<https://openapi.gitbook.com/o/Vw6A4MslJqK6lSyRGgOt/spec/kontinent-api.yaml>
{% endopenapi %}

### Service-Status prüfen

{% openapi src="<https://openapi.gitbook.com/o/Vw6A4MslJqK6lSyRGgOt/spec/kontinent-api.yaml>" path="/healthz" method="get" %}
<https://openapi.gitbook.com/o/Vw6A4MslJqK6lSyRGgOt/spec/kontinent-api.yaml>
{% endopenapi %}

## Konventionen

* **Modell-IDs** haben die Form `provider/model`, z. B. `mistral/mistral-large-latest`.
* **Geld** ist eine ganzzahlige Mikro-EUR-Größe (1 EUR = 1.000.000 µEUR), angegeben pro Million Tokens.
* **Anfrage-Bodies** sind auf 2 MiB begrenzt.

## Anleitungen und Beispiele

### Chat-Completion

{% tabs %}
{% tab title="TypeScript" %}

```typescript
const res = await client.chat.completions.create({
  model: "mistral/mistral-large-latest",
  messages: [{ role: "user", content: "Hallo!" }],
});
```

{% endtab %}

{% tab title="Python" %}

```python
res = client.chat.completions.create(
    model="mistral/mistral-large-latest",
    messages=[{"role": "user", "content": "Hallo!"}],
)
```

{% endtab %}

{% tab title="curl" %}

```bash
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!"}]}'
```

{% endtab %}
{% endtabs %}

Streaming funktioniert genauso mit `"stream": true`. Siehe [Streaming](/documentation/dokumentation/features/streaming.md).

Werkzeugaufrufe funktionieren bei jedem Chat-Modell, im Stream wie ohne: Schicken Sie `tools` (Funktionswerkzeuge) mit optionalem `tool_choice` und `parallel_tool_calls`, und das Modell antwortet mit `message.tool_calls` (im Stream `delta.tool_calls`) und `finish_reason: "tool_calls"`. Für die nächste Runde schicken Sie den Assistenten-Zug mit seinen `tool_calls` zurück, danach je Aufruf eine Nachricht `{"role": "tool", "tool_call_id": "...", "content": "..."}`; bei einem Reasoning-Modell zusätzlich die `reasoning_details` dieses Zuges.

Eine Werkzeugdefinition reist vollständig, samt `strict` und dem JSON-Schema in `parameters`. Auf den Wegen, die den Request neu bauen, wird nichts davon stillschweigend verworfen: Claude über Bedrock oder Vertex sowie `/v1/responses`. Dort wird die Anfrage mit einem `400` abgelehnt, das das Feld benennt, wo ein Upstream einen Wert nicht ausdrücken kann: `tool_choice: "none"` und `parallel_tool_calls: false` bei Claude über Bedrock, das Erzwingen eines Werkzeugs (`"required"` oder eine benannte Funktion) zusammen mit `reasoning` auf beiden Claude-Wegen und gehostete Werkzeuge wie Websuche oder MCP, denn dieses Gateway führt keine eigenen Werkzeuge aus. Bei einem OpenAI-kompatiblen Modell geht die Anfrage stattdessen unverändert durch; ein Werkzeug, das der Anbieter ablehnt, kommt daher als dessen eigener Fehler zurück. Die Form der Deltas steht unter [Streaming](/documentation/dokumentation/features/streaming.md).

Reasoning-Modelle nehmen ein `reasoning`-Objekt und antworten mit `message.reasoning` und/oder `message.reasoning_details`. Garantiert ist keines der beiden Felder: `reasoning.exclude: true` entfernt beide, und Denken, das ein Anbieter nur verschlüsselt herausgibt, kommt als `reasoning_details`-Eintrag **ohne** `message.reasoning` — es gibt keinen Klartext. Behandeln Sie beide als optional. Siehe [Reasoning](/documentation/dokumentation/features/reasoning.md).

### Responses

Dieselben Modelle in OpenAIs Responses-Form. `input` nimmt einen String oder eine Liste von Input-Items, `max_output_tokens` ersetzt `max_tokens`, und die Antwort ist ein `response`-Objekt, dessen `output`-Array `reasoning`- und `message`-Items enthält.

```bash
curl https://api.kontinent.ai/v1/responses \
  -H "Authorization: Bearer $KONTINENT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"bedrock/claude-sonnet-5","input":"Hallo!",
       "reasoning":{"effort":"high"}}'
```

Mit `"stream": true` kommen benannte Events, jedes mit monoton steigender `sequence_number`: `response.created`, `response.output_item.added`, `response.reasoning_text.delta`, `response.reasoning_text.done`, `response.content_part.added`, `response.output_text.delta`, `response.output_text.done`, `response.content_part.done`, `response.function_call_arguments.delta`, `response.function_call_arguments.done`, `response.output_item.done`, `response.completed` — oder `response.failed`, wenn eine Generierung nach dem ersten Byte abbricht. Item- und Content-Part-Events kommen paarweise (added/done), ein Client kann also schliessen, was er geöffnet hat.

Werkzeuge funktionieren auch hier, in der flachen Responses-Form: `tools: [{"type": "function", "name": "...", "parameters": {...}}]`, dazu `tool_choice` und `parallel_tool_calls`. Ein Aufruf kommt als Output-Item vom Typ `function_call` zurück (`call_id`, `name`, `arguments`); die Runde geht weiter, indem Sie ihn in `input` als `function_call`-Item wiederholen, gefolgt von einem `function_call_output`-Item mit derselben `call_id`. Bei einem Reasoning-Modell wiederholen Sie zusätzlich das `reasoning`-Output-Item, das vor dem Aufruf stand, samt `reasoning_details`: Claude prüft sein eigenes Denken und lehnt eine Werkzeugrunde ab, die ohne es zurückkommt. Abgelehnt wird genau das, was auch Chat-Completions ablehnen, mit demselben Feldnamen.

{% hint style="warning" %}
Dieser Endpunkt ist **zustandslos**. `store: true` und `previous_response_id` werden mit `400` abgelehnt — Kontinent speichert keine Prompts und keine Antworten, eine gespeicherte Response könnte also nie gelesen werden. Schicken Sie die vorherigen Züge stattdessen in `input`.
{% endhint %}

### Embeddings

```bash
curl https://api.kontinent.ai/v1/embeddings \
  -H "Authorization: Bearer $KONTINENT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"mistral/mistral-embed","input":"Hallo!"}'
```

Ein Chat-Modell hier zu senden (oder ein Embedding-Modell an den Chat-Endpunkt) wird abgelehnt.

### Modelle auflisten

{% tabs %}
{% tab title="TypeScript" %}

```typescript
const models = await client.models.list();
```

{% endtab %}

{% tab title="Python" %}

```python
models = client.models.list()
```

{% endtab %}

{% tab title="curl" %}

```bash
curl https://api.kontinent.ai/v1/models \
  -H "Authorization: Bearer $KONTINENT_API_KEY"
```

{% endtab %}
{% endtabs %}

Liefert nur die Modelle, die Ihre Organisation aufrufen kann, jeweils mit `kind`, `context_length`, `sovereignty`, `pricing` und — bei denkenden Modellen — einem `reasoning`-Objekt (`supported_efforts`, `default_effort`, `supports_max_tokens`, `mandatory`). Siehe [Modelle & Souveränität](/documentation/dokumentation/models-and-routing/models.md).

### Health

```bash
curl https://api.kontinent.ai/healthz
```

Nicht authentifizierte Liveness-Probe. Nutzen Sie sie für Uptime-Monitoring, nicht für die Verfügbarkeit einzelner Modelle.

## Verwandte Seiten

{% content-ref url="/pages/RymsSMfnICuq1m6lZLHM" %}
[Limits & Konventionen](/documentation/dokumentation/reference/limits.md)
{% endcontent-ref %}

{% content-ref url="/pages/7R1ViKCJpzbvV0OeM7nk" %}
[Fehler behandeln](/documentation/dokumentation/features/errors.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kontinent.ai/documentation/dokumentation/reference/api-reference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
