Quick Start
Get Mistral AI working in 3 steps:Tip: You can also send
x-portkey-provider: @mistral-ai as a header and use just model="mistral-large-latest" in the request.Add Provider in Model Catalog
- Go to Model Catalog → Add Provider
- Select Mistral AI
- Choose existing credentials or create new by entering your Mistral AI API key
- Name your provider (e.g.,
mistral-ai-prod)
Complete Setup Guide →
See all setup options, code examples, and detailed instructions
Codestral Endpoint
Mistral AI provides a dedicated Codestral endpoint for code generation. Use thecustomHost property to access it:
Your Codestral requests will show up on AI Gateway logs with code snippets rendered beautifully:
Structured Output (response_format)
Mistral AI supports structured output via theresponse_format parameter. You can enforce JSON schema validation for deterministic, structured responses:
Mistral Tool Calling
Tool calling lets models trigger external tools based on conversation context. You define available functions, the model chooses when to use them, and your application executes them and returns results. The AI Gateway supports Mistral tool calling and makes it interoperable across multiple providers. With AI Gateway Prompts, you can templatize your prompts and tool schemas.OCR (Document Processing)
Mistral AI’s OCR models extract text and structured content from PDFs and images. Use the/v1/ocr endpoint:
mistral-ocr-latest, mistral-ocr-4-0
The native
/v1/ocr endpoint requires gateway version 2.18.0 or higher for hybrid (self-hosted) deployments.Managing Mistral AI Prompts
Manage all prompt templates to Mistral AI in the Prompt Library. All current Mistral AI models are supported, and you can easily test different prompts. Call thePOST /v1/prompts/{promptId}/completions endpoint to use the prompt in an application.
Next Steps
Add Metadata
Add metadata to your Mistral AI requests
Gateway Configs
Add gateway configs to your Mistral AI requests
Tracing
Trace your Mistral AI requests
Fallbacks
Setup fallback from OpenAI to Mistral AI

