Estimate Input Tokens
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.1-Flash",
"input": "Please write an email inviting the team to a project retrospective next Wednesday at 3 PM. Outline the agenda and remind everyone to prepare a progress summary and the open issues for the modules they own."
}
'import requests
url = "https://api.minimax.io/v1/responses/input_tokens"
payload = {
"model": "MiniMax-M3.1-Flash",
"input": "Please write an email inviting the team to a project retrospective next Wednesday at 3 PM. Outline the agenda and remind everyone to prepare a progress summary and the open issues for the modules they own."
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
model: 'MiniMax-M3.1-Flash',
input: 'Please write an email inviting the team to a project retrospective next Wednesday at 3 PM. Outline the agenda and remind everyone to prepare a progress summary and the open issues for the modules they own.'
})
};
fetch('https://api.minimax.io/v1/responses/input_tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimax.io/v1/responses/input_tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'MiniMax-M3.1-Flash',
'input' => 'Please write an email inviting the team to a project retrospective next Wednesday at 3 PM. Outline the agenda and remind everyone to prepare a progress summary and the open issues for the modules they own.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.minimax.io/v1/responses/input_tokens"
payload := strings.NewReader("{\n \"model\": \"MiniMax-M3.1-Flash\",\n \"input\": \"Please write an email inviting the team to a project retrospective next Wednesday at 3 PM. Outline the agenda and remind everyone to prepare a progress summary and the open issues for the modules they own.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.minimax.io/v1/responses/input_tokens")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"model\": \"MiniMax-M3.1-Flash\",\n \"input\": \"Please write an email inviting the team to a project retrospective next Wednesday at 3 PM. Outline the agenda and remind everyone to prepare a progress summary and the open issues for the modules they own.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimax.io/v1/responses/input_tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"model\": \"MiniMax-M3.1-Flash\",\n \"input\": \"Please write an email inviting the team to a project retrospective next Wednesday at 3 PM. Outline the agenda and remind everyone to prepare a progress summary and the open issues for the modules they own.\"\n}"
response = http.request(request)
puts response.read_body{
"object": "response.input_tokens",
"input_tokens": 234
}OpenAI Responses API
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.
POST
/
v1
/
responses
/
input_tokens
Estimate Input Tokens
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.1-Flash",
"input": "Please write an email inviting the team to a project retrospective next Wednesday at 3 PM. Outline the agenda and remind everyone to prepare a progress summary and the open issues for the modules they own."
}
'import requests
url = "https://api.minimax.io/v1/responses/input_tokens"
payload = {
"model": "MiniMax-M3.1-Flash",
"input": "Please write an email inviting the team to a project retrospective next Wednesday at 3 PM. Outline the agenda and remind everyone to prepare a progress summary and the open issues for the modules they own."
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
model: 'MiniMax-M3.1-Flash',
input: 'Please write an email inviting the team to a project retrospective next Wednesday at 3 PM. Outline the agenda and remind everyone to prepare a progress summary and the open issues for the modules they own.'
})
};
fetch('https://api.minimax.io/v1/responses/input_tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimax.io/v1/responses/input_tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'MiniMax-M3.1-Flash',
'input' => 'Please write an email inviting the team to a project retrospective next Wednesday at 3 PM. Outline the agenda and remind everyone to prepare a progress summary and the open issues for the modules they own.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.minimax.io/v1/responses/input_tokens"
payload := strings.NewReader("{\n \"model\": \"MiniMax-M3.1-Flash\",\n \"input\": \"Please write an email inviting the team to a project retrospective next Wednesday at 3 PM. Outline the agenda and remind everyone to prepare a progress summary and the open issues for the modules they own.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.minimax.io/v1/responses/input_tokens")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"model\": \"MiniMax-M3.1-Flash\",\n \"input\": \"Please write an email inviting the team to a project retrospective next Wednesday at 3 PM. Outline the agenda and remind everyone to prepare a progress summary and the open issues for the modules they own.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimax.io/v1/responses/input_tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"model\": \"MiniMax-M3.1-Flash\",\n \"input\": \"Please write an email inviting the team to a project retrospective next Wednesday at 3 PM. Outline the agenda and remind everyone to prepare a progress summary and the open issues for the modules they own.\"\n}"
response = http.request(request)
puts response.read_body{
"object": "response.input_tokens",
"input_tokens": 234
}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
Available options:
application/json Body
application/json
Model name to invoke, e.g. MiniMax-M3.1-Flash
Example:
"MiniMax-M3.1-Flash"
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: auto lets the model decide whether to call tools
Available options:
auto Output format control
Show child attributes
Show child attributes
Reasoning control. The default depends on the model, so no schema-level default is declared.
MiniMax-M3.1-Flash: reasoning is always on, including whenreasoningis omitted.effortacceptslow,medium,high,xhighormax, and does tune reasoning depth. When omitted, it defaults tomax.effort: "none"returns HTTP 400.MiniMax-M3: reasoning is off unlesseffortis set to a non-nonevalue, which turns reasoning on but does not tune its depth.- M2.x models: reasoning cannot be disabled;
effort: "none"is accepted but ignored.
Show child attributes
Show child attributes