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

# Messages-Antwort erstellen

> Anthropic-kompatibler Messages-Endpunkt.



## OpenAPI

````yaml /de/openapi.json post /v1/messages
openapi: 3.1.0
info:
  title: APIAny.AI Öffentliche API
  version: 1.0.0
  description: >-
    Öffentliche API von APIAny.AI für Modellaggregation, asynchrone
    Medienaufgaben, Chat-Generierung, Guthabenabfrage und Aufgabenabfrage.
servers:
  - url: https://apiany.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Models
    description: Öffentlicher Modellkatalog.
  - name: Chat
    description: Endpunkte für Textgenerierung und chatkompatible Funktionen.
  - name: Images
    description: Endpunkte für Bildgenerierung und Bildbearbeitung.
  - name: Videos
    description: Endpunkte für Videogenerierung.
  - name: Moderation
    description: Image safety and moderation endpoints.
  - name: Tasks
    description: Abfrage asynchroner Aufgaben.
  - name: Account
    description: Konto- und Guthabenabfrage.
  - name: Free APIs
    description: Free utility APIs protected by API key rate limits.
paths:
  /v1/messages:
    post:
      tags:
        - Chat
      summary: Messages-Antwort erstellen
      description: Anthropic-kompatibler Messages-Endpunkt.
      operationId: createMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnthropicMessagesRequest'
            examples:
              basic:
                value:
                  model: minimax-m3
                  max_tokens: 512
                  messages:
                    - role: user
                      content: Draft three API documentation section titles.
      responses:
        '200':
          description: Anthropic-kompatible Messages-Antwort.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnthropicMessagesResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    AnthropicMessagesRequest:
      type: object
      properties:
        model:
          type: string
          example: minimax-m3
        messages:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                enum:
                  - user
                  - assistant
              content:
                oneOf:
                  - type: string
                  - type: array
                    items:
                      type: object
                      additionalProperties: true
            required:
              - role
              - content
        max_tokens:
          type: integer
          minimum: 1
          description: Maximale Anzahl zu generierender Token (erforderlich).
        system:
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                additionalProperties: true
          description: System-Prompt.
        temperature:
          type: number
          minimum: 0
          maximum: 1
          description: Zufälligkeit (0–1).
        top_p:
          type: number
          minimum: 0
          maximum: 1
        top_k:
          type: integer
          description: Nur aus den K wahrscheinlichsten Kandidaten samplen.
        stop_sequences:
          type: array
          items:
            type: string
          description: Benutzerdefinierte Stoppsequenzen.
        tools:
          type: array
          description: >-
            Tools, die das Modell aufrufen kann; jedes enthält name, description
            und input_schema (JSON Schema).
          items:
            type: object
            additionalProperties: true
        tool_choice:
          type: object
          additionalProperties: true
          description: >-
            Tool-Auswahl: { type: 'auto' } | { type: 'any' } | { type: 'tool',
            name }.
        stream:
          type: boolean
          description: >-
            Bei true wird als Anthropic-SSE-Ereignisstrom zurückgegeben
            (message_start / content_block_delta / message_delta /
            message_stop).
      required:
        - model
        - messages
        - max_tokens
    AnthropicMessagesResponse:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          example: message
        role:
          type: string
          example: assistant
        content:
          type: array
          items:
            type: object
            additionalProperties: true
        model:
          type: string
        usage:
          $ref: '#/components/schemas/TokenUsage'
      required:
        - id
        - type
        - role
        - content
        - model
    TokenUsage:
      type: object
      properties:
        prompt_tokens:
          type: integer
        completion_tokens:
          type: integer
        total_tokens:
          type: integer
        input_tokens:
          type: integer
        output_tokens:
          type: integer
        cached_input_tokens:
          type: integer
      additionalProperties: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request
                - auth_error
                - rate_limit
                - insufficient_quota
                - content_policy
                - timeout
                - network_error
                - service_error
                - billable_error
                - unknown
            message:
              type: string
            param:
              type:
                - string
                - 'null'
            code:
              type:
                - string
                - 'null'
          required:
            - type
            - message
      required:
        - error
  responses:
    BadRequest:
      description: Ungültige Anfrageparameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Fehlender oder ungültiger API-Key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key

````