### Install npm Dependencies Source: https://github.com/mistralai/client-ts/blob/main/examples/README.md Installs the necessary npm dependencies for the project and the examples directory. ```properties npm install && npm install --prefix examples ``` -------------------------------- ### Run All Examples Source: https://github.com/mistralai/client-ts/blob/main/examples/README.md Executes all tests within the examples directory using npm. ```properties npm run test --prefix examples ``` -------------------------------- ### Install with Bun Source: https://github.com/mistralai/client-ts/blob/main/README.md Install the Mistral AI client library using bun. ```bash bun add @mistralai/mistralai ``` -------------------------------- ### Install with PNPM Source: https://github.com/mistralai/client-ts/blob/main/README.md Install the Mistral AI client library using pnpm. ```bash pnpm add @mistralai/mistralai ``` -------------------------------- ### Run a Specific Example File Source: https://github.com/mistralai/client-ts/blob/main/examples/README.md Runs a single example file, specified by its path, using npm. ```properties npm run test --prefix examples -- --files src/async_chat_streaming.ts ``` -------------------------------- ### VoiceListResponse Example Usage Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/voicelistresponse.md Demonstrates how to import and instantiate the VoiceListResponse model with sample data. Ensure the @mistralai/mistralai library is installed. ```typescript import { VoiceListResponse } from "@mistralai/mistralai/models/components"; let value: VoiceListResponse = { items: [ { name: "", id: "d735d76e-5507-4b39-9e54-59a59f0249d8", createdAt: new Date("2024-04-13T17:29:06.723Z"), userId: "", }, ], total: 38391, page: 76184, pageSize: 410582, totalPages: 113184, }; ``` -------------------------------- ### VoiceResponse Example Usage Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/voiceresponse.md Demonstrates how to import and instantiate a VoiceResponse object. Ensure you have the @mistralai/mistralai library installed. ```typescript import { VoiceResponse } from "@mistralai/mistralai/models/components"; let value: VoiceResponse = { name: "", id: "091a473e-e680-451e-b7bb-916ad9aab9f9", createdAt: new Date("2025-03-09T11:09:23.266Z"), userId: "", }; ``` -------------------------------- ### Install with Yarn Source: https://github.com/mistralai/client-ts/blob/main/README.md Install the Mistral AI client library using yarn. ```bash yarn add @mistralai/mistralai ``` -------------------------------- ### Install Mistral Azure Client with Bun Source: https://github.com/mistralai/client-ts/blob/main/packages/mistralai-azure/README.md Install the Mistral AI Azure client package using Bun. ```bash bun add @mistralai/mistralai-azure ``` -------------------------------- ### Install with NPM Source: https://github.com/mistralai/client-ts/blob/main/README.md Install the Mistral AI client library using npm. ```bash npm add @mistralai/mistralai ``` -------------------------------- ### CreateCampaignRequest Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/createcampaignrequest.md Demonstrates how to instantiate a CreateCampaignRequest object in TypeScript. Ensure you have the @mistralai/mistralai library installed. ```typescript import { CreateCampaignRequest } from "@mistralai/mistralai/models/components"; let value: CreateCampaignRequest = { searchParams: { filters: { field: "", op: "len_eq", value: "", }, }, judgeId: "d606cfbb-a2e2-4aa8-b780-a226dc17f675", name: "", description: "ew serialize yippee yippee er gee coin gadzooks whimsical", maxNbEvents: 577729, }; ``` -------------------------------- ### ImportDatasetFromPlaygroundRequest Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/importdatasetfromplaygroundrequest.md Example of how to import a dataset from the playground using the ImportDatasetFromPlaygroundRequest. Ensure the @mistralai/mistralai library is installed. ```typescript import { ImportDatasetFromPlaygroundRequest } from "@mistralai/mistralai/models/components"; let value: ImportDatasetFromPlaygroundRequest = { conversationIds: [ "", "", "", ], }; ``` -------------------------------- ### Install Mistral AI GCP Client with Bun Source: https://github.com/mistralai/client-ts/blob/main/packages/mistralai-gcp/README.md Install the Mistral AI GCP client library using bun. ```bash bun add @mistralai/mistralai-gcp ``` -------------------------------- ### Install the SDK Source: https://github.com/mistralai/client-ts/blob/main/packages/mistralai-gcp/README.md Instructions for installing the Mistral AI GCP Typescript client library using various package managers. ```APIDOC ## SDK Installation ### NPM ```bash npm add @mistralai/mistralai-gcp ``` ### PNPM ```bash pnpm add @mistralai/mistralai-gcp ``` ### Bun ```bash bun add @mistralai/mistralai-gcp ``` ### Yarn ```bash yarn add @mistralai/mistralai-gcp zod # Note that Yarn does not install peer dependencies automatically. You will need # to install zod as shown above. ``` ``` -------------------------------- ### OCRResponse Example Usage Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/ocrresponse.md Demonstrates how to import and instantiate an OCRResponse object with sample data. Ensure the @mistralai/mistralai library is installed. ```typescript import { OCRResponse } from "@mistralai/mistralai/models/components"; let value: OCRResponse = { pages: [], model: "Mustang", usageInfo: { pagesProcessed: 819030, }, }; ``` -------------------------------- ### Example Usage Source: https://github.com/mistralai/client-ts/blob/main/packages/mistralai-azure/docs/models/components/ocrusageinfo.md An example demonstrating how to import and use the OCRUsageInfo model in TypeScript. ```typescript import { OCRUsageInfo } from "@mistralai/mistralai-azure/models/components"; let value: OCRUsageInfo = { pagesProcessed: 329301, }; ``` -------------------------------- ### fineTuningJobsStart Source: https://github.com/mistralai/client-ts/blob/main/README.md Starts a Fine Tuning Job. ```APIDOC ## fineTuningJobsStart ### Description Start Fine Tuning Job. ### Method Not specified in source. ### Endpoint Not specified in source. ### Parameters Not specified in source. ### Request Example Not specified in source. ### Response Not specified in source. ``` -------------------------------- ### Install Mistral Azure Client with PNPM Source: https://github.com/mistralai/client-ts/blob/main/packages/mistralai-azure/README.md Install the Mistral AI Azure client package using PNPM. ```bash pnpm add @mistralai/mistralai-azure ``` -------------------------------- ### Install Mistral AI GCP Client with PNPM Source: https://github.com/mistralai/client-ts/blob/main/packages/mistralai-gcp/README.md Install the Mistral AI GCP client library using pnpm. ```bash pnpm add @mistralai/mistralai-gcp ``` -------------------------------- ### Install Mistral AI GCP Client with NPM Source: https://github.com/mistralai/client-ts/blob/main/packages/mistralai-gcp/README.md Install the Mistral AI GCP client library using npm. ```bash npm add @mistralai/mistralai-gcp ``` -------------------------------- ### betaObservabilityCampaignsCreate Source: https://github.com/mistralai/client-ts/blob/main/README.md Create and start a new campaign ```APIDOC ## betaObservabilityCampaignsCreate ### Description Create and start a new campaign. ### Method Not specified, likely a client SDK method call. ### Endpoint Not specified, SDK method. ### Parameters Not specified in the source. ### Request Example Not specified in the source. ### Response Not specified in the source. ``` -------------------------------- ### Install Mistral Azure Client with NPM Source: https://github.com/mistralai/client-ts/blob/main/packages/mistralai-azure/README.md Install the Mistral AI Azure client package using NPM. Ensure you also install zod as it is a peer dependency. ```bash npm add @mistralai/mistralai-azure yarn add @mistralai/mistralai-azure zod ``` -------------------------------- ### Activity Task Started Response Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/listworkfloweventresponseevent.md Shows the expected format for an activity task started event response. This includes details about the task and its input. ```typescript const value: components.ActivityTaskStartedResponse = { eventId: "", eventTimestamp: 462358, rootWorkflowExecId: "", parentWorkflowExecId: "", workflowExecId: "", workflowRunId: "", workflowName: "", attributes: { taskId: "", activityName: "", input: { value: "", }, }, }; ``` -------------------------------- ### CreateConnectorRequest Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/createconnectorrequest.md Demonstrates how to import and instantiate the CreateConnectorRequest model in TypeScript. Ensure you have the @mistralai/mistralai package installed. ```typescript import { CreateConnectorRequest } from "@mistralai/mistralai/models/components"; let value: CreateConnectorRequest = { name: "", description: "pfft terrorise hm masculinize sand after", server: "https://multicolored-hawk.com", }; ``` -------------------------------- ### Set Up Environment Variables Source: https://github.com/mistralai/client-ts/blob/main/examples/README.md Copies the environment template and instructs to edit the .env file for configuration. ```properties cp examples/.env.template examples/.env # Edit your .env file ``` -------------------------------- ### Create ConversationAppendRequest Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/conversationappendrequest.md Example of how to instantiate a ConversationAppendRequest object with completion arguments. Ensure the @mistralai/mistralai library is installed. ```typescript import { ConversationAppendRequest } from "@mistralai/mistralai/models/components"; let value: ConversationAppendRequest = { completionArgs: { responseFormat: { type: "text", }, }, }; ``` -------------------------------- ### CustomTaskStartedResponse Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/listworkfloweventresponseevent.md Represents the event when a custom task starts. Includes identifiers for the custom task and its type. ```typescript const value: components.CustomTaskStartedResponse = { eventId: "", eventTimestamp: 189727, rootWorkflowExecId: "", parentWorkflowExecId: "", workflowExecId: "", workflowRunId: "", workflowName: "", attributes: { customTaskId: "", customTaskType: "", }, }; ``` -------------------------------- ### OCRConfidenceScore Usage Example Source: https://github.com/mistralai/client-ts/blob/main/packages/mistralai-azure/docs/models/components/ocrconfidencescore.md Demonstrates how to import and instantiate the OCRConfidenceScore model in TypeScript. Ensure the '@mistralai/mistralai-azure' package is installed. ```typescript import { OCRConfidenceScore } from "@mistralai/mistralai-azure/models/components"; let value: OCRConfidenceScore = { text: "", confidence: 538.74, startIndex: 498022, }; ``` -------------------------------- ### WorkflowExecutionProgressTraceEvent Usage Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/workflowexecutionprogresstraceevent.md Demonstrates how to import and instantiate a WorkflowExecutionProgressTraceEvent object in TypeScript. Ensure the @mistralai/mistralai package is installed. ```typescript import { WorkflowExecutionProgressTraceEvent } from "@mistralai/mistralai/models/components"; let value: WorkflowExecutionProgressTraceEvent = { name: "", id: "", timestampUnixNano: 455621, attributes: {}, startTimeUnixMs: 92535, }; ``` -------------------------------- ### MCPResource Usage Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/mcpresource.md Demonstrates how to instantiate and use the MCPResource type in TypeScript. Ensure the '@mistralai/mistralai' package is installed. ```typescript import { MCPResource } from "@mistralai/mistralai/models/components"; let value: MCPResource = { name: "", uri: "https://weighty-trench.biz", }; ``` -------------------------------- ### TranscriptionStreamSegmentDelta Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/transcriptionstreameventsdata.md Represents a segment of transcribed text with start and end timestamps. Useful for tracking progress and timing of transcription. ```typescript const value: components.TranscriptionStreamSegmentDelta = { type: "transcription.segment", text: "", start: 1796.95, end: 2412.74, }; ``` -------------------------------- ### MCPServerRepository Example Usage Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/mcpserverrepository.md Demonstrates how to import and instantiate the MCPServerRepository object with a URL and source identifier. ```typescript import { MCPServerRepository } from "@mistralai/mistralai/models/components"; let value: MCPServerRepository = { url: "https://sophisticated-lid.net/", source: "", }; ``` -------------------------------- ### Instantiate ListFilesResponse Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/listfilesresponse.md Demonstrates how to create an instance of ListFilesResponse with sample file data. Ensure the ListFilesResponse type is imported. ```typescript import { ListFilesResponse } from "@mistralai/mistralai/models/components"; let value: ListFilesResponse = { data: [ { id: "497f6eca-6276-4993-bfeb-53cbbbba6f09", object: "file", sizeBytes: 13000, createdAt: 1716963433, filename: "files_upload.jsonl", purpose: "batch", sampleType: "batch_request", source: "upload", }, ], object: "", }; ``` -------------------------------- ### Example Usage of ListDeploymentsV1WorkflowsDeploymentsGetRequest Source: https://github.com/mistralai/client-ts/blob/main/docs/models/operations/listdeploymentsv1workflowsdeploymentsgetrequest.md Demonstrates how to import and initialize an empty ListDeploymentsV1WorkflowsDeploymentsGetRequest object. This can be used as a starting point for constructing requests with optional parameters. ```typescript import { ListDeploymentsV1WorkflowsDeploymentsGetRequest } from "@mistralai/mistralai/models/operations"; let value: ListDeploymentsV1WorkflowsDeploymentsGetRequest = {}; ``` -------------------------------- ### WorkflowExecutionResponse Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/operations/responseexecuteworkflowv1workflowsworkflowidentifierexecutepost.md Represents the detailed response for a workflow execution, including status, start and end times, and the result. Use this for asynchronous or long-running workflows. ```typescript const value: components.WorkflowExecutionResponse = { workflowName: "", executionId: "", rootExecutionId: "", status: "TIMED_OUT", startTime: new Date("2026-07-06T18:38:00.483Z"), endTime: new Date("2025-12-31T15:27:44.423Z"), result: "", }; ``` -------------------------------- ### Example DeploymentListResponse Usage Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/deploymentlistresponse.md Demonstrates how to import and instantiate a DeploymentListResponse object. Ensure you have the correct import path for the model. ```typescript import { DeploymentListResponse } from "@mistralai/mistralai/models/components"; let value: DeploymentListResponse = { deployments: [], nextCursor: "", workspaceId: "832a5de6-5c56-4e09-b154-0ec5ad842234", }; ``` -------------------------------- ### MCPServerCard Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/mcpservercard.md Demonstrates how to import and initialize an MCPServerCard object. Ensure you have the correct import path for the MCPServerCard type. ```typescript import { MCPServerCard } from "@mistralai/mistralai/models/components"; let value: MCPServerCard = { name: "", version: "", }; ``` -------------------------------- ### Get Agent Version using Standalone Function Source: https://github.com/mistralai/client-ts/blob/main/docs/sdks/betaagents/README.md This example shows how to use the standalone `betaAgentsGetVersion` function for improved tree-shaking. It handles success and error responses explicitly. ```typescript import { MistralCore } from "@mistralai/mistralai/core.js"; import { betaAgentsGetVersion } from "@mistralai/mistralai/funcs/betaAgentsGetVersion.js"; // Use `MistralCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const mistral = new MistralCore({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const res = await betaAgentsGetVersion(mistral, { agentId: "", version: "", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("betaAgentsGetVersion failed:", res.error); } } run(); ``` -------------------------------- ### Get Workflow Metrics Source: https://github.com/mistralai/client-ts/blob/main/docs/sdks/metrics/README.md Use this method to retrieve comprehensive metrics for a specific workflow. Provide the workflow name and optionally specify start and end times for filtering. ```typescript import { Mistral } from "@mistralai/mistralai"; const mistral = new Mistral({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const result = await mistral.workflows.metrics.getWorkflowMetrics({ workflowName: "", }); console.log(result); } run(); ``` -------------------------------- ### CompletionFineTuningJobDetails Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/completionfinetuningjobdetails.md Demonstrates how to instantiate and populate a CompletionFineTuningJobDetails object with various properties. ```typescript import { CompletionFineTuningJobDetails } from "@mistralai/mistralai/models/components"; let value: CompletionFineTuningJobDetails = { id: "00931eba-91c1-431f-ab53-f13af37caca7", autoStart: true, model: "Grand Cherokee", status: "FAILED_VALIDATION", createdAt: 630040, modifiedAt: 969645, trainingFiles: [ "6702bef1-52df-4fbf-96ab-92899ff42ec5", "aed4c13c-d618-4e15-8f99-7f7b4f24d947", ], metadata: { expectedDurationSeconds: 220, cost: 10, costCurrency: "EUR", trainTokensPerStep: 131072, trainTokens: 1310720, dataTokens: 305375, }, jobType: "completion", hyperparameters: {}, checkpoints: [ { metrics: {}, stepNumber: 124866, createdAt: 1716963433, }, ], }; ``` -------------------------------- ### JobsApiRoutesFineTuningGetFineTuningJobsRequest Usage Source: https://github.com/mistralai/client-ts/blob/main/docs/models/operations/jobsapiroutesfinetuninggetfinetuningjobsrequest.md Example of how to import and initialize the JobsApiRoutesFineTuningGetFineTuningJobsRequest object. ```APIDOC ## JobsApiRoutesFineTuningGetFineTuningJobsRequest ### Description Represents the request object for retrieving fine-tuning jobs. ### Usage ```typescript import { JobsApiRoutesFineTuningGetFineTuningJobsRequest } from "@mistralai/mistralai/models/operations"; let value: JobsApiRoutesFineTuningGetFineTuningJobsRequest = {}; ``` ### Parameters This request object does not have any explicitly documented parameters in the source. It is typically used to construct a request for the fine-tuning jobs endpoint. ``` -------------------------------- ### Get Conversation Messages using Standalone Function Source: https://github.com/mistralai/client-ts/blob/main/docs/sdks/conversations/README.md This example demonstrates how to use the standalone function for fetching conversation messages, which can offer better tree-shaking performance. It includes error handling for the API call. ```typescript import { MistralCore } from "@mistralai/mistralai/core.js"; import { betaConversationsGetMessages } from "@mistralai/mistralai/funcs/betaConversationsGetMessages.js"; // Use `MistralCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const mistral = new MistralCore({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const res = await betaConversationsGetMessages(mistral, { conversationId: "", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("betaConversationsGetMessages failed:", res.error); } } run(); ``` -------------------------------- ### Get Run Details using Standalone Function Source: https://github.com/mistralai/client-ts/blob/main/docs/sdks/runs/README.md This example demonstrates how to retrieve workflow run details using a standalone function for better tree-shaking performance. It requires initializing MistralCore and importing the specific function. ```typescript import { MistralCore } from "@mistralai/mistralai/core.js"; import { workflowsRunsGetRun } from "@mistralai/mistralai/funcs/workflowsRunsGetRun.js"; // Use `MistralCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const mistral = new MistralCore({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const res = await workflowsRunsGetRun(mistral, { runId: "553b071e-3d04-46aa-aa9a-0fca61dc60fa", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("workflowsRunsGetRun failed:", res.error); } } run(); ``` -------------------------------- ### Running Extra Package Unit Tests Source: https://github.com/mistralai/client-ts/blob/main/src/extra/README.md Commands to set up the test environment and run unit tests for the `extra` package. This involves installing dependencies and building the tests. ```bash npm install --prefix tests npm run build (cd tests && npm test) ``` -------------------------------- ### Stream File Upload Example Source: https://github.com/mistralai/client-ts/blob/main/README.md Demonstrates how to attach a file stream to a request for transcription. This method is recommended for large files to prevent memory errors. Ensure you have the '@mistralai/mistralai' package installed and your API key configured. ```typescript import { Mistral } from "@mistralai/mistralai"; const mistral = new Mistral({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const result = await mistral.audio.transcriptions.complete({ model: "voxtral-mini-latest", }); console.log(result); } run(); ``` -------------------------------- ### Example Usage of Library Component Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/library.md Demonstrates how to import and instantiate the Library component in TypeScript. Ensure you have the necessary imports from the Mistral AI client library. ```typescript import { Library } from "@mistralai/mistralai/models/components"; let value: Library = { id: "4394495d-323b-4dea-b815-e2aed1943cd4", name: "", createdAt: new Date("2025-11-23T21:39:16.100Z"), updatedAt: new Date("2026-06-28T13:03:10.563Z"), ownerId: "8adf2b6a-a8b5-48f3-81fe-18c9b9c71477", ownerType: "", totalSize: 617259, nbDocuments: 259575, chunkSize: 663479, }; ``` -------------------------------- ### Get Conversation Details using Standalone Function (TypeScript) Source: https://github.com/mistralai/client-ts/blob/main/docs/sdks/conversations/README.md This example demonstrates how to fetch conversation details using a standalone function from the SDK. It provides error handling for failed requests. Use `MistralCore` for optimal tree-shaking. ```typescript import { MistralCore } from "@mistralai/mistralai/core.js"; import { betaConversationsGet } from "@mistralai/mistralai/funcs/betaConversationsGet.js"; // Use `MistralCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const mistral = new MistralCore({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const res = await betaConversationsGet(mistral, { conversationId: "", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("betaConversationsGet failed:", res.error); } } run(); ``` -------------------------------- ### Standalone Function for Streaming Conversation with Agent Handoff Source: https://github.com/mistralai/client-ts/blob/main/docs/sdks/conversations/README.md This example demonstrates using a standalone function for starting a streaming conversation with agent handoff. It's optimized for tree-shaking. The function returns a result object that indicates success or failure, with the streamed events available on success. ```typescript import { MistralCore } from "@mistralai/mistralai/core.js"; import { betaConversationsStartStream } from "@mistralai/mistralai/funcs/betaConversationsStartStream.js"; // Use `MistralCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const mistral = new MistralCore({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const res = await betaConversationsStartStream(mistral, { inputs: [ { object: "entry", type: "agent.handoff", previousAgentId: "", previousAgentName: "", nextAgentId: "", nextAgentName: "", }, ], completionArgs: { responseFormat: { type: "text", }, }, }); if (res.ok) { const { value: result } = res; for await (const event of result) { console.log(event); } } else { console.log("betaConversationsStartStream failed:", res.error); } } run(); ``` -------------------------------- ### get Source: https://github.com/mistralai/client-ts/blob/main/docs/sdks/connectors/README.md Get a connector. ```APIDOC ## GET /connectors/{connector_id} ### Description Retrieve details of a specific connector. ### Method GET ### Endpoint /connectors/{connector_id} ### Parameters #### Path Parameters - **connector_id** (string) - Required - The ID of the connector. ``` -------------------------------- ### CreateLibraryRequest Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/createlibraryrequest.md Demonstrates how to instantiate a CreateLibraryRequest object with a name. ```typescript import { CreateLibraryRequest } from "@mistralai/mistralai/models/components"; let value: CreateLibraryRequest = { name: "", }; ``` -------------------------------- ### GetChatCompletionEventV1ObservabilityChatCompletionEventsEventIdGetRequest Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/operations/getchatcompletioneventv1observabilitychatcompletioneventseventidgetrequest.md Example usage of the GetChatCompletionEventV1ObservabilityChatCompletionEventsEventIdGetRequest model in TypeScript. ```APIDOC ## GetChatCompletionEventV1ObservabilityChatCompletionEventsEventIdGetRequest ### Description Represents a request to retrieve a specific chat completion event by its ID. ### Fields #### Path Parameters - **eventId** (string) - Required - The unique identifier of the chat completion event to retrieve. ``` -------------------------------- ### CompletionFineTuningJob Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/completionfinetuningjob.md Demonstrates how to instantiate and define a CompletionFineTuningJob object with its various properties. ```typescript import { CompletionFineTuningJob } from "@mistralai/mistralai/models/components"; let value: CompletionFineTuningJob = { id: "aa5979da-9ac0-400a-8ab7-2f61022dea84", autoStart: false, model: "Roadster", status: "STARTED", createdAt: 726960, modifiedAt: 415027, trainingFiles: [ "20c6fcf4-5df1-45b0-908c-dcb8ee01cc88", "d854681e-5ee6-4b54-a994-1be93938b219", "bd3ea048-a05f-43c4-9eda-2f32c5884184", ], metadata: { expectedDurationSeconds: 220, cost: 10, costCurrency: "EUR", trainTokensPerStep: 131072, trainTokens: 1310720, dataTokens: 305375, }, jobType: "completion", hyperparameters: {}, }; ``` -------------------------------- ### LibrariesShareDeleteV1Request Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/operations/librariessharedeletev1request.md An example of how to instantiate and populate the LibrariesShareDeleteV1Request object in TypeScript. ```APIDOC ## LibrariesShareDeleteV1Request ### Description Represents a request to delete a share from a library. ### Fields #### `libraryId` - **Type**: `string` - **Required**: Yes - **Description**: The ID of the library from which to delete the share. #### `sharingDelete` - **Type**: `components.SharingDelete` - **Required**: Yes - **Description**: Details of the share to be deleted. ### Example Usage ```typescript import { LibrariesShareDeleteV1Request } from "@mistralai/mistralai/models/operations"; let value: LibrariesShareDeleteV1Request = { libraryId: "60a98302-6f5c-420d-b196-340076197225", sharingDelete: { shareWithUuid: "62303524-1a55-4463-a880-73404efa3580", shareWithType: "Org", }, }; ``` ``` -------------------------------- ### RealtimeTranscriptionSession Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/realtimetranscriptionsession.md Demonstrates how to instantiate a RealtimeTranscriptionSession object with required fields. Ensure the audio format details are correctly specified. ```typescript import { RealtimeTranscriptionSession } from "@mistralai/mistralai/models/components"; let value: RealtimeTranscriptionSession = { requestId: "", model: "Explorer", audioFormat: { encoding: "pcm_f32le", sampleRate: 710679, }, }; ``` -------------------------------- ### Install Mistral AI GCP Client with Yarn Source: https://github.com/mistralai/client-ts/blob/main/packages/mistralai-gcp/README.md Install the Mistral AI GCP client library and zod using yarn. Note that yarn does not install peer dependencies automatically. ```bash yarn add @mistralai/mistralai-gcp zod ``` -------------------------------- ### GetLog Model Instantiation Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/getlog.md Demonstrates how to create an instance of the GetLog model with all its fields. Ensure all required fields are populated correctly. ```typescript import { GetLog } from "@mistralai/mistralai/models/components"; let value: GetLog = { customerId: "", organizationId: "", workspaceId: "", userId: "", timestamp: new Date("2024-02-09T01:30:51.669Z"), traceId: "", spanId: "", traceFlags: 379064, severityText: "", severityNumber: 958727, serviceName: "", body: "", eventName: "", resourceSchemaUrl: "https://disloyal-exasperation.info/", resourceAttributes: { "key": "", "key1": "", }, scopeSchemaUrl: "https://grizzled-repeat.biz/", scopeName: "", scopeVersion: "", scopeAttributes: {}, logAttributes: { "key": "", }, }; ``` -------------------------------- ### CredentialsResponse Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/credentialsresponse.md Demonstrates how to import and define a CredentialsResponse object with sample credentials. ```typescript import { CredentialsResponse } from "@mistralai/mistralai/models/components"; let value: CredentialsResponse = { credentials: [ { name: "", authenticationType: "github_app", scope: "user", }, ], }; ``` -------------------------------- ### Initialize UsageInfo Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/usageinfo.md Demonstrates how to import and initialize an empty UsageInfo object. ```typescript import { UsageInfo } from "@mistralai/mistralai/models/components"; let value: UsageInfo = {}; ``` -------------------------------- ### JudgeRegressionOutput Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/updatejudgerequestoutput.md Example of how to structure a JudgeRegressionOutput object. This is used for regression tasks. ```typescript const value: components.JudgeRegressionOutput = { type: "REGRESSION", minDescription: "", maxDescription: "", }; ``` -------------------------------- ### JudgeClassificationOutput Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/updatejudgerequestoutput.md Example of how to structure a JudgeClassificationOutput object. This is used for classification tasks. ```typescript const value: components.JudgeClassificationOutput = { type: "CLASSIFICATION", options: [ { value: "", description: "round whether like yet midst than inquisitively resource cafe", }, ], }; ``` -------------------------------- ### Security Component Usage Source: https://github.com/mistralai/client-ts/blob/main/packages/mistralai-gcp/docs/models/components/security.md Demonstrates how to import and instantiate the Security component with an API key. ```APIDOC ## Security Component ### Description Represents security configuration, primarily for API key authentication. ### Fields #### Request Body - **apiKey** (string) - Required - The API key for authentication. ``` -------------------------------- ### ActivityTaskFailedResponse Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/activitytaskfailedresponse.md Example usage of ActivityTaskFailedResponse. Ensure the necessary import is included. ```typescript import { ActivityTaskFailedResponse } from "@mistralai/mistralai/models/components"; let value: ActivityTaskFailedResponse = { eventId: "", eventTimestamp: 207483, rootWorkflowExecId: "", parentWorkflowExecId: "", workflowExecId: "", workflowRunId: "", workflowName: "", attributes: { taskId: "", activityName: "", attempt: 982208, failure: { message: "", }, }, }; ``` -------------------------------- ### Initialize ClientCapabilities Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/clientcapabilities.md Demonstrates how to import and initialize an empty ClientCapabilities object. ```typescript import { ClientCapabilities } from "@mistralai/mistralai/models/components"; let value: ClientCapabilities = {}; ``` -------------------------------- ### ScheduleRecentExecution Model Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/schedulerecentexecution.md Demonstrates how to create an instance of the ScheduleRecentExecution model with sample data. Ensure you import the model from the correct path. ```typescript import { ScheduleRecentExecution } from "@mistralai/mistralai/models/components"; let value: ScheduleRecentExecution = { scheduledAt: new Date("2026-01-07T01:12:44.288Z"), startedAt: new Date("2026-02-03T19:20:29.122Z"), executionId: "", }; ``` -------------------------------- ### CodeInterpreterTool Usage Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/codeinterpretertool.md Example of how to import and instantiate the CodeInterpreterTool. ```APIDOC ## CodeInterpreterTool ### Description Represents a tool configuration for the code interpreter. ### Fields #### Request Body - **toolConfiguration** (ToolConfiguration) - Optional - Configuration for the tool. - **type** (string) - Required - Must be set to "code_interpreter". ### Request Example ```json { "type": "code_interpreter" } ``` ### Response (This section is not applicable as CodeInterpreterTool is a request model.) ``` -------------------------------- ### IngestionPipelineConfiguration Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/ingestionpipelineconfiguration.md Demonstrates how to create an instance of IngestionPipelineConfiguration with sample data. Ensure you import the necessary type from the Mistral AI client library. ```typescript import { IngestionPipelineConfiguration } from "@mistralai/mistralai/models/components"; let value: IngestionPipelineConfiguration = { id: "6fa0f879-5da0-4b46-8396-8de4465b223c", authorId: "", name: "", createdAt: new Date("2025-11-13T09:07:00.021Z"), modifiedAt: new Date("2025-03-24T22:20:58.593Z"), lastRunTime: new Date("2026-09-01T02:56:28.946Z"), lastRunChunksCount: 633906, totalChunksCount: 933405, pipelineComposition: { "key": "", "key1": "", }, }; ``` -------------------------------- ### Agent Model Instantiation Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/agent.md Demonstrates how to create an Agent object with specific configuration parameters. Ensure the 'Agent' type is imported from '@mistralai/mistralai/models/components'. ```typescript import { Agent } from "@mistralai/mistralai/models/components"; let value: Agent = { completionArgs: { responseFormat: { type: "text", }, }, model: "Challenger", name: "", id: "", version: 881139, versions: [ 484092, ], createdAt: new Date("2024-08-23T06:20:02.699Z"), updatedAt: new Date("2026-10-22T02:39:59.611Z"), deploymentChat: true, source: "", }; ``` -------------------------------- ### Get voice sample audio Source: https://github.com/mistralai/client-ts/blob/main/README.md Provides a method to get sample audio for a voice. ```APIDOC ## Audio.Voices.getSampleAudio ### Description Get voice sample audio. ### Method Not specified ### Endpoint Not specified ### Parameters Not specified ### Request Example Not specified ### Response Not specified ``` -------------------------------- ### ActivityTaskCompletedResponse Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/activitytaskcompletedresponse.md Example of how to define an ActivityTaskCompletedResponse object. Ensure all required fields are populated. ```typescript import { ActivityTaskCompletedResponse } from "@mistralai/mistralai/models/components"; let value: ActivityTaskCompletedResponse = { eventId: "", eventTimestamp: 612202, rootWorkflowExecId: "", parentWorkflowExecId: "", workflowExecId: "", workflowRunId: "", workflowName: "", attributes: { taskId: "", activityName: "", result: { value: "", }, }, }; ``` -------------------------------- ### betaLibrariesCreate Source: https://github.com/mistralai/client-ts/blob/main/README.md Creates a new library. This is the entry point for setting up a new library within the system. ```APIDOC ## betaLibrariesCreate ### Description Create a new Library. ### Method Not specified (SDK function) ### Endpoint Not specified (SDK function) ### Parameters Not specified in source text. ### Request Example Not specified in source text. ### Response Not specified in source text. ``` -------------------------------- ### Initialize GithubRepository in TypeScript Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/githubrepository.md Demonstrates how to instantiate a GithubRepository object with required fields. ```typescript import { GithubRepository } from "@mistralai/mistralai/models/components"; let value: GithubRepository = { type: "github", name: "", owner: "", commitId: "", }; ``` -------------------------------- ### Update Workflow Request Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/operations/updateworkflowv1workflowsworkflowidentifierputrequest.md This example demonstrates how to instantiate and populate the UpdateWorkflowV1WorkflowsWorkflowIdentifierPutRequest object in TypeScript. ```APIDOC ## Update Workflow Request ### Description This operation allows you to update an existing workflow. You need to provide the workflow identifier and the update request body. ### Method PUT ### Endpoint `/v1/workflows/{workflowIdentifier}` ### Parameters #### Path Parameters - **workflowIdentifier** (string) - Required - The identifier of the workflow to update. #### Request Body - **workflowUpdateRequest** (WorkflowUpdateRequest) - Required - The payload containing the updates for the workflow. ### Request Example ```json { "workflowIdentifier": "", "workflowUpdateRequest": {} } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the update operation. - **message** (string) - A message providing details about the update result. ``` -------------------------------- ### StreamError Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/operations/streamworkflowexecutionlogsdata.md Example of a components.StreamError object. The 'error' field should contain a string describing the error. ```typescript const value: components.StreamError = { error: "", }; ``` -------------------------------- ### Instantiate Dataset Model Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/dataset.md Example of creating a Dataset object with all its fields. Ensure all required fields are populated. ```typescript import { Dataset } from "@mistralai/mistralai/models/components"; let value: Dataset = { id: "c9b01052-9db6-43f6-90ab-e3cddebf25ac", createdAt: new Date("2024-12-21T08:05:24.660Z"), updatedAt: new Date("2024-03-18T16:58:39.278Z"), deletedAt: new Date("2024-02-21T08:04:28.825Z"), name: "", description: "reboot next drat observe woot armoire taut", ownerId: "33e3e0dc-abc0-4b8b-8d8e-712988ff596f", workspaceId: "f028946f-501c-4660-90a6-270805189b6c", }; ``` -------------------------------- ### WorkflowExecutionFailedResponse Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/workflowexecutionfailedresponse.md Example of how to instantiate a WorkflowExecutionFailedResponse object. Ensure you import the type from the correct module. ```typescript import { WorkflowExecutionFailedResponse } from "@mistralai/mistralai/models/components"; let value: WorkflowExecutionFailedResponse = { eventId: "", eventTimestamp: 614189, rootWorkflowExecId: "", parentWorkflowExecId: "", workflowExecId: "", workflowRunId: "", workflowName: "", attributes: { taskId: "", failure: { message: "", }, }, }; ``` -------------------------------- ### Activity Task Started Attributes Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/activitytaskstartedresponse.md Details regarding the attributes for activity task started events. ```APIDOC ## Activity Task Started Attributes ### Description Provides the structure for attributes associated with activity task started events. ### Parameters #### Attributes - **attributes** (components.ActivityTaskStartedAttributesResponse) - Required - Attributes for activity task started events. ``` -------------------------------- ### Initialize ToolExecutionConfiguration Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/toolexecutionconfiguration.md Demonstrates how to import and initialize an empty ToolExecutionConfiguration object. ```typescript import { ToolExecutionConfiguration } from "@mistralai/mistralai/models/components"; let value: ToolExecutionConfiguration = {}; ``` -------------------------------- ### Initialize ToolConfiguration Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/toolconfiguration.md Demonstrates how to import and initialize an empty ToolConfiguration object. ```typescript import { ToolConfiguration } from "@mistralai/mistralai/models/components"; let value: ToolConfiguration = {}; ``` -------------------------------- ### MCPResource Array Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/resources.md Example of declaring an array of MCPResource objects. Each object requires a name and a URI. ```typescript const value: components.MCPResource[] = [ { name: "", uri: "https://massive-foodstuffs.info/", }, ]; ``` -------------------------------- ### Initialize WebSearchPremiumTool Source: https://github.com/mistralai/client-ts/blob/main/packages/mistralai-azure/docs/models/components/websearchpremiumtool.md Demonstrates how to import and initialize a WebSearchPremiumTool object. This is the basic structure required for using the tool. ```typescript import { WebSearchPremiumTool } from "@mistralai/mistralai-azure/models/components"; let value: WebSearchPremiumTool = { type: "web_search_premium", }; ``` -------------------------------- ### Start Fine-Tuning Job Source: https://github.com/mistralai/client-ts/blob/main/docs/sdks/finetuningjobs/README.md Requests the start of a validated fine-tuning job. This operation initiates the fine-tuning process. ```APIDOC ## POST /v1/fine-tuning/jobs ### Description Request the start of a validated fine tuning job. ### Method POST ### Endpoint `/v1/fine-tuning/jobs` ### Parameters #### Request Body - **request** (operations.JobsApiRoutesFineTuningCreateFineTuningJobRequest) - Required - The request object to use for the request. - **options** (RequestOptions) - Optional - Used to set various options for making HTTP requests. - **options.fetchOptions** (RequestInit) - Optional - Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. - **options.retries** (RetryConfig) - Optional - Enables retrying HTTP requests under certain failure conditions. ### Response #### Success Response (200) - **Promise** (operations.JobsApiRoutesFineTuningCreateFineTuningJobResponse) - The response from the create fine-tuning job operation. ### Errors - **errors.SDKError** (4XX, 5XX) - Any SDK error that occurs during the request. ``` -------------------------------- ### DocumentLibraryTool Usage Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/documentlibrarytool.md Example of how to instantiate and use the DocumentLibraryTool. ```APIDOC ## DocumentLibraryTool ### Description Represents a tool configuration for searching within document libraries. ### Fields #### Request Body - **toolConfiguration** (components.ToolConfiguration) - Optional - N/A - **type** (string) - Required - Must be the string "document_library" - **libraryIds** (string[]) - Required - Ids of the library in which to search. ### Request Example ```json { "type": "document_library", "libraryIds": [ "", "", "" ] } ``` ### Response (No specific response structure defined for this model itself, as it's typically part of a larger request or configuration.) ``` -------------------------------- ### Instantiate WebSearchPremiumTool Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/websearchpremiumtool.md Demonstrates how to import and instantiate the WebSearchPremiumTool with its required type field. ```typescript import { WebSearchPremiumTool } from "@mistralai/mistralai/models/components"; let value: WebSearchPremiumTool = { type: "web_search_premium", }; ``` -------------------------------- ### ListFilesResponse Usage Example Source: https://github.com/mistralai/client-ts/blob/main/docs/models/components/listfilesresponse.md An example demonstrating how to use the ListFilesResponse type in TypeScript, including its structure and field types. ```APIDOC ## ListFilesResponse ### Description Represents the response structure for listing files, including file data and metadata. ### Fields | Field | Type | Required | Description | |---|---|---|---| | `data` | `components.FileSchema[]` | :heavy_check_mark: | N/A | | `object` | `string` | :heavy_check_mark: | N/A | | `total` | `number` | :heavy_minus_sign: | N/A | ### Example Usage ```typescript import { ListFilesResponse } from "@mistralai/mistralai/models/components"; let value: ListFilesResponse = { data: [ { id: "497f6eca-6276-4993-bfeb-53cbbbba6f09", object: "file", sizeBytes: 13000, createdAt: 1716963433, filename: "files_upload.jsonl", purpose: "batch", sampleType: "batch_request", source: "upload", }, ], object: "", }; ``` ``` -------------------------------- ### Initialize SDK with Server URL Source: https://github.com/mistralai/client-ts/blob/main/packages/mistralai-azure/README.md Override the default server by providing a server URL during SDK client initialization. This is an alternative to using a server name. ```typescript import { MistralAzure } from "@mistralai/mistralai-azure"; const mistralAzure = new MistralAzure({ serverURL: "https://api.mistral.ai", apiKey: process.env["AZURE_API_KEY"], endpoint: process.env["AZURE_ENDPOINT"], }); async function run() { const result = await mistralAzure.chat.stream({ model: "azureai", messages: [ { content: "Who is the best French painter? Answer in one short sentence.", role: "user", }, ], }); for await (const event of result) { // Handle the event } } run(); ``` -------------------------------- ### Instantiate GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest Source: https://github.com/mistralai/client-ts/blob/main/docs/models/operations/getchatcompletionfieldoptionscountsv1observabilitychatcompletionfieldsfieldnameoptionscountspostrequest.md Demonstrates how to import and create an instance of the GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest object in TypeScript. Ensure you replace placeholder values with actual data. ```typescript import { GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest, } from "@mistralai/mistralai/models/operations"; let value: GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest = { fieldName: "", fetchFieldOptionCountsRequest: {}, }; ```