> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fastino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use https://docs.fastino.ai/llms.txt to discover and navigate pages. Use https://docs.fastino.ai/llms-full.txt when you need the complete documentation corpus. Use https://docs.fastino.ai/openapi.json as the source of truth for customer-facing routes. For GLiDE decision inference, call POST https://api.fastino.ai/v1/systemone with model fastino/GLiDE. Do not infer undocumented routes. Read API keys from FASTINO_API_KEY and never embed credentials in code, logs, or reports.

# Anthropic-kompatibles POST /v1/messages in der Fastino API

> Führen Sie strukturierte GLiNER-Extraktion und -Klassifikation über die Messages API des Anthropic SDK aus.

Fastino implementiert einen Anthropic-kompatiblen Messages-Endpunkt, über den Sie GLiNER-Modelle mit dem Anthropic SDK ausführen können. Setzen Sie `base_url` auf `https://api.fastino.ai`, authentifizieren Sie sich mit Ihrem Fastino-API-Schlüssel und verwenden Sie eine GLiNER-Modell-ID aus `GET /v1/models` oder Ihre GLiNER-Trainingsjob-ID. Das Anthropic SDK hängt `/v1/messages` selbst an.

## Unterstützte SDK-Oberfläche

| Anthropic-SDK-Methode | Fastino-Endpunkt | GLiNER-Ergebnis |
| - | - | - |
| `client.messages.create(...)` | `POST /v1/messages` | Strukturiertes JSON in `message.content[0].text` |

<Warning>
  GLiNER-Inferenz gibt ein einzelnes strukturiertes Ergebnis zurück und unterstützt weder `stream=True` noch `client.messages.stream(...)`. Fastino implementiert nicht jede Anthropic-API oder SDK-Ressource.
</Warning>

## Das Anthropic SDK konfigurieren

Übergeben Sie beim Erstellen des Clients Ihren Fastino-API-Schlüssel und die Basis-URL:

<CodeGroup>
  ```python Python theme={null}
  import anthropic

  client = anthropic.Anthropic(
      api_key="YOUR_API_KEY",
      base_url="https://api.fastino.ai"
  )
  ```
</CodeGroup>

## Eine Nachricht erstellen

`POST /v1/messages` akzeptiert die zentralen Anthropic-Messages-Felder. Setzen Sie `model` auf eine unterstützte GLiNER-Modell-ID, fügen Sie `messages` hinzu und übergeben Sie das `schema` über `extra_body`.

### Anfrageparameter

<ParamField body="model" type="string" required>
  Trainingsjob-ID (z. B. `job_abc123`) oder eine Basismodell-ID. Dies ist das Modell, das Ihre Anfrage verarbeitet.
</ParamField>

<ParamField body="max_tokens" type="number" required>
  Dieses Feld ist für die Anfragekompatibilität mit dem Anthropic SDK erforderlich. GLiNER gibt strukturierte Daten statt generierter Tokens zurück.
</ParamField>

<ParamField body="messages" type="object[]" required>
  Nachrichten der Konversation. Jedes Objekt hat eine `role` (`"user"` oder `"assistant"`) und einen `content`-String.
</ParamField>

<ParamField body="schema" type="object">
  Fastino-spezifisches Extraktionsschema. Definieren Sie `entities`, `classifications`, `structures` oder `relations`, um festzulegen, was das Modell extrahiert. Die vollständige Schema-Dokumentation finden Sie unter [Fastino-Inferenz](/de/api-reference/inference/pioneer).
</ParamField>

### Beispiele

<CodeGroup>
  ```python Python (Anthropic SDK) theme={null}
  import anthropic

  client = anthropic.Anthropic(
      api_key="YOUR_API_KEY",
      base_url="https://api.fastino.ai"
  )

  message = client.messages.create(
      model="YOUR_TRAINING_JOB_ID",
      max_tokens=1024,
      messages=[
          {
              "role": "user",
              "content": "Extract entities from: Apple launched the iPhone."
          }
      ],
      extra_body={
          "schema": {
              "entities": ["organization", "product"]
          }
      }
  )

  print(message.content[0].text)
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.fastino.ai/v1/messages \
    -H "X-API-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "YOUR_TRAINING_JOB_ID",
      "max_tokens": 1024,
      "messages": [
        {
          "role": "user",
          "content": "Extract entities from: Apple launched the iPhone."
        }
      ],
      "schema": {
        "entities": ["organization", "product"]
      }
    }'
  ```
</CodeGroup>

## Streaming

GLiNER-Inferenz unterstützt kein Streaming. Verwenden Sie `client.messages.create(...)` ohne `stream=True`; die API gibt das vollständige strukturierte Ergebnis zurück.

## Verwandte Themen

* [Native Fastino-Inferenz](/de/api-reference/inference/pioneer) - direkter Fastino-Endpunkt mit vollständiger Schema-Dokumentation
* [OpenAI-kompatible Inferenz](/de/api-reference/inference/openai-compatible) - verwenden Sie stattdessen das OpenAI SDK
* [Inferenzverlauf und Feedback](/de/api-reference/inference/history) - frühere Ergebnisse abrufen und Korrekturen einreichen


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.