Tree BG 1
Tree
Tree
TreeLeaves
TreeLeaves
Cat IdleGrassGrassRockRock

Models Endpoints

Model Management API

List Models

GET /v1/models

List all models available to the user.

200

Successful Response

object
string

Default Value: "list"

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.models.list();

  console.log(result);
}

run();
from mistralai import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.models.list()

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/models \
 -X GET \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

[
  {
    "id": "<model_id>",
    "capabilities": {
      "completion_chat": true,
      "completion_fim": false,
      "function_calling": false,
      "fine_tuning": false,
      "vision": false,
      "classification": false
    },
    "job": "<job_id>",
    "root": "open-mistral-7b",
    "object": "model",
    "created": 1756746619,
    "owned_by": "<owner_id>",
    "name": null,
    "description": null,
    "max_context_length": 32768,
    "aliases": [],
    "deprecation": null,
    "deprecation_replacement_model": null,
    "default_model_temperature": null,
    "TYPE": "fine-tuned",
    "archived": false
  }
]

Retrieve Model

GET /v1/models/{model_id}

Retrieve information about a model.

200

Successful Response

BaseModelCard

{object}

FTModelCard

{object}

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.models.retrieve({
    modelId: "ft:open-mistral-7b:587a6b29:20240514:7e773925",
  });

  console.log(result);
}

run();
from mistralai import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.models.retrieve(model_id="ft:open-mistral-7b:587a6b29:20240514:7e773925")

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/models/{model_id} \
 -X GET \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

{
  "id": "<your_model_id>",
  "capabilities": {
    "completion_chat": true,
    "completion_fim": false,
    "function_calling": false,
    "fine_tuning": false,
    "vision": false,
    "classification": false
  },
  "job": "<job_id>",
  "root": "open-mistral-7b",
  "object": "model",
  "created": 1756746619,
  "owned_by": "<owner_id>",
  "name": null,
  "description": null,
  "max_context_length": 32768,
  "aliases": [],
  "deprecation": null,
  "deprecation_replacement_model": null,
  "default_model_temperature": null,
  "TYPE": "fine-tuned",
  "archived": false
}

Delete Model

DELETE /v1/models/{model_id}

Delete a fine-tuned model.

200

Successful Response

deleted
boolean

Default Value: true

The deletion status

id
*string

The ID of the deleted model.

object
string

Default Value: "model"

The object type that was deleted

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.models.delete({
    modelId: "ft:open-mistral-7b:587a6b29:20240514:7e773925",
  });

  console.log(result);
}

run();
from mistralai import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.models.delete(model_id="ft:open-mistral-7b:587a6b29:20240514:7e773925")

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/models/{model_id} \
 -X DELETE \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

{
  "id": "ft:open-mistral-7b:587a6b29:20240514:7e773925",
  "object": "model",
  "deleted": true
}

Update Fine Tuned Model

PATCH /v1/fine_tuning/models/{model_id}

Update a model name or description.

200

OK

CompletionFTModelOut

{object}

ClassifierFTModelOut

{object}

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.models.update({
    modelId: "ft:open-mistral-7b:587a6b29:20240514:7e773925",
    updateFTModelIn: {},
  });

  console.log(result);
}

run();
from mistralai import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.models.update(model_id="ft:open-mistral-7b:587a6b29:20240514:7e773925")

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/fine_tuning/models/{model_id} \
 -X PATCH \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -d '{}'

200

{
  "archived": false,
  "capabilities": {},
  "created": 87,
  "id": "ipsum eiusmod",
  "job": "consequat do",
  "owned_by": "reprehenderit ut dolore",
  "root": "occaecat dolor sit",
  "root_version": "nostrud",
  "workspace_id": "aute aliqua aute commodo"
}

Archive Fine Tuned Model

POST /v1/fine_tuning/models/{model_id}/archive

Archive a fine-tuned model.

200

OK

archived
boolean

Default Value: true

id
*string
object
"model"

Default Value: "model"

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.models.archive({
    modelId: "ft:open-mistral-7b:587a6b29:20240514:7e773925",
  });

  console.log(result);
}

run();
from mistralai import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.models.archive(model_id="ft:open-mistral-7b:587a6b29:20240514:7e773925")

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/fine_tuning/models/{model_id}/archive \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

{
  "id": "ipsum eiusmod"
}

Unarchive Fine Tuned Model

DELETE /v1/fine_tuning/models/{model_id}/archive

Un-archive a fine-tuned model.

200

OK

archived
boolean

Default Value: false

id
*string
object
"model"

Default Value: "model"

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.models.unarchive({
    modelId: "ft:open-mistral-7b:587a6b29:20240514:7e773925",
  });

  console.log(result);
}

run();
from mistralai import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.models.unarchive(model_id="ft:open-mistral-7b:587a6b29:20240514:7e773925")

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/fine_tuning/models/{model_id}/archive \
 -X DELETE \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

{
  "id": "ipsum eiusmod"
}