Mistral AI Embeddings API

Text embedding operations

Documentation

Specifications

Other Resources

OpenAPI Specification

mistral-embeddings-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Mistral AI Agents Embeddings API
  description: Agent completions API for building AI agents that can handle complex tasks, maintain context, coordinate multiple actions, and use tools including function calling. Agents are created and configured via the Mistral platform and invoked through this API.
  version: '1.0'
  contact:
    name: Mistral AI Support
    url: https://docs.mistral.ai/
    email: support@mistral.ai
  termsOfService: https://mistral.ai/terms/
servers:
- url: https://api.mistral.ai/v1
  description: Mistral AI Production
security:
- bearerAuth: []
tags:
- name: Embeddings
  description: Text embedding operations
paths:
  /embeddings:
    post:
      operationId: createEmbedding
      summary: Mistral AI Create embeddings
      description: Generate vector embeddings for the given input text. Supports single or batch text inputs and returns high-dimensional float vectors.
      tags:
      - Embeddings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingRequest'
      responses:
        '200':
          description: Embedding response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized - invalid or missing API key
        '429':
          description: Rate limit exceeded
components:
  schemas:
    EmbeddingResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the embedding request
        object:
          type: string
          enum:
          - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/Embedding'
        model:
          type: string
          description: The model used to generate the embeddings
        usage:
          $ref: '#/components/schemas/Usage'
    Usage:
      type: object
      properties:
        prompt_tokens:
          type: integer
          description: Number of tokens in the input
        total_tokens:
          type: integer
          description: Total tokens used
    Embedding:
      type: object
      properties:
        object:
          type: string
          enum:
          - embedding
        embedding:
          type: array
          items:
            type: number
          description: The embedding vector
        index:
          type: integer
          description: Index of the embedding in the input list
    EmbeddingRequest:
      type: object
      required:
      - model
      - input
      properties:
        model:
          type: string
          description: ID of the embedding model to use
          examples:
          - mistral-embed
        input:
          oneOf:
          - type: string
          - type: array
            items:
              type: string
          description: Text to embed, as a string or array of strings
        encoding_format:
          type: string
          enum:
          - float
          default: float
          description: The format of the output embeddings
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Mistral AI API key passed as a Bearer token
externalDocs:
  description: Mistral AI Agents API Documentation
  url: https://docs.mistral.ai/api/endpoint/agents