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
    • Schemas
      • Schemas
        • Error
        • ErrorResponse
        • ModelList
        • Regular
        • JSON mode
        • Function calling
        • FIMCompletionRequest
        • Regular
        • JSON mode
        • Function calling
        • EmbeddingRequest
        • EmbeddingResponse
        • Model
        • UploadFileOut
        • ListFilesOut
        • RetrieveFileOut
        • DeleteFileOut
        • DeleteModelOut
        • FineTuneableModel
        • JobOut
        • JobsOut
        • TrainingParameters
        • WandbIntegrationOut
        • JobIn
        • WandbIntegration
        • CheckpointOut
        • DetailedJobOut
        • EventOut
        • MetricOut
        • UploadFileResponse
        • FileSchema
        • ListFilesResponse
        • RetrieveFileResponse
        • DeleteFileResponse
        • FIMCompletionResponse
        • JobMetadata
        • HTTPValidationError
        • ValidationError

      Create Chat Completions

      Develop Env
      https://dev.your-api-server.com
      Develop Env
      https://dev.your-api-server.com
      POST
      /chat/completions

      Request

      Body Params application/json

      Examples

      Responses

      🟢200OK
      application/json
      Body

      Request Request Example
      Shell
      JavaScript
      Java
      Swift
      curl --location --request POST 'https://dev.your-api-server.com/chat/completions' \
      --header 'Content-Type: application/json' \
      --data-raw '{
          "model": "mistral-small-latest",
          "messages": [
              {
                  "role": "user",
                  "content": "Who is the best French painter? Answer in one short sentence."
              }
          ],
          "temperature": 0.7,
          "top_p": 1,
          "max_tokens": null,
          "stream": false,
          "safe_prompt": false,
          "random_seed": null
      }'
      Response Response Example
      {
          "id": "cmpl-e5cc70bb28c444948073e77776eb30ef",
          "object": "chat.completion",
          "created": 1702256327,
          "model": "mistral-small-latest",
          "choices": [
              {
                  "index": 0,
                  "message": {
                      "role": "user",
                      "content": "Claude Monet is often considered one of the best French painters due to his significant role in the Impressionist movement."
                  },
                  "finish_reason": "stop"
              }
          ],
          "usage": {
              "prompt_tokens": 16,
              "completion_tokens": 34,
              "total_tokens": 50
          }
      }
      Modified at 2024-12-10 10:11:20
      Next
      Create FIM Completions
      Built with