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

# Kimi API (alle Modelle) - Messages: Vollständige Referenz

> Öffentlicher Endpunkt: POST /v1/messages. Reasoning-Aufwand mit output_config.effort einstellen. cache_control auf oberster Ebene steuert 5m/1h-Cache-Schreibvorgänge (nur K3.1-Serie). Alle thinking-, signature-, tool_use- und serverseitigen Suchergebnisblöcke vollständig beibehalten.

> [!NOTE]
>
> **BaseURL**: Die Standard-BaseURL ist `https://direct.evolink.ai`, die Textmodelle und langlebige Verbindungen besser unterstützt. `https://api.evolink.ai` ist der primäre Endpunkt für multimodale Dienste und dient als Ausweichadresse für Textmodelle.


## OpenAPI

````yaml de/api-manual/language-series/kimi/messages/messages-reference.json POST /v1/messages
openapi: 3.1.0
info:
  title: 'Kimi API (alle Modelle) - Messages: Vollständige Referenz'
  description: >-
    Kimi-Textmodelle über das Protokoll Anthropic Messages aufrufen. Mit `model`
    wählen Sie `kimi-k3.1-pro`, `kimi-k3.1-pro-highspeed` oder `kimi-k3`. Alle
    haben ein Kontextfenster von 1.048.576 Tokens und unterstützen mehrstufige
    Gespräche, Streaming, Tool-Aufrufe, Websuche und Bildeingaben.


    Reasoning ist bei allen drei Modellen immer aktiv; die Intensität wird mit
    `output_config.effort` eingestellt. Strukturierte Ausgabe, Stoppsequenzen
    und Cache-Schreib-TTL sind nur in der K3.1-Serie verfügbar; siehe Feld
    `model`. In mehrstufigen Gesprächen alle assistant-Inhaltsblöcke
    einschließlich thinking, signature und tool_use unverändert zurücksenden.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: Produktion (Empfohlen)
  - url: https://api.evolink.ai
    description: Alternative URL
security:
  - bearerAuth: []
tags:
  - name: Messages
    description: Anthropic-Messages-kompatible API
paths:
  /v1/messages:
    post:
      tags:
        - Messages
      summary: Kimi Messages API (alle Modelle, Anthropic-kompatibel)
      description: >-
        Öffentlicher Endpunkt: POST /v1/messages. Reasoning-Aufwand mit
        output_config.effort einstellen. cache_control auf oberster Ebene
        steuert 5m/1h-Cache-Schreibvorgänge (nur K3.1-Serie). Alle thinking-,
        signature-, tool_use- und serverseitigen Suchergebnisblöcke vollständig
        beibehalten.
      operationId: createMessageKimi
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMessageRequest'
            examples:
              simple:
                summary: Minimale Pro-Anfrage
                value:
                  model: kimi-k3.1-pro
                  max_tokens: 1024
                  output_config:
                    effort: low
                  messages:
                    - role: user
                      content: Reply with OK.
              highspeed:
                summary: Minimale Highspeed-Anfrage
                value:
                  model: kimi-k3.1-pro-highspeed
                  max_tokens: 1024
                  output_config:
                    effort: low
                  messages:
                    - role: user
                      content: Reply with OK.
              k3:
                summary: Minimale Kimi-K3-Anfrage
                value:
                  model: kimi-k3
                  max_tokens: 1024
                  messages:
                    - role: user
                      content: Reply with OK.
              system_prompt:
                summary: System-Prompt
                value:
                  model: kimi-k3.1-pro
                  max_tokens: 2048
                  output_config:
                    effort: low
                  system: Du bist ein präziser technischer Redakteur.
                  messages:
                    - role: user
                      content: Erkläre Kontext-Caching.
              streaming:
                summary: Anthropic-SSE-Streaming
                value:
                  model: kimi-k3.1-pro
                  max_tokens: 1024
                  output_config:
                    effort: low
                  messages:
                    - role: user
                      content: Reply with OK.
                  stream: true
              multimodal:
                summary: Bildeingabe
                value:
                  model: kimi-k3.1-pro
                  max_tokens: 1024
                  output_config:
                    effort: low
                  messages:
                    - role: user
                      content:
                        - type: image
                          source:
                            type: base64
                            media_type: image/jpeg
                            data: /9j/4AAQSkZJRgABAQAA...
                        - type: text
                          text: Beschreibe dieses Bild.
              tool_use:
                summary: Werkzeugaufruf
                value:
                  model: kimi-k3.1-pro
                  max_tokens: 2048
                  output_config:
                    effort: low
                  messages:
                    - role: user
                      content: Prüfe das heutige Wetter in Peking.
                  tools:
                    - name: get_weather
                      description: Wetter für eine angegebene Stadt abrufen
                      input_schema:
                        type: object
                        properties:
                          city:
                            type: string
                            description: Stadtname
                        required:
                          - city
                  tool_choice:
                    type: auto
              web_search:
                summary: Serverseitige Websuche
                value:
                  model: kimi-k3.1-pro
                  max_tokens: 1024
                  output_config:
                    effort: low
                  messages:
                    - role: user
                      content: Use web search to find the official Kimi homepage URL.
                  tools:
                    - type: web_search_20250305
                      name: web_search
                      max_uses: 1
              structured_output:
                summary: Strukturierte Ausgabe mit striktem Schema (nur K3.1-Serie)
                value:
                  model: kimi-k3.1-pro
                  max_tokens: 1024
                  output_config:
                    effort: low
                    format:
                      type: json_schema
                      schema:
                        type: object
                        properties:
                          result:
                            type: string
                        required:
                          - result
                        additionalProperties: false
                  messages:
                    - role: user
                      content: Return a JSON object with result equal to OK.
              cache_1h:
                summary: 1h-Cache auf oberster Ebene (nur K3.1-Serie)
                value:
                  model: kimi-k3.1-pro
                  max_tokens: 1024
                  output_config:
                    effort: low
                  messages:
                    - role: user
                      content: Reply with OK.
                  cache_control:
                    type: ephemeral
                    ttl: 1h
      responses:
        '200':
          description: >-
            Message-Antwort; Streaming-Anfragen liefern einen
            Anthropic-SSE-Ereignisstrom
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
            text/event-stream:
              schema:
                type: string
                description: >-
                  Die Ereignisfolge umfasst normalerweise message_start,
                  content_block_*, message_delta und message_stop.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    CreateMessageRequest:
      type: object
      required:
        - model
        - max_tokens
        - messages
      properties:
        model:
          type: string
          enum:
            - kimi-k3.1-pro
            - kimi-k3.1-pro-highspeed
            - kimi-k3
          default: kimi-k3.1-pro
          description: >-
            Aufzurufendes Modell:


            | Modell-ID | Einordnung | Reasoning-Aufwand |

            |---|---|---|

            | `kimi-k3.1-pro` | Neueste Modellgeneration (empfohlen) | `low` /
            `high` / `max`, Standard `max` |

            | `kimi-k3.1-pro-highspeed` | Gleiche Parameter wie Pro, schnellere
            Generierung | Wie `kimi-k3.1-pro` |

            | `kimi-k3` | Vorherige Modellgeneration | Nur `max` |


            Alle drei Modelle haben ein Kontextfenster von 1.048.576 Tokens und
            immer aktives Reasoning.


            Strukturierte Ausgabe (`output_config.format`), Stoppsequenzen
            (`stop_sequences`) und Cache-Schreib-TTL (`cache_control`) werden
            nur von der K3.1-Serie unterstützt, nicht von `kimi-k3`. Antworten
            von `kimi-k3` können nur `text`-Blöcke ohne `thinking`-Blöcke
            enthalten.
        max_tokens:
          type: integer
          minimum: 1
          description: >-
            Maximale Anzahl der Token für diese Generierung einschließlich
            thinking und finalem Text.
          maximum: 1048576
        messages:
          type: array
          minItems: 1
          description: >-
            Anthropic-Messages-Nachrichtenliste. Bei mehrstufigen Gesprächen
            müssen vollständige Assistant-Inhaltsblöcke unverändert
            zurückgesendet werden.
          items:
            $ref: '#/components/schemas/Message'
        system:
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/MessagesTextBlockParam'
          description: System-Prompt als Zeichenfolge oder Array von text-Blöcken.
        stream:
          type: boolean
          default: false
          description: Ob ein Anthropic-SSE-Ereignisstrom zurückgegeben wird.
        tools:
          type: array
          description: >-
            Eigene Funktionen oder serverseitige Websuche. Integrierte Suche
            nutzt type=web_search_20250305 und name=web_search; Abrechnung pro
            tatsächlichem Aufruf.
          items:
            oneOf:
              - $ref: '#/components/schemas/Tool'
              - $ref: '#/components/schemas/WebSearchTool'
        tool_choice:
          $ref: '#/components/schemas/ToolChoice'
        stop_sequences:
          type: array
          items:
            type: string
          maxItems: 5
          description: >-
            Stoppsequenzen. Bei exakter Übereinstimmung endet die Ausgabe; die
            gefundene Sequenz selbst wird nicht ausgegeben. Höchstens 5
            Sequenzen mit jeweils maximal 32 Bytes. Bei einem Treffer ist
            `stop_reason` gleich `end_turn` und `stop_sequence` gleich `null`.


            Nur von `kimi-k3.1-pro` / `kimi-k3.1-pro-highspeed` unterstützt;
            `kimi-k3` unterstützt diesen Parameter nicht.
        cache_control:
          type: object
          description: >-
            Cache-Schreiboptionen auf oberster Ebene, nur von `kimi-k3.1-pro` /
            `kimi-k3.1-pro-highspeed` unterstützt; `kimi-k3` unterstützt diesen
            Parameter nicht. Nur cache_control auf oberster Ebene steuert die
            Schreib-TTL; Cache-Markierungen in Nachrichtenblöcken ersetzen
            dieses Feld nicht. Standard bei Auslassung: 5m.
          properties:
            type:
              type: string
              enum:
                - ephemeral
              description: Cache-Typ, fest ephemeral.
            ttl:
              type: string
              enum:
                - 5m
                - 1h
              default: 5m
              description: 'Cache-TTL: 5m oder 1h; Standard: 5m.'
          required:
            - type
        output_config:
          type: object
          description: 'Ausgabekonfiguration: Denkaufwand und strukturierte Ausgabe.'
          properties:
            effort:
              type: string
              enum:
                - low
                - high
                - max
                - medium
                - xhigh
                - minimal
                - none
              default: max
              description: >-
                Reasoning-Aufwand. Reasoning bleibt auch bei `thinking.type:
                "disabled"` aktiv.


                - `kimi-k3.1-pro` / `kimi-k3.1-pro-highspeed`: Empfohlen sind
                `low` / `high` / `max`, Standard `max`. Für allgemeine Clients
                wird `medium` wie `high`, `xhigh` wie `max` und `minimal` /
                `none` wie `low` behandelt; `none` deaktiviert Reasoning nicht.

                - `kimi-k3`: Nur `max` wird unterstützt (Standard).


                Höherer Aufwand erhöht meist Reasoning-Tokens und Latenz.
                Reasoning-Tokens zählen zur Ausgabe.
            format:
              type: object
              description: >-
                Strukturierte Ausgabe: Das Modell gibt JSON zurück, das strikt
                dem angegebenen JSON Schema folgt. Nur von `kimi-k3.1-pro` /
                `kimi-k3.1-pro-highspeed` unterstützt, nicht von `kimi-k3`. Für
                strukturierte Ausgaben mit `kimi-k3` verwenden Sie
                `response_format` der Chat Completions API.
              properties:
                type:
                  type: string
                  enum:
                    - json_schema
                schema:
                  type: object
                  description: JSON Schema, dem die Ausgabe entsprechen muss.
                  additionalProperties: true
              required:
                - type
                - schema
        temperature:
          type: number
          default: 1
          description: >-
            Sampling-Temperatur, vom Modell fest auf `1` gesetzt; das Feld muss
            nicht angegeben werden. `kimi-k3.1-pro` / `kimi-k3.1-pro-highspeed`
            ignorieren es automatisch; `kimi-k3` gibt bei nicht unterstützten
            Werten einen Fehler zurück.
        top_p:
          type: number
          default: 0.95
          description: >-
            Nucleus-Sampling-Schwelle, vom Modell fest auf `0.95` gesetzt; das
            Feld muss nicht angegeben werden. `kimi-k3.1-pro` /
            `kimi-k3.1-pro-highspeed` ignorieren es automatisch; `kimi-k3` gibt
            bei nicht unterstützten Werten einen Fehler zurück.
    MessageResponse:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - message
        role:
          type: string
          enum:
            - assistant
        model:
          type: string
          example: kimi-k3.1-pro
        content:
          type: array
          items:
            $ref: '#/components/schemas/ContentBlock'
        stop_reason:
          type:
            - string
            - 'null'
          enum:
            - end_turn
            - max_tokens
            - tool_use
            - refusal
            - null
        stop_sequence:
          type:
            - string
            - 'null'
        usage:
          $ref: '#/components/schemas/MessageUsage'
    Message:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          description: Nachrichtenrolle. Unterstützt werden nur user und assistant.
          enum:
            - user
            - assistant
        content:
          description: >-
            Nachrichteninhalt als Klartext oder als Array von
            Anthropic-Inhaltsblöcken.
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/ContentBlock'
    MessagesTextBlockParam:
      type: object
      properties:
        type:
          type: string
          enum:
            - text
        text:
          type: string
      required:
        - type
        - text
    Tool:
      type: object
      required:
        - name
        - input_schema
      properties:
        name:
          type: string
          description: Werkzeugname.
        description:
          type: string
          description: >-
            Beschreibung, anhand derer das Modell entscheidet, wann das Werkzeug
            verwendet wird.
        input_schema:
          type: object
          additionalProperties: true
          description: Definition der Werkzeugparameter im JSON-Schema-Format.
    WebSearchTool:
      type: object
      required:
        - type
        - name
      properties:
        type:
          type: string
          enum:
            - web_search_20250305
        name:
          type: string
          enum:
            - web_search
        max_uses:
          type: integer
          minimum: 1
          description: Maximal zulässige Suchvorgänge für diese Antwort.
    ToolChoice:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: >-
            Werkzeugwahl: auto überlässt dem Modell die Entscheidung, any
            erzwingt einen Werkzeugaufruf und none deaktiviert Werkzeugaufrufe.
          enum:
            - auto
            - any
            - none
          default: auto
    ContentBlock:
      description: >-
        Anthropic-Inhaltsblock für Text, Bilder, Schlussfolgerungen,
        Werkzeugaufrufe oder Werkzeugergebnisse.
      oneOf:
        - $ref: '#/components/schemas/TextBlock'
        - $ref: '#/components/schemas/ImageBlock'
        - $ref: '#/components/schemas/ThinkingBlock'
        - $ref: '#/components/schemas/ToolUseBlock'
        - $ref: '#/components/schemas/ToolResultBlock'
        - $ref: '#/components/schemas/ServerToolUseBlock'
        - $ref: '#/components/schemas/WebSearchResultBlock'
    MessageUsage:
      type: object
      properties:
        input_tokens:
          type: integer
          description: >-
            Normale Eingabe-Token ohne Cache-Lesen und Cache-Schreiben. Die drei
            Eingabekategorien überschneiden sich nicht; Cache-Token nicht erneut
            abziehen.
        cache_creation_input_tokens:
          type: integer
          description: In den Cache geschriebene Eingabe-Token.
        cache_read_input_tokens:
          type: integer
          description: Aus dem Cache gelieferte Eingabe-Token.
        output_tokens:
          type: integer
          description: Ausgabe-Token einschließlich thinking-Token.
        output_tokens_details:
          type: object
          properties:
            thinking_tokens:
              type: integer
        cache_creation:
          type: object
          properties:
            ephemeral_5m_input_tokens:
              type: integer
              minimum: 0
            ephemeral_1h_input_tokens:
              type: integer
              minimum: 0
          description: >-
            Die beiden Cache-Schreibstufen innerhalb von
            cache_creation_input_tokens. Die K3.1-Serie berechnet jede Stufe
            nach ihrer tatsächlichen TTL.
        server_tool_use:
          type: object
          properties:
            web_search_requests:
              type: integer
              minimum: 0
          description: Suchnutzung dieser Antwort.
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - error
        error:
          type: object
          properties:
            type:
              type: string
            message:
              type: string
        request_id:
          type: string
    TextBlock:
      type: object
      required:
        - type
        - text
      properties:
        type:
          type: string
          description: Inhaltsblocktyp. Fest auf text eingestellt.
          enum:
            - text
        text:
          type: string
          description: Textinhalt.
    ImageBlock:
      type: object
      required:
        - type
        - source
      description: Bildinhaltsblock (multimodale Eingabe).
      properties:
        type:
          type: string
          enum:
            - image
          description: Inhaltsblocktyp. Fest auf image eingestellt.
        source:
          type: object
          required:
            - type
          description: Bildquelle.
          properties:
            type:
              type: string
              enum:
                - base64
                - url
              description: >-
                Bildquelle: base64 für eingebettete Daten, url für einen
                Dateiverweis.
            media_type:
              type: string
              enum:
                - image/jpeg
                - image/png
                - image/gif
                - image/webp
              description: Bild-MIME-Typ, wenn `type=base64`.
            data:
              type: string
              description: Base64-Bilddaten, wenn `type=base64` (ohne `data:`-Präfix).
            url:
              type: string
              description: Bilddateiverweis, nur bei type=url.
    ThinkingBlock:
      type: object
      required:
        - type
        - thinking
      properties:
        type:
          type: string
          description: Inhaltsblocktyp. Fest auf thinking eingestellt.
          enum:
            - thinking
        thinking:
          type: string
          description: >-
            Schlussfolgerungsinhalt des Modells. Bei mehrstufigen Gesprächen
            unverändert zusammen mit der Signatur zurücksenden.
        signature:
          type: string
          description: >-
            Bei mehrstufigen Gesprächen unverändert zusammen mit dem
            thinking-Block zurücksenden.
    ToolUseBlock:
      type: object
      required:
        - type
        - id
        - name
        - input
      properties:
        type:
          type: string
          description: Inhaltsblocktyp. Fest auf tool_use eingestellt.
          enum:
            - tool_use
        id:
          type: string
          description: >-
            tool_use-ID, die beim Zurücksenden des Ergebnisses referenziert
            wird.
        name:
          type: string
          description: Name des vom Modell angeforderten Werkzeugs.
        input:
          type: object
          additionalProperties: true
          description: Vom Modell erzeugtes Eingabeobjekt für das Werkzeug.
    ToolResultBlock:
      type: object
      required:
        - type
        - tool_use_id
        - content
      properties:
        type:
          type: string
          description: Inhaltsblocktyp. Fest auf tool_result eingestellt.
          enum:
            - tool_result
        tool_use_id:
          type: string
          description: ID des zugehörigen tool_use-Inhaltsblocks.
        content:
          description: >-
            Werkzeugergebnis als Zeichenfolge oder Array von Text- und
            Bildblöcken.
          oneOf:
            - type: string
            - type: array
              items:
                oneOf:
                  - $ref: '#/components/schemas/TextBlock'
                  - $ref: '#/components/schemas/ImageBlock'
        is_error:
          type: boolean
          default: false
          description: Ob die Werkzeugausführung fehlgeschlagen ist.
    ServerToolUseBlock:
      type: object
      required:
        - type
        - id
        - name
        - input
      properties:
        type:
          type: string
          enum:
            - server_tool_use
        id:
          type: string
        name:
          type: string
        input:
          type: object
          additionalProperties: true
    WebSearchResultBlock:
      type: object
      required:
        - type
        - tool_use_id
        - content
      properties:
        type:
          type: string
          enum:
            - web_search_tool_result
        tool_use_id:
          type: string
        content:
          oneOf:
            - type: array
              items:
                type: object
                additionalProperties: true
            - type: object
              additionalProperties: true
              description: Suchfehlerobjekt mit type=web_search_tool_result_error.
  responses:
    BadRequest:
      description: Ungültige Anfrageparameter
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: API-Schlüssel fehlt oder ist ungültig
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Ratenlimit überschritten oder Kontingent nicht ausreichend
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Interner Dienstfehler
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        ##Alle APIs erfordern eine Bearer-Token-Authentifizierung##


        **API-Schlüssel abrufen:**


        Besuchen Sie die
        [API-Schlüsselverwaltung](https://evolink.ai/dashboard/keys), um Ihren
        API-Schlüssel abzurufen


        **Zum Anfrage-Header hinzufügen:**

        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````

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