Mistral AI
Mistral AI ↗ helps you build quickly with Mistral's advanced AI models.
https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/mistralWhen making requests to the Mistral AI, you will need:
- AI Gateway Account ID
 - AI Gateway gateway name
 - Mistral AI API token
 - Mistral AI model name
 
Your new base URL will use the data above in this structure: https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/mistral/.
Then you can append the endpoint you want to hit, for example: v1/chat/completions
So your final URL will come together as: https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/mistral/v1/chat/completions.
curl -X POST https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/mistral/v1/chat/completions \ --header 'content-type: application/json' \ --header 'Authorization: Bearer MISTRAL_TOKEN' \ --data '{    "model": "mistral-large-latest",    "messages": [        {            "role": "user",            "content": "What is Cloudflare?"        }    ]}'If you are using the @mistralai/mistralai package, you can set your endpoint like this:
import { Mistral } from "@mistralai/mistralai";
const client = new Mistral({  apiKey: MISTRAL_TOKEN,  serverURL: `https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/mistral`,});
await client.chat.create({  model: "mistral-large-latest",  messages: [    {      role: "user",      content: "What is Cloudflare?",    },  ],});You can also use the OpenAI-compatible endpoint (/ai-gateway/usage/chat-completion/) to access Mistral models using the OpenAI API schema. To do so, send your requests to:
https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/compat/chat/completionsSpecify:
{"model": "mistral/{model}"}Was this helpful?
- Resources
 - API
 - New to Cloudflare?
 - Directory
 - Sponsorships
 - Open Source
 
- Support
 - Help Center
 - System Status
 - Compliance
 - GDPR
 
- Company
 - cloudflare.com
 - Our team
 - Careers
 
- © 2025 Cloudflare, Inc.
 - Privacy Policy
 - Terms of Use
 - Report Security Issues
 - Trademark