> For the complete documentation index, see [llms.txt](https://unsloth.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unsloth.ai/docs/de/integrationen/curl-and-http-mit-unsloth-verbinden.md).

# Curl & HTTP mit Unsloth verbinden

Anleitung zum Aufrufen der Unsloth-API mit curl (oder einem beliebigen HTTP-Client), inklusive kopierbarer Beispiele für jeden Endpunkt und jede Funktion..

Unsloth stellt drei mit OpenAI/Anthropic kompatible Wire-Formate unter derselben Basis-URL auf dem Port bereit, auf dem Unsloth gestartet wurde. Alle von ihnen erfordern ein `Authorization: Bearer sk-unsloth-…` Header und geben je nach Einstellung entweder JSON oder SSE zurück, `stream`.

Diese Seite gruppiert die Rezepte nach Endpunkt (`/v1/chat/completions`, `/v1/messages`, `/v1/responses`, `/v1/models`, `/v1/embeddings`, `/v1/systemone`) und endet mit einem gemeinsamen Abschnitt über Unsloths integrierte **serverseitige Tools**, die mit allen Chat-Endpunkten funktionieren.

{% hint style="info" %}
Wenn du dir nicht sicher bist, welche URL / welchen Schlüssel / welchen Modellnamen du verwenden sollst, lies zuerst die API-Übersicht. Sie führt dich durch das Starten von Unsloth, das Laden eines Modells und das Erstellen eines `sk-unsloth-…` Schlüssels.
{% endhint %}

### 🔑 Authentifizierung

Jede Anfrage benötigt einen `Authorization` Header:

```
Authorization: Bearer sk-unsloth-xxxxxxxxxxxx
```

Um Schlüssel aus deiner Shell-Historie herauszuhalten, exportiere den Schlüssel einmal und verweise auf die Umgebungsvariable:

```bash
export UNSLOTH_STUDIO_AUTH_TOKEN=sk-unsloth-xxxxxxxxxxxx
```

Die folgenden Snippets binden den Schlüssel direkt als `sk-unsloth-xxxxxxxxxxxx` zur Verdeutlichung ein. In der Praxis ersetze `$UNSLOTH_STUDIO_AUTH_TOKEN`.

### 📋 Geladene Modelle auflisten

```bash
curl http://localhost:8888/v1/models \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx"
```

Antwort:

```json
{
  "object": "list",
  "data": [
    {"id": "unsloth/gemma-3-27b-it-GGUF", "object": "model", "owned_by": "local"}
  ]
}
```

<figure><img src="https://797013937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FgVC1VPkCkUQBVg0HScEc%2FScreenshot%202026-04-22%20at%203.06.57%E2%80%AFAM.png?alt=media&amp;token=6f77cc78-bd0e-4141-b555-b232df1036dc" alt=""><figcaption></figcaption></figure>

Verwende das `id` Feld, wenn eine Anfrage einen `"model"` Wert benötigt (oder wenn ein Client wie opencode nach einer **Modell-ID**).

### 💬 Chat Completions (`/v1/chat/completions`)

Der OpenAI-Chat-Completions-Dialekt. Die breiteste Kompatibilitätsabdeckung. Funktioniert mit dem OpenAI SDK, opencode, Cursor, Continue, Cline, Open WebUI, SillyTavern und den meisten OpenAI-kompatiblen Tools.

#### Basisanfrage

```bash
curl http://localhost:8888/v1/chat/completions \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "default",
    "messages": [{"role": "user", "content": "Hallo"}]
  }'
```

<figure><img src="https://797013937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fvy9TyeJZljKrMJAath0L%2FScreenshot%202026-04-22%20at%203.40.35%E2%80%AFAM.png?alt=media&amp;token=98f8d622-83c0-4f55-aa37-d3571f0a38cd" alt=""><figcaption></figcaption></figure>

#### Streaming

Füge `"stream": true` hinzu, und die Antwort wechselt zu Server-Sent Events (`text/event-stream`). Sage `curl` curl, dass es bei eintreffenden Bytes mit `--no-buffer` (`-N`):

```bash
curl -N http://localhost:8888/v1/chat/completions \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-local",
    "messages": [{"role": "user", "content": "Schreibe ein Haiku über lokal ausgeführte LLMs."}],
    "stream": true
  }'
```

Jede Zeile der Antwort sieht so aus `data: {"choices":[{"delta":{"content":"..."}}]}`, endend mit `data: [DONE]`.

<figure><img src="https://797013937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FsazSu4RpyiEa6HeamYbj%2FScreenshot%202026-04-22%20at%203.42.05%E2%80%AFAM.png?alt=media&amp;token=f62cf129-74cd-4e8e-986a-1755eeb0e048" alt=""><figcaption></figcaption></figure>

#### Bilder (Vision)

Füge ein Bild als ein `image_url` Content-Teil in der Benutzernachricht an. Die URL kann HTTPS oder eine Base64- `Daten-` URI sein:

```bash
# Eine lokale Datei als Base64 einbetten (aus Platzgründen gekürzt)
IMG=$(base64 -w 0 test.jpg)

cat > /tmp/request.json <<EOF
{
  "model":"default",
  "messages":[{"role":"user","content":[
    {"type":"text","text":"Beschreibe das Bild."},
    {"type":"image_url","image_url":{"url":"data:image/jpeg;base64,$IMG"}}
  ]}],
  "max_tokens":200,
  "stream":false
}
EOF

curl http://localhost:8888/v1/chat/completions \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d @/tmp/request.json
```

{% hint style="info" %}
Das geladene Modell muss multimodal sein. Wenn du ein textbasiertes Modell lädst, ist die Anfrage strukturell erfolgreich, aber das Modell verarbeitet das Bild nicht.
{% endhint %}

<figure><img src="https://797013937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F9yO7ersnyaIj3X8UkD5q%2FScreenshot%202026-04-22%20at%203.59.30%E2%80%AFAM.png?alt=media&amp;token=9e0af9e5-d565-4acd-8b4a-020c02d74cd8" alt=""><figcaption></figcaption></figure>

#### Funktionsaufrufe (OpenAI-Tools)

Verwende OpenAI-ähnliche `Tools` und (optional) `tool_choice`. Dein Client führt jeden Tool-Aufruf aus und gibt das Ergebnis im nächsten Durchlauf zurück.

```bash
curl http://localhost:8888/v1/chat/completions \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model":"default",
    "messages":[{"role":"user","content":"Wie ist das Wetter in Paris?"}],
    "tools":[{
      "type":"function",
      "function":{
        "name":"get_weather",
        "description":"Erhalte das aktuelle Wetter für eine Stadt.",
        "parameters":{
          "type":"object",
          "properties":{"city":{"type":"string"}},
          "required":["city"]
        }
      }
    }],
    "tool_choice":"required"
  }' | jq '.choices[0].message, .usage'
```

<figure><img src="https://797013937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F39CDJk0Z1WhG5JyaJIfV%2Ftests_codex_pr_2.png?alt=media&amp;token=c3f01286-7dc9-47dd-b7f9-9ee8c2d3cb2f" alt=""><figcaption></figcaption></figure>

### 📨 Anthropic Messages (`/v1/messages`)

Unsloths mit Anthropic kompatibler Dialekt, der von Claude Code, dem Anthropic SDK, OpenClaw und jedem Client verwendet wird, der die Messages API spricht.

#### Basisanfrage

```bash
curl http://localhost:8888/v1/messages \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "default",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hallo"}]
  }'
```

{% hint style="warning" %}
`max_tokens` ist erforderlich bei `/v1/messages` (es ist optional bei `/v1/chat/completions`).
{% endhint %}

<figure><img src="https://797013937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FOz7xeC4dRnDjO5GDAsmC%2FScreenshot%202026-04-22%20at%204.01.52%E2%80%AFAM.png?alt=media&amp;token=b7025ce1-e3a8-46ad-91fa-e87b96a22d6b" alt=""><figcaption></figcaption></figure>

#### Streaming

```bash
curl -N http://localhost:8888/v1/messages \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-local",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Erkläre LoRA in zwei Sätzen."}],
    "stream": true
  }'
```

Ereignisse folgen der SSE-Struktur von Anthropic: `message_start`, `content_block_start`, `content_block_delta`, `content_block_stop`, `message_delta`, `message_stop`, plus Unsloths benutzerdefiniertes `tool_result` Ereignis für serverseitige Tool-Ausgabe.

#### Bilder (Vision)

Anthropic-ähnlicher Bildinhalt verwendet einen `source` Block mit Base64-Daten:

```bash
IMG=$(base64 -w 0 test.jpg)

cat > /tmp/request.json <<EOF
{
  "messages":[{"role":"user","content":[
    {"type":"text","text":"Beschreibe das Bild."},
    {"type":"image","source":{"type":"base64","media_type":"image/jpeg","data":"$IMG"}}
  ]}],
  "max_tokens":200,
  "stream":true
}
EOF

curl -s http://localhost/v1/messages \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d @/tmp/request.json
```

<figure><img src="https://797013937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FMkzYMtkw9dt0V7cbqduU%2FScreenshot%202026-04-22%20at%204.03.28%E2%80%AFAM.png?alt=media&amp;token=de854c5a-b399-4736-83bb-23ffe26981e2" alt=""><figcaption></figcaption></figure>

#### Tool-Aufrufe (Anthropic-Tools)

```bash
curl http://localhost:8888/v1/messages \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-local",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Wie ist das Wetter in Tokio?"}],
    "tools": [
      {
        "name": "get_weather",
        "description": "Get the current weather for a city",
        "input_schema": {
          "type": "object",
          "properties": {
            "city": {"type": "string"}
          },
          "required": ["city"]
        }
      }
    ],
    "tool_choice": {"type": "auto"}
  }'
```

`tool_choice` Die Werte werden wie folgt auf den OpenAI-Dialekt abgebildet: Anthropic `auto` → OpenAI `auto`, Anthropic `any` → OpenAI `required`, Anthropic `{type: "tool", name: "x"}` → OpenAI `{type: "function", function: {name: "x"}}`, Anthropic `none` → OpenAI `none`.

<figure><img src="https://797013937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fqb37JN1ffgBFBKyd1uWD%2FScreenshot%202026-04-22%20at%204.07.43%E2%80%AFAM.png?alt=media&amp;token=1fb7ec5d-8326-4e9f-b752-2d5d7e830a39" alt=""><figcaption></figcaption></figure>

### 🧬 Responses (`/v1/responses`)

Unsloth spricht auch die neuere **OpenAI Responses API**, das Protokoll, auf das Codex und andere neuere OpenAI-Clients umgestiegen sind.

```bash
curl http://localhost:8888/v1/responses \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-local",
    "input": "Schreibe eine Begrüßung in einem Satz."
  }'
```

<figure><img src="https://797013937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FhmyMSCTgdD1NYiLUdYNZ%2Fopenai_responses.png?alt=media&amp;token=dd56bd52-71db-46f3-8f6c-1499df8e443c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://797013937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FZ3MEH4vV2RjxhLe0DsWJ%2Fresponses_function_calling.png?alt=media&amp;token=a8637d5a-51d2-47f5-9658-add9cdb757e3" alt=""><figcaption></figcaption></figure>

Für Streaming füge `"stream": true` hinzu und verwende `curl -N`. Responses-Streams verwenden benannte Ereignisse wie `response.output_text.delta`, statt Chat-Completions-Chunks.

Sende den vollständigen Gesprächsverlauf in `input` bei jeder Anfrage. Unsloth unterstützt kein `previous_response_id` oder `conversation` für serververwaltete Historie.

#### Embeddings (`/v1/embeddings`)

Erzeuge Einbettungsvektoren aus Text mithilfe eines geladenen Embedding-GGUF oder des in Unsloth konfigurierten Embedding-Modells.

Mit `"model": "default"`, verwendet Unsloth den vorhandenen Embedding-GGUF, falls verfügbar, andernfalls sein konfiguriertes Embedding-Modell.

```bash
curl http://localhost:8888/v1/embeddings \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "default",
    "input": [
      "Unsloth führt lokale Modelle aus.",
      "Erzeuge einen Vektor für jeden Text."
    ],
    "encoding_format": "float"
  }'
```

Die Antwort enthält ein `data` Array mit einem `Embedding` Vektor und einem `Index` für jede Eingabe. Verwende Texteingaben für mehr Portabilität; die Unterstützung für Token-Array-Eingaben hängt vom Embedding-Backend ab.

#### Decision API (`/v1/systemone`)

Aktiviere die **Decision API** in **Einstellungen → API** und wähle zuerst ein Entscheidungsmodell aus. Der Endpunkt gibt `404` zurück, wenn die Decision API deaktiviert ist.

Anfragen enthalten `state` und benannte `questions`. Unterstützte Fragetypen sind:

* `noul`: eine Ja/Nein-Entscheidung.
* `choice`: eine Entscheidung zwischen benannten Optionen, die in `criteria`.
* `score`: eine Bewertung auf Grundlage geordneter Kriterienstufen, die in `criteria`.

Verwende `"model": "default"` zur Auswahl des konfigurierten Entscheidungsmodells.

```bash
curl http://localhost:8888/v1/systemone \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "default",
    "state": "Der Kunde sagt, seine Bestellung sei beschädigt angekommen, und bittet um eine Rückerstattung.",
    "questions": {
      "refund_requested": {
        "type": "noul",
        "instructions": "Bittet der Kunde um eine Rückerstattung?"
      }
    }
  }'
```

Um Entscheidungsmodelle zu entdecken:

```bash
curl "http://localhost:8888/v1/models?output_modalities=decisions" \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx"
```

Ersetze `8888` durch deinen Unsloth-Port und den Beispiel-API-Schlüssel durch deinen eigenen.

### 🧰 Unsloths serverseitige Tools (Kurzform)

Zusätzlich zum clientseitigen Funktionsaufruf kann Unsloth **Python**, **bash**, und **Websuche** serverseitig ausführen und die Ergebnisse als benutzerdefinierte `tool_result` Ereignisse zurückstreamen. Das ist die Funktion, durch die sich Unsloth sofort wie ein „echter“ Agent anfühlt, ohne dass Tool-Aufrufe über deinen Client hin- und hergereicht werden müssen.

Aktiviere dies, indem du diese zusätzlichen Felder an **entweder** `/v1/chat/completions` oder `/v1/messages`:

| Feld              | Typ             | Hinweise                                                                             |
| ----------------- | --------------- | ------------------------------------------------------------------------------------ |
| `enable_thinking` | `boolesch`      | `falsch` um das Denken zu deaktivieren. `wahr` standardmäßig                         |
| `enable_tools`    | `boolesch`      | `wahr` um die serverseitige Tool-Ausführung zu aktivieren.                           |
| `enabled_tools`   | `array<string>` | Welche Tools das Modell aufrufen kann. Unterstützt `python`, `bash`, `web_search`.   |
| `session_id`      | `Zeichenkette`  | Optional. Behält den Tool-Zustand (z. B. den Python-Kernel) über Aufrufe hinweg bei. |

#### Denkmodus

Der Denkmodus ist standardmäßig aktiviert.&#x20;

```bash
curl http://localhost:8888/v1/chat/completions \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "default",
    "messages": [{"role": "user", "content": "Fasse Quantentunneln in einem Satz zusammen"}],
    "stream": false
  }'
```

Das Modell wird nachdenken, bevor es eine Antwort gibt.

<figure><img src="https://797013937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F4XHr9KJhzpFEibCGEuHF%2FScreenshot%202026-04-22%20at%2012.22.46%E2%80%AFPM.png?alt=media&amp;token=15fa68ae-0ca5-464f-af16-25cfabc84c33" alt=""><figcaption></figcaption></figure>

Um das Denken zu deaktivieren, übergib `enable_thinking: false` in deiner Anfrage. Das Modell gibt eine Antwort, ohne zuerst nachzudenken.

<figure><img src="https://797013937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FKQR2nh8sb5G1zUc7YSs9%2FScreenshot%202026-04-22%20at%2012.25.47%E2%80%AFPM.png?alt=media&amp;token=4646a17e-2217-4f00-9e39-5362f989126f" alt=""><figcaption></figcaption></figure>

#### Python-Ausführung

```bash
curl http://localhost:8888/v1/chat/completions \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-local",
    "messages": [{"role": "user", "content": "Wie viel ist 123 * 456? Berechne es mit Code."}],
    "stream": false,
    "enable_tools": true,
    "enabled_tools": ["python"],
    "session_id": "my-session"
  }'
```

<figure><img src="https://797013937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FVGbYtwBfSoqgZov5ivMA%2FScreenshot%202026-04-22%20at%204.16.13%E2%80%AFAM.png?alt=media&amp;token=28b83469-24fb-412d-9489-a0c6b92dd8b5" alt=""><figcaption></figcaption></figure>

#### Websuche + Python (Streaming)

```bash
curl http://localhost:8888/v1/chat/completions \
  -H "Authorization: Bearer sk-unsloth-xxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-local",
    "messages": [{"role": "user", "content": "Suche nach Funktionen von Python 3.13"}],
    "stream": true,
    "enable_tools": true,
    "enabled_tools": ["web_search", "python"],
    "session_id": "my-session"
  }'
```

<figure><img src="https://797013937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FzSFyzwXtJ0Hgvqq7gZcV%2FScreenshot%202026-04-22%20at%204.25.13%E2%80%AFAM.png?alt=media&amp;token=a8fc5908-cb11-4ec9-85c6-77a6b5c2e205" alt=""><figcaption></figcaption></figure>

#### Auf `/v1/messages`

Die gleiche Kurzform funktioniert auch gegen den Anthropic-Messages-Endpunkt:

```bash
curl http://localhost:8888/v1/messages \
  -H "Authorization: Bearer sk-unsloth-xxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-local",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Suche nach Funktionen von Python 3.13"}],
    "stream": true,
    "enable_tools": true,
    "enabled_tools": ["web_search", "python"],
    "session_id": "my-session"
  }'
```

<figure><img src="https://797013937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FPpJxE60f2J59T5o85tQ1%2FScreenshot%202026-04-22%20at%204.28.43%E2%80%AFAM.png?alt=media&amp;token=870d74cb-dd8e-42c1-adeb-287807b22e16" alt=""><figcaption></figcaption></figure>

Unsloth streamt seine eigenen `tool_result` SSE-Ereignisse zusätzlich zu den standardmäßigen Anthropic-/OpenAI-Ereignistypen. Das Modell sieht die Ausgabe jedes Tools in seinem nächsten Durchlauf.

### ❔ Fehlerbehebung

**`401 Nicht autorisiert`** **-** Der `Authorization` Header fehlt oder der Schlüssel ist falsch. Überprüfe Folgendes: `Authorization: Bearer sk-unsloth-…`.

**`curl` hängt bei Streaming-Anfragen -** Füge `-N` (dasselbe wie `--no-buffer`). Ohne ihn `curl` puffert curl den SSE-Stream, und du siehst bis zum Ende nichts.

**Die Base64-Kodierung unterscheidet sich zwischen Betriebssystemen** **-** Linuxs `base64` bricht standardmäßig Zeilen um, macOS / BSD nicht. Verwende `base64 -w 0` unter Linux, `base64` unter macOS oder leite die Ausgabe durch `tr -d '\n'`.

**JSON-Escaping in Shells** **-** Heredocs (`-d @file.json`) sind sauberer als Inline-Strings, sobald der Body komplexer wird. Beispiel: `curl ... -d @body.json`.

**`max_tokens` Fehler bei `/v1/messages`** **-** Der Anthropic-Dialekt erfordert es. Füge `"max_tokens": 1024` (oder welches Limit du auch immer möchtest).

Bei Problemen auf Endpunktebene (Modell lädt nicht, Verbindung bricht ab, falscher Port) siehe die API-Übersichtsseite.

### Optional: Server-Standardwerte anpassen

Du kannst das Standardverhalten beim Starten des Servers mit `unsloth run`.

```bash
# Starte den Server mit benutzerdefinierten Standardwerten
unsloth run \\
  --model unsloth/Qwen3-1.7B-GGUF \\
  --reasoning off \\
  --temp 0.6 \\
  -p 8888
```

Verwende `--reasoning off` um das Denken auszuschalten, oder `--reasoning on` um es für Modelle zu aktivieren, die Reasoning unterstützen.

```bash
# Stelle die API in deinem lokalen Netzwerk bereit
unsloth run \\
  --model unsloth/Qwen3-1.7B-GGUF \\
  -H 0.0.0.0 \\
  -p 8888
```

Dies startet den Server auf `0.0.0.0:8888`, sodass andere Geräte in deinem lokalen Netzwerk eine Verbindung herstellen können.

#### Einstellungen pro Anfrage überschreiben

Du kannst die Generierungseinstellungen auch direkt in jeder API-Anfrage überschreiben.

```bash
curl http://localhost:8888/v1/chat/completions \
  -H "Authorization: Bearer $UNSLOTH_STUDIO_AUTH_TOKEN" \\
  -H "Content-Type: application/json" \
  -d '{
    "model": "default",
    "messages": [
      {
        "role": "user",
        "content": "Schreibe ein kurzes Gedicht über lokale KI."
      }
    ],
    "temperature": 0.8,
    "top_p": 0.9,
    "max_tokens": 512
  }'
```

Anfragebezogene Werte wie `Temperatur`, `top_p`, `max_tokens`, und `stream` überschreiben die Standardwerte des Servers für diese Anfrage.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://unsloth.ai/docs/de/integrationen/curl-and-http-mit-unsloth-verbinden.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
