跳转到主要内容
POST
Token 估算

授权

Authorization
string
header
必填

HTTP: Bearer Auth

  • Security Scheme Type: http
  • HTTP Authorization Scheme: Bearer API_key,用于验证账户信息,可在 账户管理>接口密钥 中查看

请求头

Content-Type
enum<string>
默认值:application/json
必填

请求体的媒介类型,请设置为 application/json,确保请求数据的格式为 JSON

可用选项:
application/json

请求体

application/json
model
string
必填

调用的模型名称,如 MiniMax-M3

示例:

"MiniMax-M3"

input
必填

对话内容,支持简单文本或完整对话历史数组

instructions
string

系统指令

tools
object[]

工具列表

tool_choice
enum<string>

工具选择策略:none 表示不调用任何工具;auto 表示由模型自动判断是否调用工具

可用选项:
none,
auto
text
object

输出格式控制

reasoning
object

推理控制。对于 MiniMax-M3,默认为 none,即关闭推理。将 effort 设置为非 none 值(minimallowmediumhigh),即可开启 Adaptive Thinking,但不会调节 MiniMax-M3 的推理深度。对于 M2.x 模型,推理无法关闭。

响应

200 - application/json

成功响应

object
enum<string>
必填

对象类型,固定为 response.input_tokens

可用选项:
response.input_tokens
input_tokens
integer
必填

估算的输入 token 数