Opaque continuation token for the next page. Pass it back as page_token to fetch the next page. Null when there are no more results. Prefer this over the deprecated offset page parameter.













Beta Libraries Endpoints
(beta) Libraries API to create and manage libraries - index your documents to enhance agent capabilities.












Examples
Real world code examples
List all libraries you have access to.
GET /v1/libraries#
List all libraries that you have created or have been shared with you.
200
Successful Response
next_page_token#
pagination#
Deprecated: offset pagination metadata. Only populated for callers using the deprecated page parameter; omitted when page_token is used. While RBAC filtering is being rolled out total_items is a rough estimate (candidate count before per-library checks). Use next_page_token instead — this field will be removed once offset paging is retired.
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.beta.libraries.list({});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.beta.libraries.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.libraries.list(page_size=100, page=0)
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.list(page_size=100, page=0)
# Handle response
print(res)
curl https://api.mistral.ai/v1/libraries \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/libraries \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
{
"data": [
{
"chunk_size": null,
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"nb_documents": "426",
"owner_id": null,
"owner_type": "User",
"total_size": "6436546",
"updated_at": "2025-12-17T10:41:03.469341Z"
}
]
}{
"data": [
{
"chunk_size": null,
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"nb_documents": "426",
"owner_id": null,
"owner_type": "User",
"total_size": "6436546",
"updated_at": "2025-12-17T10:41:03.469341Z"
}
]
}Create a new Library.
POST /v1/libraries#
Create a new Library, you will be marked as the owner and only you will have the possibility to share it with others. When first created this will only be accessible by you.
chunk_size#
The size of the chunks (in characters) to split document text into. Must be between 256 and 32768.
description#
owner_type#
Determines who owns the created library. 'User' creates a private library accessible only to its owner. 'Workspace' creates a library shared with the workspace. Defaults to 'Workspace' for API key sessions. Only API keys with the 'Private and shared connectors' connector access scope can create private, user-owned libraries.
Playground
Test the endpoints live
import { Mistral } from "@mistralai/mistralai";
const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY });
const library = await client.beta.libraries.create({
name: "Product documentation",
});
console.log(library.id);
import { Mistral } from "@mistralai/mistralai";
const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY });
const library = await client.beta.libraries.create({
name: "Product documentation",
});
console.log(library.id);
import os
from mistralai import Mistral
client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
library = client.beta.libraries.create(name="Product documentation")
print(library.id)
import os
from mistralai import Mistral
client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
library = client.beta.libraries.create(name="Product documentation")
print(library.id)
curl https://api.mistral.ai/v1/libraries \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"name": "My Library"
}'curl https://api.mistral.ai/v1/libraries \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"name": "My Library"
}'201
{
"chunk_size": null,
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"nb_documents": "426",
"owner_id": null,
"owner_type": "User",
"total_size": "6436546",
"updated_at": "2025-12-17T10:41:03.469341Z"
}{
"chunk_size": null,
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"nb_documents": "426",
"owner_id": null,
"owner_type": "User",
"total_size": "6436546",
"updated_at": "2025-12-17T10:41:03.469341Z"
}Detailed information about a specific Library.
GET /v1/libraries/{library_id}#
Given a library id, details information about that Library.
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.beta.libraries.get({
libraryId: "d0d23a1e-bfe5-45e7-b7bb-22a4ea78d47f",
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.beta.libraries.get({
libraryId: "d0d23a1e-bfe5-45e7-b7bb-22a4ea78d47f",
});
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.libraries.get(library_id="d0d23a1e-bfe5-45e7-b7bb-22a4ea78d47f")
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.get(library_id="d0d23a1e-bfe5-45e7-b7bb-22a4ea78d47f")
# Handle response
print(res)
curl https://api.mistral.ai/v1/libraries/{library_id} \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/libraries/{library_id} \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
{
"chunk_size": null,
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"nb_documents": "426",
"owner_id": null,
"owner_type": "User",
"total_size": "6436546",
"updated_at": "2025-12-17T10:41:03.469341Z"
}{
"chunk_size": null,
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"nb_documents": "426",
"owner_id": null,
"owner_type": "User",
"total_size": "6436546",
"updated_at": "2025-12-17T10:41:03.469341Z"
}Update a library.
PUT /v1/libraries/{library_id}#
Given a library id, you can update the name and description.
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.beta.libraries.librariesUpdateV1({
libraryId: "e01880c3-d0b5-4a29-8b1b-abdb8ce917e4",
updateLibraryRequest: {},
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.beta.libraries.librariesUpdateV1({
libraryId: "e01880c3-d0b5-4a29-8b1b-abdb8ce917e4",
updateLibraryRequest: {},
});
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.libraries.libraries_update_v1(library_id="e01880c3-d0b5-4a29-8b1b-abdb8ce917e4")
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.libraries_update_v1(library_id="e01880c3-d0b5-4a29-8b1b-abdb8ce917e4")
# Handle response
print(res)
curl https://api.mistral.ai/v1/libraries/{library_id} \
-X PUT \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{}'curl https://api.mistral.ai/v1/libraries/{library_id} \
-X PUT \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{}'200
{
"chunk_size": null,
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"nb_documents": "426",
"owner_id": null,
"owner_type": "User",
"total_size": "6436546",
"updated_at": "2025-12-17T10:41:03.469341Z"
}{
"chunk_size": null,
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"nb_documents": "426",
"owner_id": null,
"owner_type": "User",
"total_size": "6436546",
"updated_at": "2025-12-17T10:41:03.469341Z"
}Delete a library and all of it's document.
DELETE /v1/libraries/{library_id}#
Given a library id, deletes it together with all documents that have been uploaded to that library. Warning: the response will change from 200 (returning the deleted library) to 204 No Content in a future version.
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.beta.libraries.delete({
libraryId: "6cad0b6e-fd2e-4d11-a48b-21d30fb7c17a",
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.beta.libraries.delete({
libraryId: "6cad0b6e-fd2e-4d11-a48b-21d30fb7c17a",
});
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.libraries.delete(library_id="6cad0b6e-fd2e-4d11-a48b-21d30fb7c17a")
assert res is not None
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.delete(library_id="6cad0b6e-fd2e-4d11-a48b-21d30fb7c17a")
assert res is not None
# Handle response
print(res)
curl https://api.mistral.ai/v1/libraries/{library_id} \
-X DELETE \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json'curl https://api.mistral.ai/v1/libraries/{library_id} \
-X DELETE \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json'200
{
"chunk_size": null,
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"nb_documents": "426",
"owner_id": null,
"owner_type": "User",
"total_size": "6436546",
"updated_at": "2025-12-17T10:41:03.469341Z"
}{
"chunk_size": null,
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"nb_documents": "426",
"owner_id": null,
"owner_type": "User",
"total_size": "6436546",
"updated_at": "2025-12-17T10:41:03.469341Z"
}Update a library.
PATCH /v1/libraries/{library_id}#
Given a library id, you can update the name and description.
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.beta.libraries.update({
libraryId: "74a30b7a-ba52-49f7-a8a3-7157e1adf565",
updateLibraryRequest: {},
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.beta.libraries.update({
libraryId: "74a30b7a-ba52-49f7-a8a3-7157e1adf565",
updateLibraryRequest: {},
});
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.libraries.update(library_id="74a30b7a-ba52-49f7-a8a3-7157e1adf565")
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.libraries.update(library_id="74a30b7a-ba52-49f7-a8a3-7157e1adf565")
# Handle response
print(res)
curl https://api.mistral.ai/v1/libraries/{library_id} \
-X PATCH \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{}'curl https://api.mistral.ai/v1/libraries/{library_id} \
-X PATCH \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{}'200
{
"chunk_size": null,
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"nb_documents": "426",
"owner_id": null,
"owner_type": "User",
"total_size": "6436546",
"updated_at": "2025-12-17T10:41:03.469341Z"
}{
"chunk_size": null,
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"nb_documents": "426",
"owner_id": null,
"owner_type": "User",
"total_size": "6436546",
"updated_at": "2025-12-17T10:41:03.469341Z"
}