Mistral AI Embeddings API

Endpoints for generating vector embeddings from text inputs using Mistral embedding models.

OpenAPI Specification

mistral-ai-embeddings-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Mistral AI Agents Embeddings API
  description: The Mistral AI Agents API provides a dedicated framework for building agentic applications. It complements the Chat Completion API by enabling AI agents to handle complex tasks, maintain context across interactions, and coordinate multiple actions. Developers can create agents with specific configurations, tools, and instructions, making it suitable for enterprise-grade agentic platforms and multi-step workflow automation.
  version: 1.0.0
  contact:
    name: Mistral AI Support
    url: https://docs.mistral.ai
  termsOfService: https://mistral.ai/terms
servers:
- url: https://api.mistral.ai/v1
  description: Mistral AI Production Server
security:
- bearerAuth: []
tags:
- name: Embeddings
  description: Endpoints for generating vector embeddings from text inputs using Mistral embedding models.
paths:
  /embeddings:
    post:
      operationId: createEmbedding
      summary: Create embeddings
      description: Creates an embedding vector representing the input text. The input can be a single string or an array of strings for batch processing. Returns high-dimensional vector representations suitable for semantic search, clustering, and classification tasks.
      tags:
      - Embeddings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingRequest'
      responses:
        '200':
          description: Successful embedding response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingResponse'
        '400':
          description: Bad request due to invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized due to missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    EmbeddingObject:
      type: object
      properties:
        object:
          type: string
          description: The object type, always embedding.
          enum:
          - embedding
        embedding:
          type: array
          description: The embedding vector as an array of floats.
          items:
            type: number
            format: float
        index:
          type: integer
          description: The index of the embedding in the list of embeddings.
    Usage:
      type: object
      properties:
        prompt_tokens:
          type: integer
          description: Number of tokens in the input.
        total_tokens:
          type: integer
          description: Total number of tokens used in the request.
    EmbeddingRequest:
      type: object
      required:
      - model
      - input
      properties:
        model:
          type: string
          description: ID of the model to use for generating embeddings.
          example: mistral-embed
        input:
          oneOf:
          - type: string
          - type: array
            items:
              type: string
          description: Input text to embed. Can be a single string or an array of strings for batch processing.
        encoding_format:
          type: string
          description: The format to return the embeddings in.
          enum:
          - float
          default: float
    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.
    EmbeddingResponse:
      type: object
      properties:
        id:
          type: string
          description: A unique identifier for the embedding request.
        object:
          type: string
          description: The object type, always list.
          enum:
          - list
        data:
          type: array
          description: A list of embedding objects.
          items:
            $ref: '#/components/schemas/EmbeddingObject'
        model:
          type: string
          description: The model used to generate the embeddings.
        usage:
          $ref: '#/components/schemas/Usage'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
externalDocs:
  description: Mistral AI Agents Documentation
  url: https://docs.mistral.ai/api/endpoint/agents