Mistral Small 4 API

混合模式 统一指令,理性(Magistral),和Devstral家族:完成时间减少40%,通过量减少3x对Small 3.

Mistral AI文本生成256K 上下文发布日期 2026年3月16日专有端点

关于 Mistral Small 4

混合模式 统一指令,理性(Magistral),和Devstral家族:完成时间减少40%,通过量减少3x对Small 3.

也称为 Mistral AI Mistral Small 4, Mistral-Small-4

visionweb searchfunction calling

Mistral Small 4 规格

模型 ID
mistral-small-4
提供方
Mistral AI
类别
文本生成
发布日期
2026年3月16日
上下文窗口
256K 个 token
最大输出
65,536 个 token
输入
文本图像
输出
文本
结构化输出
JSON 模式
Batch API
可用,较目录价优惠 35%
端点
POST/v1/chat/completionsPOST/v1/responsesPOST/v1/messagesPOST/v1beta/models/mistral-small-4:generateContent
备用模型 ID
mistralai/mistral-small-4

Mistral Small 4 API 价格

来自 EmpirioLabs 目录的实时按量计费价格。只为实际用量付费,没有月度最低消费。

类型
规格
价格
投入
每1M 提示符
$0.15
产出
每1M个生成的令牌
$0.60
标准网络搜索
每个呼叫
$0.084
高级网络搜索
每个呼叫
$0.140
代码口译员
每个呼叫
$0.084
图像生成
每个图像
$0.280
在完整价格页比较

如何调用 Mistral Small 4 API

Mistral Small 4 提供 OpenAI 兼容的 Chat Completions API。用你的 EmpirioLabs API 密钥把任意 OpenAI SDK 指向 https://api.empiriolabs.ai/v1,并使用模型 ID mistral-small-4。 在EmpirioLabs 控制台获取 API 密钥。

cURL
curl https://api.empiriolabs.ai/v1/chat/completions \
  -H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mistral-small-4",
    "messages": [
      {"role": "user", "content": "Write a haiku about the ocean."}
    ]
  }'
Python (OpenAI SDK)
from openai import OpenAI

client = OpenAI(
    base_url="https://api.empiriolabs.ai/v1",
    api_key="YOUR_EMPIRIOLABS_API_KEY",
)

response = client.chat.completions.create(
    model="mistral-small-4",
    messages=[{"role": "user", "content": "Write a haiku about the ocean."}],
)
print(response.choices[0].message.content)
Mistral Small 4 API 完整参考

Mistral Small 4 API 参数

EmpirioLabs 上 Mistral Small 4 API 支持的请求参数。省略字段时使用默认值。

参数类型默认值范围 / 值描述
reasoning_enabledbooleantrue-启用扩展推理(推理映射:高|无)
tool_web_searchbooleantrue-启用web_search工具
web_search_tierenumstandardstandard, premium标准或高级网页搜索层。高级版使用更高质量的来源。
tool_code_interpreterbooleantrue-允许模型在沙盒中执行Python代码来计算和分析数据。
tool_image_generationbooleantrue-允许模型通过平台的图像生成工具内嵌生成图像。
temperaturenumber0.70 到 1.5采样温度。0 = 确定性,2 = 最大随机性。
max_tokensnumber40961 到 32768回复中最多的代币。
response_formatenum--返回输出为有效的 JSON 对象(JSON 模式)。描述你在提示词中想要的字段。
disable_formattingbooleanfalse-使用web_search工具时,跳过EmpirioLabs Markdown格式(引用[[N]](url)重写+引用块)。返回原始上游答案,带有纯[N]次引用。

须知

工具(网页搜索、代码解释器、图像生成)只有在实际调用时才计费。包含你自己函数工具的请求使用标准函数调用,而内置工具在这些请求中不可用:请求不能同时将两者结合。

Per-tool billing (usage.tool_usage)

When this model invokes built-in tools (web search, code interpreter, etc.) inside a single request, the response carries a normalized usage.tool_usage map alongside the token counts. The example below shows the shape — exact field names, units, and which tools appear can vary slightly per provider:

"usage": {
  "prompt_tokens": 123,
  "completion_tokens": 456,
  "cost_usd": 0.0042,
  "tool_usage": {"web_search": 3, "code_interpreter": 1}
}

The tool counts are already factored into cost_usd — they are surfaced for transparency so you can audit per-tool billing. The field is omitted when no tools were invoked.

Mistral Small 4 API:常见问题

Mistral Small 4 API 收费多少?

在 EmpirioLabs,Mistral Small 4 按量计费:投入 $0.15 每1M 提示符; 产出 $0.60 每1M个生成的令牌; 标准网络搜索 $0.084 每个呼叫。本页的实时价格表始终与 API 的实际计费一致。

Mistral Small 4 的上下文窗口有多大?

Mistral Small 4 支持 256K token 的上下文窗口,每次响应最多 65,536 个输出 token。

Mistral Small 4 API 兼容 OpenAI 吗?

兼容。Mistral Small 4 提供 OpenAI 兼容的 Chat Completions API,现有 OpenAI SDK 只需把 base_url 指向 https://api.empiriolabs.ai/v1 并把模型 ID 设为 mistral-small-4 即可使用。

集成之前可以在浏览器里试用 Mistral Small 4 吗?

可以。EmpirioLabs Playground在浏览器中以与 API 相同的参数运行 Mistral Small 4,你可以在写代码之前先测试提示词。

如何获取 Mistral Small 4 API 密钥?

创建 EmpirioLabs 账户,然后在控制台的 API Keys生成密钥。计费使用按量付费的额度,只为实际发出的请求付费。

准备好使用更好的终端了吗?

查看我们的定价,或者如果你想将自己的模型部署到我们的堆栈中,请联系我们。