curl --request POST \
--url https://api.minimax.io/v1/responses/input_tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"model": "MiniMax-M3",
"input": [
{
"type": "message",
"role": "user",
"content": "Please implement a generic quicksort algorithm in Python with these requirements: 1) in-place sorting to save memory; 2) three-way partitioning to handle duplicate elements; 3) switch to insertion sort for small subarrays; 4) include complete unit tests. Finally, explain the advantage of three-way partitioning over the classic Lomuto scheme when keys repeat."
}
],
"tools": [
{
"type": "function",
"name": "search_docs",
"description": "Search the official documentation of the Python standard library or a third-party package",
"parameters": {
"type": "object",
"properties": {
"library": {
"type": "string",
"description": "Library name, e.g. `typing`, `itertools`"
},
"query": {
"type": "string",
"description": "Search keywords"
}
},
"required": [
"library",
"query"
]
}
},
{
"type": "function",
"name": "run_python",
"description": "Execute Python code in a sandbox and return stdout / error",
"parameters": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Python code to execute"
},
"timeout_seconds": {
"type": "integer",
"description": "Execution timeout in seconds",
"default": 10
}
},
"required": [
"code"
]
}
}
]
}
'{
"object": "response.input_tokens",
"input_tokens": 588
}Estimate Input Tokens
Estimate the input token count of a request without invoking the model. Useful for evaluating request cost or checking context length limits before calling the main endpoint.
curl --request POST \
--url https://api.minimax.io/v1/responses/input_tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"model": "MiniMax-M3",
"input": [
{
"type": "message",
"role": "user",
"content": "Please implement a generic quicksort algorithm in Python with these requirements: 1) in-place sorting to save memory; 2) three-way partitioning to handle duplicate elements; 3) switch to insertion sort for small subarrays; 4) include complete unit tests. Finally, explain the advantage of three-way partitioning over the classic Lomuto scheme when keys repeat."
}
],
"tools": [
{
"type": "function",
"name": "search_docs",
"description": "Search the official documentation of the Python standard library or a third-party package",
"parameters": {
"type": "object",
"properties": {
"library": {
"type": "string",
"description": "Library name, e.g. `typing`, `itertools`"
},
"query": {
"type": "string",
"description": "Search keywords"
}
},
"required": [
"library",
"query"
]
}
},
{
"type": "function",
"name": "run_python",
"description": "Execute Python code in a sandbox and return stdout / error",
"parameters": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Python code to execute"
},
"timeout_seconds": {
"type": "integer",
"description": "Execution timeout in seconds",
"default": 10
}
},
"required": [
"code"
]
}
}
]
}
'{
"object": "response.input_tokens",
"input_tokens": 588
}Authorizations
HTTP: Bearer Auth
- Security Scheme Type: http
- HTTP Authorization Scheme: Bearer API_key, used to authenticate your account. View it in Account Management > API Keys
Headers
Media type of the request body. Must be set to application/json
application/json Body
Model name to invoke, e.g. MiniMax-M3
"MiniMax-M3"
Conversation content. Supports either a simple text or a full conversation history array
System instructions
Tool list
Show child attributes
Show child attributes
Tool selection strategy: none means no tool will be called; auto lets the model decide whether to call tools
none, auto Output format control
Show child attributes
Show child attributes
Reasoning control. For MiniMax-M3, reasoning is on by default and responses include a reasoning output item. Set effort to none to disable MiniMax-M3 reasoning output. The minimal, low, medium, and high values are accepted for compatibility and keep reasoning enabled; they do not tune MiniMax-M3's reasoning depth. For M2.x models, reasoning cannot be disabled.
Show child attributes
Show child attributes