Mistral AI
Mistral 是现役 Small 和 Medium 产品线背后的法国实验室。Mixtral 8x7B 已于 2025 年 3 月 30 日从 API 退役。控制台仍然只用邮箱就给密钥;Free mode 和 Labs 是不要卡的部分。
Mistral 是现役 Small 和 Medium 产品线背后的法国实验室。Mixtral 8x7B 已于 2025 年 3 月 30 日从 API 退役。控制台仍然只用邮箱就给密钥;Free mode 和 Labs 是不要卡的部分。
上下文最高 256K。Labs id(labs- 前缀)免费;mistral-medium-3-5 收费。限额按组织在控制台里设定,没有公布的“每秒一次”之类。拿 Small 或 Labs 模型来试,别拿来上线。
- 免费模型
- 12
- 最大上下文
- 256K
- 免费额度
- Free mode 与 Labs
- 注册要求
- 只要邮箱,不要卡
端点
接口地址
https://api.mistral.ai/v1环境变量
MISTRAL_API_KEY速率限制
Per-org caps in the console; Labs models are free of charge- OpenAI 兼容
- 官方 SDK:Mistral SDK
- 文本
- 图像
- 代码
代码示例
npm install openaiimport OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'https://api.mistral.ai/v1',
apiKey: process.env.MISTRAL_API_KEY
})
const response = await client.chat.completions.create({
model: 'mistral-small-latest',
messages: [{ role: 'user', content: 'Explain closures in one paragraph.' }]
})
console.log(response.choices[0].message.content)pip install openaiimport os
from openai import OpenAI
client = OpenAI(
base_url="https://api.mistral.ai/v1",
api_key=os.environ["MISTRAL_API_KEY"],
)
response = client.chat.completions.create(
model="mistral-small-latest",
messages=[{"role": "user", "content": "Explain closures in one paragraph."}],
)
print(response.choices[0].message.content)curl https://api.mistral.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MISTRAL_API_KEY" \
-d '{
"model": "mistral-small-latest",
"messages": [{"role": "user", "content": "Explain closures in one paragraph."}]
}'npm install @mistralai/mistralaiimport { Mistral } from '@mistralai/mistralai'
const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY })
const response = await client.chat.complete({
model: 'mistral-small-latest',
messages: [{ role: 'user', content: 'Explain closures in one paragraph.' }]
})
console.log(response.choices[0].message.content)pip install mistralaiimport os
from mistralai import Mistral
client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
response = client.chat.complete(
model="mistral-small-latest",
messages=[{"role": "user", "content": "Explain closures in one paragraph."}],
)
print(response.choices[0].message.content)值得注意
- open-mixtral-8x7b 已于 2025 年 3 月 30 日退役。请用 mistral-small-latest 或 labs- 前缀的 id。
- mistral-medium-3-5 是付费模型(256K)。Free mode 和 Labs 才是不要卡的部分。
你能免费使用的模型12
- Mistral Small
mistral-small-latest - Mistral Small 2506
mistral-small-2506 - Mistral Nemo
open-mistral-nemo - Codestral
codestral-latest - Pixtral 12B
pixtral-12b-2409 - Labs Mistral Small
labs-mistral-small - Mistral Embed
mistral-embed - Mistral Moderation
mistral-moderation-latest - Mistral OCR
ocr-latest - Mistral Small 3.1
mistral-small-3.1-24b-instruct - Devstral Small
devstral-small-latest - Magistral Small
magistral-small-latest