Mistral AI
    Mistral AI
    • Create Chat Completions
      POST
    • Create FIM Completions
      POST
    • Create Embeddings
      POST
    • List Available Models
      GET
    • Delete Model
      DELETE
    • Upload File
      POST
    • List Files
      GET
    • Retrieve File
      GET
    • Delete File
      DELETE
    • List Fine Tuning Jobs
      GET
    • Create Fine Tuning Job
      POST
    • Get Fine Tuning Job
      GET
    • Cancel Fine Tuning Job
      POST

      Create Embeddings

      Develop Env
      https://dev.your-api-server.com
      Develop Env
      https://dev.your-api-server.com
      POST
      /embeddings
      Request Request Example
      Shell
      JavaScript
      Java
      Swift
      curl --location --request POST 'https://dev.your-api-server.com/embeddings' \
      --header 'Content-Type: application/json' \
      --data-raw '{
          "model": "mistral-embed",
          "input": [
              "Hello",
              "world"
          ],
          "encoding_format": "float"
      }'
      Response Response Example
      {
          "id": "embd-aad6fc62b17349b192ef09225058bc45",
          "object": "list",
          "data": [
              {
                  "object": "embedding",
                  "embedding": [
                      0.1,
                      0.2,
                      0.3
                  ],
                  "index": 0
              },
              {
                  "object": "embedding",
                  "embedding": [
                      0.4,
                      0.5,
                      0.6
                  ],
                  "index": 1
              }
          ],
          "model": "string",
          "usage": {
              "prompt_tokens": 9,
              "total_tokens": 9
          }
      }

      Request

      Body Params application/json
      model
      string 
      optional
      The ID of the model to use for this request.
      Example:
      mistral-embed
      input
      array[string]
      optional
      The list of strings to embed.
      Example:
      ["Hello","world"]
      encoding_format
      enum<string> 
      optional
      The format of the output data.
      Allowed value:
      float
      Example:
      float
      Examples

      Responses

      🟢200OK
      application/json
      Body
      id
      string 
      required
      Example:
      embd-aad6fc62b17349b192ef09225058bc45
      object
      string 
      required
      Example:
      list
      data
      array [object {3}] 
      required
      Example:
      [{"object":"embedding","embedding":[0.1,0.2,0.3],"index":0},{"object":"embedding","embedding":[0.4,0.5,0.6],"index":1}]
      object
      string 
      optional
      Example:
      embedding
      embedding
      array[number]
      optional
      Example:
      [0.1,0.2,0.3]
      index
      optional
      Example:
      0
      model
      string 
      required
      usage
      object 
      required
      prompt_tokens
      integer 
      required
      Example:
      9
      total_tokens
      integer 
      required
      Example:
      9
      Modified at 11 months ago
      Previous
      Create FIM Completions
      Next
      List Available Models
      Built with