La spec OpenAPI
Tree BG 1
Tree
Tree
TreeLeaves
TreeLeaves
Cat IdleGrassGrassRockRock

Conversations bêta

API Conversations (bêta)

Lister toutes les conversations créées.

GET /v1/conversations

Récupérer une liste d'entités de conversation triées par date de création.

200

Réponse réussie

ModelConversation

{object}

AgentConversation

{object}

Playground

Testez les endpoints en direct

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

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

async function run() {
  const result = await mistral.beta.conversations.list({});

  console.log(result);
}

run();
from mistralai.client import Mistral
import os


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

    res = mistral.beta.conversations.list(page=0, page_size=100)

    # Handle response
    print(res)

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

200

[
  {
    "created_at": "2025-12-17T10:25:07.818693Z",
    "id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
    "model": "mistral-small-latest",
    "updated_at": "2025-12-17T10:41:03.469341Z"
  }
]

Créer une conversation et y ajouter des entrées.

POST /v1/conversations

Créer une nouvelle conversation, en utilisant un modèle de base ou un agent, et ajouter des entrées. L'exécution de la complétion et des outils est lancée et la réponse est ajoutée à la conversation. Utilisez l'conversation_id retourné pour poursuivre la conversation.

200

Réponse réussie

conversation_id
*string
guardrails
array<map<any>>|null
object
string

Default Value: "conversation.response"

Playground

Testez les endpoints en direct

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

const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY });

const conversation = await client.beta.conversations.start({
  inputs: "Help me summarize this document.",
});

console.log(conversation.id);
import os
from mistralai import Mistral

client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])

conversation = client.beta.conversations.start(
    inputs="Help me summarize this document.",
    stream=False,
)

print(conversation.id)
curl https://api.mistral.ai/v1/conversations \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{
  "inputs": "Example input."
}'

200

{
  "conversation_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
  "outputs": [
    {
      "content": "Example content."
    }
  ],
  "usage": {}
}

Récupérer les informations d'une conversation.

GET /v1/conversations/{conversation_id}

À partir d'un conversation_id, récupérer une entité de conversation avec ses attributs.

200

Réponse réussie

ModelConversation

{object}

AgentConversation

{object}

Playground

Testez les endpoints en direct

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

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

async function run() {
  const result = await mistral.beta.conversations.get({
    conversationId: "<id>",
  });

  console.log(result);
}

run();
from mistralai.client import Mistral
import os


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

    res = mistral.beta.conversations.get(conversation_id="<id>")

    # Handle response
    print(res)

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

200

{
  "created_at": "2025-12-17T10:25:07.818693Z",
  "id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
  "model": "mistral-small-latest",
  "updated_at": "2025-12-17T10:41:03.469341Z"
}

Ajouter de nouvelles entrées à une conversation existante.

POST /v1/conversations/{conversation_id}

Exécuter la complétion sur l'historique de la conversation et les entrées de l'utilisateur. Retourner les nouvelles entrées créées.

200

Réponse réussie

conversation_id
*string
guardrails
array<map<any>>|null
object
string

Default Value: "conversation.response"

Playground

Testez les endpoints en direct

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

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

async function run() {
  const result = await mistral.beta.conversations.append({
    conversationId: "<id>",
    conversationAppendRequest: {
      inputs: [],
    },
  });

  console.log(result);
}

run();
from mistralai.client import Mistral
import os


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

    res = mistral.beta.conversations.append(conversation_id="<id>", stream=False, store=True, handoff_execution="server", completion_args={
        "response_format": {
            "type": "text",
        },
    })

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/conversations/{conversation_id} \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{}'

200

{
  "conversation_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
  "outputs": [
    {
      "content": "Example content."
    }
  ],
  "usage": {}
}

Supprimer une conversation.

DELETE /v1/conversations/{conversation_id}

Supprimer une conversation à partir d'un conversation_id.

Playground

Testez les endpoints en direct

from mistralai.client import Mistral
import os


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

    mistral.beta.conversations.delete(conversation_id="<id>")

    # Use the SDK ...

curl https://api.mistral.ai/v1/conversations/{conversation_id} \
 -X DELETE \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json'

Récupérer toutes les entrées d'une conversation.

GET /v1/conversations/{conversation_id}/history

À partir d'un conversation_id, récupérer toutes les entrées appartenant à cette conversation. Les entrées sont triées dans l'ordre où elles ont été ajoutées, celles-ci peuvent être des messages, des connecteurs ou des function_call.

200

Réponse réussie

conversation_id
*string
object
string

Default Value: "conversation.history"

Playground

Testez les endpoints en direct

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

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

async function run() {
  const result = await mistral.beta.conversations.getHistory({
    conversationId: "<id>",
  });

  console.log(result);
}

run();
from mistralai.client import Mistral
import os


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

    res = mistral.beta.conversations.get_history(conversation_id="<id>")

    # Handle response
    print(res)

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

200

{
  "conversation_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
  "entries": [
    {
      "content": "Example content.",
      "role": "assistant"
    }
  ]
}

Récupérer tous les messages d'une conversation.

GET /v1/conversations/{conversation_id}/messages

À partir d'un conversation_id, récupérer tous les messages appartenant à cette conversation. Cela est similaire à la récupération de toutes les entrées, sauf que nous filtrons uniquement les messages.

200

Réponse réussie

conversation_id
*string
object
string

Default Value: "conversation.messages"

Playground

Testez les endpoints en direct

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

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

async function run() {
  const result = await mistral.beta.conversations.getMessages({
    conversationId: "<id>",
  });

  console.log(result);
}

run();
from mistralai.client import Mistral
import os


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

    res = mistral.beta.conversations.get_messages(conversation_id="<id>")

    # Handle response
    print(res)

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

200

{
  "conversation_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
  "messages": [
    {
      "content": "Example content.",
      "role": "assistant"
    }
  ]
}

Redémarrer une conversation en partant d'une entrée donnée.

POST /v1/conversations/{conversation_id}/restart

À partir d'un conversation_id et d'un id, recréer une conversation à partir de ce point et exécuter la complétion. Une nouvelle conversation est retournée avec les nouvelles entrées générées.

200

Réponse réussie

conversation_id
*string
guardrails
array<map<any>>|null
object
string

Default Value: "conversation.response"

Playground

Testez les endpoints en direct

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

const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY });

const conversation = await client.beta.conversations.restart({
  conversationId: "019b2bd7-96e7-7219-8c0b-45a73da50088",
  conversationRestartRequest: {
    inputs: "Start again from this message.",
    fromEntryId: "019b2bd7-96e7-7219-8c0b-45a73da50088",
  },
});

console.log(conversation.id);
import os
from mistralai import Mistral

client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])

conversation = client.beta.conversations.restart(
    conversation_id="019b2bd7-96e7-7219-8c0b-45a73da50088",
    inputs="Start again from this message.",
    from_entry_id="019b2bd7-96e7-7219-8c0b-45a73da50088",
    stream=False,
)

print(conversation.id)
curl https://api.mistral.ai/v1/conversations/{conversation_id}/restart \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{
  "from_entry_id": "019b2bd7-96e7-7219-8c0b-45a73da50088"
}'

200

{
  "conversation_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
  "outputs": [
    {
      "content": "Example content."
    }
  ],
  "usage": {}
}

Créer une conversation et y ajouter des entrées.

POST /v1/conversations#stream

Créer une nouvelle conversation, en utilisant un modèle de base ou un agent, et ajouter des entrées. L'exécution de la complétion et des outils est lancée et la réponse est ajoutée à la conversation. Utilisez l'conversation_id retourné pour poursuivre la conversation.

200

Réponse réussie

ConversationEvents

{object}

Playground

Testez les endpoints en direct

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

const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY });

const events = await client.beta.conversations.startStream({
  inputs: "Help me summarize this document.",
});

for await (const event of events) {
  console.log(event);
}
import os
from mistralai import Mistral

client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])

with client.beta.conversations.start_stream(
    inputs="Help me summarize this document.",
) as events:
    for event in events:
        print(event)
curl https://api.mistral.ai/v1/conversations#stream \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{
  "inputs": "Example input."
}'

200

null

Ajouter de nouvelles entrées à une conversation existante.

POST /v1/conversations/{conversation_id}#stream

Exécuter la complétion sur l'historique de la conversation et les entrées de l'utilisateur. Retourner les nouvelles entrées créées.

200

Réponse réussie

ConversationEvents

{object}

Playground

Testez les endpoints en direct

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

const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY });

const events = await client.beta.conversations.appendStream({
  conversationId: "019b2bd7-96e7-7219-8c0b-45a73da50088",
  conversationAppendStreamRequest: {
    inputs: "Continue with more detail.",
  },
});

for await (const event of events) {
  console.log(event);
}
import os
from mistralai import Mistral

client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])

with client.beta.conversations.append_stream(
    conversation_id="019b2bd7-96e7-7219-8c0b-45a73da50088",
    inputs="Continue with more detail.",
) as events:
    for event in events:
        print(event)
curl https://api.mistral.ai/v1/conversations/{conversation_id}#stream \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{}'

200

null

Redémarrer une conversation en partant d'une entrée donnée.

POST /v1/conversations/{conversation_id}/restart#stream

À partir d'un conversation_id et d'un id, recréer une conversation à partir de ce point et exécuter la complétion. Une nouvelle conversation est retournée avec les nouvelles entrées générées.

200

Réponse réussie

ConversationEvents

{object}

Playground

Testez les endpoints en direct

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

const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY });

const events = await client.beta.conversations.restartStream({
  conversationId: "019b2bd7-96e7-7219-8c0b-45a73da50088",
  conversationRestartStreamRequest: {
    inputs: "Restart and stream the answer.",
    fromEntryId: "019b2bd7-96e7-7219-8c0b-45a73da50088",
  },
});

for await (const event of events) {
  console.log(event);
}
import os
from mistralai import Mistral

client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])

with client.beta.conversations.restart_stream(
    conversation_id="019b2bd7-96e7-7219-8c0b-45a73da50088",
    inputs="Restart and stream the answer.",
    from_entry_id="019b2bd7-96e7-7219-8c0b-45a73da50088",
) as events:
    for event in events:
        print(event)
curl https://api.mistral.ai/v1/conversations/{conversation_id}/restart#stream \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{
  "from_entry_id": "019b2bd7-96e7-7219-8c0b-45a73da50088"
}'

200

null