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

# Modelle für Assistant API

> Rufe alle verfügbaren Modelle für die Verwendung mit der Assistant-API ab.

<Warning>
  **Die Assistants API wird am 16. August eingestellt.**

  Für neue Systeme empfehlen wir die [Agents API](/de/developer/agents-api/agent-models). Die Agents API bietet native Vercel AI SDK Kompatibilität und entfernt benutzerdefinierte Transformationen.

  Siehe den [Migrations-Guide](/de/developer/assistants-api/assistant-to-agent-migration) für Details zu den Unterschieden.
</Warning>

Rufe die Liste der Modelle und ihre IDs ab, die für die Verwendung mit der Assistant-API verfügbar sind. Dieser Endpunkt ist nützlich, wenn du sehen möchtest, welche Modelle du bei der Erstellung eines temporären Assistenten verwenden kannst.

## Beispielanfrage

```javascript theme={null}
const axios = require("axios");

async function getAvailableModels() {
  try {
    const response = await axios.get("https://api.langdock.com/assistant/v1/models", {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
      },
    });

    console.log("Available models:", response.data.data);
  } catch (error) {
    console.error("Error fetching models:", error);
  }
}
```

## Antwortformat

Die API gibt eine Liste verfügbarer Modelle im folgenden Format zurück:

### Antwortfelder

<ResponseField name="object" type="string">
  Immer 'list', gibt den Typ des JSON-Objekts der obersten Ebene an.
</ResponseField>

<ResponseField name="data" type="array<Model>">
  Array mit verfügbaren Modell-Objekten.
</ResponseField>

<Accordion title="Modell-Objektfelder">
  <ResponseField name="id" type="string">
    Eindeutige Kennung des Modells (z.B. gpt-5).
  </ResponseField>

  <ResponseField name="object" type="string">
    Immer 'model', gibt den Objekttyp an.
  </ResponseField>

  <ResponseField name="created" type="integer">
    Unix-Zeitstempel (ms) wann das Modell erstellt wurde.
  </ResponseField>

  <ResponseField name="region" type="string">
    Region, in der das Modell verfügbar ist (z.B. "eu", "us", "global").
  </ResponseField>

  <ResponseField name="supportsExtendedThinking" type="boolean">
    Ob dieses Modell den Extended-Thinking-Modus unterstützt.
  </ResponseField>
</Accordion>

```json Beispielantwort theme={null}
{
  "object": "list",
  "data": [
    {
      "id": "gpt-5",
      "object": "model",
      "created": 1686935735000,
      "region": "eu",
      "supportsExtendedThinking": false
    }
    // …weitere Modelle
  ]
}
```

## Fehlerbehandlung

```javascript theme={null}
try {
  const response = await axios.get("https://api.langdock.com/assistant/v1/models", {
    headers: {
      Authorization: "Bearer YOUR_API_KEY",
    },
  });
} catch (error) {
  if (error.response) {
    switch (error.response.status) {
      case 400:
        console.error("Invalid request parameters");
        break;
      case 500:
        console.error("Internal server error");
        break;
    }
  }
}
```

Du kannst jede dieser Modell-IDs bei der Erstellung eines temporären Assistenten über die Assistant-API verwenden. Gib einfach die Modell-ID im `model` Feld deiner Assistenten-Konfiguration an:

<CodeGroup>
  ```javascript assistant.js theme={null}
  const response = await axios.post("https://api.langdock.com/assistant/v1/chat/completions", {
    assistant: {
      name: "Custom Assistant",
      instructions: "You are a helpful assistant",
      model: "gpt-5",
    },
    messages: [
      { role: "user", content: "Hallo!" },
    ],
  });
  ```

  ```bash assistant.sh theme={null}
  curl https://api.langdock.com/assistant/v1/chat/completions \
    -H "Authorization: Bearer $API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "assistant": {
        "name": "Custom Assistant",
        "instructions": "You are a helpful assistant",
        "model": "gpt-5"
      },
      "messages": [
        { "role": "user", "content": "Hallo!" }
      ]
    }'
  ```
</CodeGroup>

## Migration zur Agents API

Die neue Agents API bietet verbesserte Kompatibilität mit modernen AI SDKs. Der Models-Endpunkt hat identische Funktionalität.

Siehe den entsprechenden Endpunkt in der Agents API:

* [Agent Models API](/de/developer/agents-api/agent-models)

<Info>
  Langdock blockiert bewusst Browser-basierte Anfragen, um deinen API-Schlüssel zu schützen und die Sicherheit deiner Anwendungen zu gewährleisten. Weitere Informationen findest du in unserem Guide zu [Best Practices für API-Schlüssel](/de/admin/ai-adoption-and-rollout/best-practices/api-key-best-practices).
</Info>


## OpenAPI

````yaml GET /assistant/v1/models
openapi: 3.0.0
info:
  title: Langdock API
  version: 3.0.0
servers:
  - url: https://api.langdock.com
    description: Production
security:
  - bearerAuth: []
paths:
  /assistant/v1/models:
    get:
      tags:
        - Assistant
      summary: '[Deprecated] Lists the available models'
      description: >-
        This endpoint is deprecated. Please use /agent/v1/models for new
        integrations. Returns a list of models that are available for use with
        the API.
      parameters: []
      responses:
        '200':
          description: List of available models
          content:
            application/json:
              schema:
                type: object
                required:
                  - object
                  - data
                properties:
                  object:
                    type: string
                    enum:
                      - list
                  data:
                    type: array
                    items:
                      type: object
                      required:
                        - id
                        - object
                        - created
                        - owned_by
                      properties:
                        id:
                          type: string
                          description: The model identifier
                        object:
                          type: string
                          enum:
                            - model
                          description: The object type, which is always "model"
                        created:
                          type: integer
                          format: int64
                          description: >-
                            Unix timestamp (in milliseconds) of when the model
                            was created
                        owned_by:
                          type: string
                          enum:
                            - system
                          description: The organization that owns the model
              example:
                object: list
                data:
                  - id: gpt-5
                    object: model
                    created: 1686935735000
                    owned_by: system
                  - id: gpt-5-mini
                    object: model
                    created: 1686935735000
                    owned_by: system
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: array
                    items:
                      type: object
                      description: Validation error details
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Internal Server Error
      deprecated: true
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key as Bearer token. Format "Bearer YOUR_API_KEY"

````