> ## 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 K3.1 Pro / Highspeed - API compatible con OpenAI

> Llame a ambos modelos con el formato OpenAI Chat Completions, con respuestas JSON o streaming SSE. Conserve reasoning_content y tool_calls completos del assistant entre turnos.

Si la búsqueda web devuelve tool_calls, envíe function.arguments de cada llamada como contenido de un mensaje tool con el tool_call_id correspondiente y solicite la respuesta final.

> [!NOTE]
>
> **BaseURL**: La BaseURL predeterminada es `https://direct.evolink.ai`, que ofrece mejor compatibilidad con los modelos de texto y las conexiones de larga duración. `https://api.evolink.ai` es el endpoint principal para los servicios multimodales y sirve como dirección de respaldo para los modelos de texto.


## OpenAPI

````yaml es/api-manual/language-series/kimi-k3.1-pro/kimi-k3.1-pro-chat.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: Kimi K3.1 Pro / Highspeed - API compatible con OpenAI
  description: >-
    Llame a Kimi K3.1 Pro / Highspeed mediante OpenAI Chat Completions con
    `kimi-k3.1-pro` / `kimi-k3.1-pro-highspeed`. Ambos ofrecen un contexto de
    1.048.576 tokens y admiten conversaciones de varios turnos, streaming,
    herramientas, búsqueda web, salida estructurada y caché de contexto.


    El razonamiento siempre está activo. `reasoning_effort` admite `low` /
    `high` / `max`, con `max` como predeterminado. Conserve todo el historial de
    razonamiento y herramientas entre turnos.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: Producción (recomendado)
  - url: https://api.evolink.ai
    description: URL alternativa
security:
  - bearerAuth: []
tags:
  - name: Chat Completions
    description: API compatible con OpenAI Chat Completions
paths:
  /v1/chat/completions:
    post:
      tags:
        - Chat Completions
      summary: API de chat Kimi K3.1 Pro / Highspeed (compatible con OpenAI)
      description: >-
        Llame a ambos modelos con el formato OpenAI Chat Completions, con
        respuestas JSON o streaming SSE. Conserve reasoning_content y tool_calls
        completos del assistant entre turnos.


        Si la búsqueda web devuelve tool_calls, envíe function.arguments de cada
        llamada como contenido de un mensaje tool con el tool_call_id
        correspondiente y solicite la respuesta final.
      operationId: createChatCompletionKimiK31Pro
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              simple:
                summary: Solicitud mínima de Pro
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Reply with OK.
                  reasoning_effort: low
                  max_completion_tokens: 1024
              highspeed:
                summary: Solicitud mínima de Highspeed
                value:
                  model: kimi-k3.1-pro-highspeed
                  messages:
                    - role: user
                      content: Reply with OK.
                  reasoning_effort: low
                  max_completion_tokens: 1024
              streaming:
                summary: Streaming SSE
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Reply with OK.
                  reasoning_effort: low
                  max_completion_tokens: 1024
                  stream: true
              cache_1h:
                summary: Escritura automática en caché de 1h
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Reply with OK.
                  reasoning_effort: low
                  max_completion_tokens: 1024
                  prompt_cache_options:
                    mode: implicit
                    ttl: 1h
              web_search:
                summary: Búsqueda web (sintaxis unificada)
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Use web search to find the official Kimi homepage URL.
                  reasoning_effort: low
                  max_completion_tokens: 1024
                  tools:
                    - type: web_search
              structured_output:
                summary: JSON Schema estricto
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Return a JSON object with result equal to OK.
                  reasoning_effort: low
                  max_completion_tokens: 1024
                  response_format:
                    type: json_schema
                    json_schema:
                      name: result
                      strict: true
                      schema:
                        type: object
                        properties:
                          result:
                            type: string
                        required:
                          - result
                        additionalProperties: false
              function_calling:
                summary: Function Calling
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Consulta el tiempo de hoy en Pekín.
                  tools:
                    - type: function
                      function:
                        name: get_weather
                        description: Consulta el clima de una ciudad determinada
                        parameters:
                          type: object
                          properties:
                            city:
                              type: string
                              description: Nombre de la ciudad
                          required:
                            - city
                  tool_choice: auto
      responses:
        '200':
          description: >-
            Respuesta de chat completion; las solicitudes en streaming devuelven
            un flujo de eventos SSE
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
            text/event-stream:
              schema:
                type: string
                description: >-
                  Datos SSE en formato OpenAI Chat Completions, finalizados con
                  `data: [DONE]`.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          enum:
            - kimi-k3.1-pro
            - kimi-k3.1-pro-highspeed
          default: kimi-k3.1-pro
          description: >-
            Use `kimi-k3.1-pro` o `kimi-k3.1-pro-highspeed`; Highspeed genera
            más rápido.
        messages:
          type: array
          minItems: 1
          description: >-
            Mensajes de la conversación. En conversaciones de varios turnos,
            incluye los mensajes históricos completos del assistant.
          items:
            $ref: '#/components/schemas/ChatMessage'
        max_completion_tokens:
          type: integer
          minimum: 1
          maximum: 1048576
          default: 131072
          description: >-
            Máximo de tokens generados, incluidos el razonamiento y la respuesta
            final. Valor predeterminado: 131072; máximo: 1048576, limitado
            también por el contexto restante.
        reasoning_effort:
          type: string
          enum:
            - low
            - high
            - max
            - medium
            - xhigh
            - minimal
            - none
          default: max
          description: >-
            Esfuerzo de razonamiento: se recomienda low / high / max;
            predeterminado: max. El razonamiento siempre está activo. Alias:
            medium se convierte en high, xhigh en max y minimal / none en low.
            none no desactiva el razonamiento. Un mayor esfuerzo suele aumentar
            los tokens de razonamiento y la latencia. Estos tokens cuentan como
            salida.
        stream:
          type: boolean
          default: false
          description: Indica si la respuesta se devuelve como flujo SSE.
        tools:
          type: array
          maxItems: 128
          description: >-
            Herramientas de función o búsqueda web. Declare la búsqueda con
            {"type":"web_search"}.
          items:
            oneOf:
              - $ref: '#/components/schemas/FunctionTool'
              - $ref: '#/components/schemas/WebSearchTool'
        tool_choice:
          oneOf:
            - type: string
              enum:
                - auto
                - none
                - required
            - $ref: '#/components/schemas/NamedToolChoice'
          description: >-
            Controla si el modelo llama a herramientas o fuerza una función
            concreta.
        prompt_cache_options:
          type: object
          description: >-
            Opciones de escritura en la caché de contexto. Si se omite, se
            escribe automáticamente en la caché de 5m. Las escrituras y lecturas
            se facturan por separado.
          properties:
            mode:
              type: string
              enum:
                - implicit
              default: implicit
            ttl:
              type: string
              enum:
                - 5m
                - 1h
              default: 5m
              description: 'TTL de caché: 5m o 1h; predeterminado: 5m.'
        response_format:
          type: object
          description: >-
            Formato de salida: text para texto plano, json_object para un objeto
            JSON o json_schema para salida estructurada conforme a un JSON
            Schema.
          properties:
            type:
              type: string
              enum:
                - text
                - json_object
                - json_schema
              description: >-
                Formato: text (predeterminado), texto plano; json_object, objeto
                JSON válido; json_schema, salida conforme al esquema
                (recomendado; proporcione json_schema).
            json_schema:
              type: object
              description: >-
                JSON Schema que debe cumplir la salida cuando type es
                json_schema.
              properties:
                name:
                  type: string
                  description: Nombre del esquema usado como identificador.
                strict:
                  type: boolean
                  default: true
                  description: >-
                    Si se debe cumplir estrictamente el JSON Schema indicado;
                    predeterminado: true.
                schema:
                  type: object
                  description: JSON Schema que define la estructura de salida.
                  additionalProperties: true
              required:
                - name
                - schema
        max_tokens:
          type: integer
          minimum: 1
          maximum: 1048576
          deprecated: true
          description: >-
            Alias antiguo del límite de salida. Use max_completion_tokens en
            nuevas solicitudes y evite configurar ambos.
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          example: chat.completion
        created:
          type: integer
        model:
          type: string
          example: kimi-k3.1-pro
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                $ref: '#/components/schemas/ChatMessage'
              finish_reason:
                type: string
                enum:
                  - stop
                  - length
                  - tool_calls
        usage:
          $ref: '#/components/schemas/ChatUsage'
    ChatMessage:
      type: object
      required:
        - role
      properties:
        role:
          type: string
          description: 'Rol del mensaje: system, user, assistant o tool.'
          enum:
            - system
            - user
            - assistant
            - tool
        content:
          description: >-
            Contenido del mensaje. Usa una cadena para texto plano; usa un array
            de bloques de contenido para entrada multimodal (texto + imagen +
            video). En escenarios de llamada de herramientas, el content del
            assistant puede ser null.
          oneOf:
            - type: string
              description: Contenido de mensaje de texto plano.
            - type: array
              description: Array de bloques de contenido multimodal.
              items:
                $ref: '#/components/schemas/ContentPart'
            - type: 'null'
        reasoning_content:
          type: string
          description: >-
            Contenido de razonamiento del assistant. Devuélvelo sin cambios como
            parte del mensaje completo del assistant en conversaciones de varios
            turnos.
        tool_calls:
          type: array
          description: >-
            Llamadas de herramienta devueltas por el assistant. Devuélvelas sin
            cambios en turnos posteriores.
          items:
            $ref: '#/components/schemas/ToolCall'
        tool_call_id:
          type: string
          description: ID de la llamada de herramienta correspondiente cuando `role=tool`.
    FunctionTool:
      type: object
      required:
        - type
        - function
      properties:
        type:
          type: string
          description: Tipo de herramienta. Actualmente fijado en function.
          enum:
            - function
        function:
          type: object
          description: Definición de función disponible para el modelo.
          required:
            - name
            - parameters
          properties:
            name:
              type: string
              description: Nombre de la función.
            description:
              type: string
              description: >-
                Descripción que ayuda al modelo a decidir cuándo llamar a la
                función.
            parameters:
              type: object
              additionalProperties: true
              description: Definición de parámetros de la función en formato JSON Schema.
            strict:
              type: boolean
              description: >-
                Indica si los argumentos deben seguir estrictamente el JSON
                Schema de parameters.
    WebSearchTool:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - web_search
          description: Herramienta de búsqueda web.
    NamedToolChoice:
      type: object
      required:
        - type
        - function
      properties:
        type:
          type: string
          description: 'Tipo de selección de herramienta con nombre. Valor fijo: function.'
          enum:
            - function
        function:
          type: object
          description: Función que el modelo debe llamar.
          required:
            - name
          properties:
            name:
              type: string
              description: Nombre de la función que el modelo debe llamar.
    ChatUsage:
      type: object
      properties:
        prompt_tokens:
          type: integer
          description: >-
            Tokens totales de entrada, incluidas entrada normal, lecturas y
            escrituras de caché. Entrada normal = prompt_tokens - cached_tokens
            - cache_write_tokens.
        completion_tokens:
          type: integer
          description: Incluye tokens de razonamiento.
        total_tokens:
          type: integer
          description: Total de tokens de entrada y salida.
        prompt_tokens_details:
          type: object
          properties:
            cached_tokens:
              type: integer
              description: Tokens de entrada servidos desde caché.
            cache_write_tokens:
              type: integer
              minimum: 0
              description: >-
                Tokens totales escritos en caché, incluidas las escrituras de 5m
                / 1h. No cobrarlos de nuevo como entrada normal.
        completion_tokens_details:
          type: object
          properties:
            reasoning_tokens:
              type: integer
              description: Tokens de razonamiento, ya incluidos en completion_tokens.
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type:
                - string
                - 'null'
    ContentPart:
      description: Bloque de contenido multimodal. `type` determina qué campo se usa.
      oneOf:
        - type: object
          required:
            - type
            - text
          properties:
            type:
              type: string
              enum:
                - text
            text:
              type: string
              description: Contenido de texto cuando `type=text`.
        - type: object
          required:
            - type
            - image_url
          properties:
            type:
              type: string
              enum:
                - image_url
            image_url:
              description: >-
                Imagen cuando `type=image_url`; también puedes pasar
                directamente una cadena de URL.
              oneOf:
                - type: string
                - type: object
                  required:
                    - url
                  properties:
                    url:
                      type: string
                      description: >-
                        Contenido de imagen como URL data Base64
                        (data:image/png;base64,...).
        - type: object
          required:
            - type
            - video_url
          properties:
            type:
              type: string
              enum:
                - video_url
            video_url:
              description: >-
                Video cuando `type=video_url`; también puedes pasar directamente
                una cadena de URL.
              oneOf:
                - type: string
                - type: object
                  required:
                    - url
                  properties:
                    url:
                      type: string
                      description: >-
                        Contenido de video como URL data Base64
                        (data:video/mp4;base64,...).
    ToolCall:
      type: object
      required:
        - id
        - type
        - function
      properties:
        id:
          type: string
          description: >-
            ID de llamada de herramienta usado para asociar un mensaje tool
            posterior mediante tool_call_id.
        type:
          type: string
          description: >-
            Tipo de llamada a herramienta: `function` para funciones del
            cliente; `builtin_function` para la herramienta integrada
            `$web_search`.
          enum:
            - function
            - builtin_function
        function:
          type: object
          description: Función y argumentos solicitados por el modelo.
          properties:
            name:
              type: string
              description: Nombre de la función.
            arguments:
              type: string
              description: Argumentos de la función codificados como cadena JSON.
      description: >-
        Conserve las llamadas completas entre turnos: ID, tipos, nombres de
        función, argumentos y razonamiento.
  responses:
    BadRequest:
      description: Parámetros de solicitud inválidos
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: La API Key no existe o no es válida
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Límite de solicitudes superado o cuota insuficiente
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Error interno del servicio
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        ##Todas las interfaces requieren autenticación mediante Bearer Token##


        **Obtención de la API Key**:


        Visita la [página de gestión de API
        Key](https://evolink.ai/dashboard/keys) para obtener tu API Key


        **Al usarla, añádela en la cabecera de la solicitud**:

        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````

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