files.upload takes content_base64 and filename; audio.transcribe takes content_base64 with filename, or file_url or file_id instead; voices.create takes sample_audio and an optional sample_filename; ocr.process takes its document as a URL ({ type: 'document_url', document_url } for a PDF, { type: 'image_url', image_url } for an image) or as the file_id of an uploaded file ({ type: 'file', file_id }); document_url and image_url also accept a base64 data URL such as data:application/pdf;base64,... or data:image/png;base64,.... files.getSignedUrl gives a download link for a file’s content, such as a batch job’s results.
A batch job runs on Mistral after batch.create returns. Follow it with batch.get({ job_id }) until status is SUCCESS (read output_file with files.getSignedUrl), or FAILED, TIMEOUT_EXCEEDED or CANCELLED. QUEUED, RUNNING and CANCELLATION_REQUESTED mean it is still going.
agents.* other than agents.complete are Mistral beta endpoints. A 422 from Mistral names each rejected field in the error message, for example body.messages.0.content: Field required.
What you get:
- 52 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the Mistral AI API key before the first call: More: API Key
pnpm corsair setup --plugin=mistralai --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
List the models this key can useWhat’s next
API reference
Every
mistralai.api.* operation with input and output types.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.