Mistral AI Models API

The Mistral AI Models API provides endpoints for listing and retrieving information about available models on the Mistral platform. Developers can query which models are accessible, inspect model capabilities and metadata, and manage fine-tuned model deployments. This API serves as the foundation for model discovery and lifecycle management within the Mistral ecosystem.

OpenAPI Specification

mistral-ai-models-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Mistral AI Models API
  description: >-
    The Mistral AI Models API provides endpoints for listing and retrieving
    information about available models on the Mistral platform. Developers
    can query which models are accessible, inspect model capabilities and
    metadata, and manage fine-tuned model deployments. This API serves as
    the foundation for model discovery and lifecycle management within the
    Mistral ecosystem.
  version: '1.0.0'
  contact:
    name: Mistral AI Support
    url: https://docs.mistral.ai
  termsOfService: https://mistral.ai/terms
externalDocs:
  description: Mistral AI Models Documentation
  url: https://docs.mistral.ai/api/endpoint/models
servers:
  - url: https://api.mistral.ai/v1
    description: Mistral AI Production Server
tags:
  - name: Models
    description: >-
      Endpoints for listing, retrieving, updating, and deleting models
      available on the Mistral AI platform.
security:
  - bearerAuth: []
paths:
  /models:
    get:
      operationId: listModels
      summary: List models
      description: >-
        List all models available to the user, including base models and
        fine-tuned models. Returns model IDs, capabilities, and metadata.
      tags:
        - Models
      responses:
        '200':
          description: Successfully retrieved list of models
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelList'
        '401':
          description: Unauthorized due to missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /models/{model_id}:
    get:
      operationId: getModel
      summary: Retrieve model
      description: >-
        Retrieves a model instance, providing information about the model
        including its ID, creation date, owner, and capabilities.
      tags:
        - Models
      parameters:
        - $ref: '#/components/parameters/ModelIdParam'
      responses:
        '200':
          description: Successfully retrieved model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Model'
        '401':
          description: Unauthorized due to missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Model not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      operationId: deleteModel
      summary: Delete model
      description: >-
        Delete a fine-tuned model. Only models owned by the user's
        organization can be deleted. Base models cannot be deleted.
      tags:
        - Models
      parameters:
        - $ref: '#/components/parameters/ModelIdParam'
      responses:
        '200':
          description: Successfully deleted model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteModelResponse'
        '401':
          description: Unauthorized due to missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Model not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /fine_tuning/models/{model_id}:
    patch:
      operationId: updateFineTunedModel
      summary: Update fine-tuned model
      description: >-
        Update a fine-tuned model's metadata such as its name or description.
      tags:
        - Models
      parameters:
        - $ref: '#/components/parameters/ModelIdParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateModelRequest'
      responses:
        '200':
          description: Successfully updated fine-tuned model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Model'
        '401':
          description: Unauthorized due to missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Model not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
  parameters:
    ModelIdParam:
      name: model_id
      in: path
      required: true
      description: >-
        The ID of the model.
      schema:
        type: string
  schemas:
    ModelList:
      type: object
      properties:
        object:
          type: string
          description: >-
            The object type, always list.
          enum:
            - list
        data:
          type: array
          description: >-
            A list of model objects.
          items:
            $ref: '#/components/schemas/Model'
    Model:
      type: object
      properties:
        id:
          type: string
          description: >-
            The model identifier.
        object:
          type: string
          description: >-
            The object type, always model.
          enum:
            - model
        created:
          type: integer
          description: >-
            The Unix timestamp when the model was created.
        owned_by:
          type: string
          description: >-
            The organization that owns the model.
        name:
          type: string
          description: >-
            The human-readable name of the model.
        description:
          type: string
          description: >-
            A description of the model.
        max_context_length:
          type: integer
          description: >-
            The maximum context length supported by the model.
        aliases:
          type: array
          description: >-
            A list of aliases for the model.
          items:
            type: string
        deprecation:
          type: string
          format: date-time
          description: >-
            The deprecation date of the model, if applicable.
        capabilities:
          $ref: '#/components/schemas/ModelCapabilities'
        type:
          type: string
          description: >-
            The type of model.
          enum:
            - base
            - fine-tuned
    ModelCapabilities:
      type: object
      properties:
        completion_chat:
          type: boolean
          description: >-
            Whether the model supports chat completions.
        completion_fim:
          type: boolean
          description: >-
            Whether the model supports fill-in-the-middle completions.
        function_calling:
          type: boolean
          description: >-
            Whether the model supports function calling.
        fine_tuning:
          type: boolean
          description: >-
            Whether the model can be fine-tuned.
        vision:
          type: boolean
          description: >-
            Whether the model supports vision inputs.
    UpdateModelRequest:
      type: object
      properties:
        name:
          type: string
          description: >-
            The new name for the model.
        description:
          type: string
          description: >-
            The new description for the model.
    DeleteModelResponse:
      type: object
      properties:
        id:
          type: string
          description: >-
            The ID of the deleted model.
        object:
          type: string
          description: >-
            The object type.
        deleted:
          type: boolean
          description: >-
            Whether the model was successfully deleted.
    Error:
      type: object
      properties:
        message:
          type: string
          description: >-
            A human-readable error message.
        type:
          type: string
          description: >-
            The type of error.
        code:
          type: integer
          description: >-
            The HTTP status code.