
混合模式 统一指令,理性(Magistral),和Devstral家族:完成时间减少40%,通过量减少3x对Small 3.
混合模式 统一指令,理性(Magistral),和Devstral家族:完成时间减少40%,通过量减少3x对Small 3.
也称为 Mistral AI Mistral Small 4, Mistral-Small-4
mistral-small-4/v1/chat/completionsPOST/v1/responsesPOST/v1/messagesPOST/v1beta/models/mistral-small-4:generateContentmistralai/mistral-small-4来自 EmpirioLabs 目录的实时按量计费价格。只为实际用量付费,没有月度最低消费。
Mistral Small 4 提供 OpenAI 兼容的 Chat Completions API。用你的 EmpirioLabs API 密钥把任意 OpenAI SDK 指向 https://api.empiriolabs.ai/v1,并使用模型 ID mistral-small-4。 在EmpirioLabs 控制台获取 API 密钥。
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."}
]
}'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)EmpirioLabs 上 Mistral Small 4 API 支持的请求参数。省略字段时使用默认值。
| 参数 | 类型 | 默认值 | 范围 / 值 | 描述 |
|---|---|---|---|---|
| reasoning_enabled | boolean | true | - | 启用扩展推理(推理映射:高|无) |
| tool_web_search | boolean | true | - | 启用web_search工具 |
| web_search_tier | enum | standard | standard, premium | 标准或高级网页搜索层。高级版使用更高质量的来源。 |
| tool_code_interpreter | boolean | true | - | 允许模型在沙盒中执行Python代码来计算和分析数据。 |
| tool_image_generation | boolean | true | - | 允许模型通过平台的图像生成工具内嵌生成图像。 |
| temperature | number | 0.7 | 0 到 1.5 | 采样温度。0 = 确定性,2 = 最大随机性。 |
| max_tokens | number | 4096 | 1 到 32768 | 回复中最多的代币。 |
| response_format | enum | - | - | 返回输出为有效的 JSON 对象(JSON 模式)。描述你在提示词中想要的字段。 |
| disable_formatting | boolean | false | - | 使用web_search工具时,跳过EmpirioLabs Markdown格式(引用[[N]](url)重写+引用块)。返回原始上游答案,带有纯[N]次引用。 |
工具(网页搜索、代码解释器、图像生成)只有在实际调用时才计费。包含你自己函数工具的请求使用标准函数调用,而内置工具在这些请求中不可用:请求不能同时将两者结合。
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.
在 EmpirioLabs,Mistral Small 4 按量计费:投入 $0.15 每1M 提示符; 产出 $0.60 每1M个生成的令牌; 标准网络搜索 $0.084 每个呼叫。本页的实时价格表始终与 API 的实际计费一致。
Mistral Small 4 支持 256K token 的上下文窗口,每次响应最多 65,536 个输出 token。
兼容。Mistral Small 4 提供 OpenAI 兼容的 Chat Completions API,现有 OpenAI SDK 只需把 base_url 指向 https://api.empiriolabs.ai/v1 并把模型 ID 设为 mistral-small-4 即可使用。
可以。EmpirioLabs Playground在浏览器中以与 API 相同的参数运行 Mistral Small 4,你可以在写代码之前先测试提示词。
创建 EmpirioLabs 账户,然后在控制台的 API Keys生成密钥。计费使用按量付费的额度,只为实际发出的请求付费。