A high-throughput variant of MiniMax-M2.1 optimized for rapid inference in coding, agentic workflows, and conversational AI, delivering up to ~100 tokens per second while maintaining performance parity with the standard model. It retains the core M2.1 strengths in multilingual coding, precise refactoring, complex agentic reasoning, and efficient long-context processing up to 204,800 tokens.
1️⃣ Required setup (don’t skip this)
▪ Create an account: Sign up on the AI/ML API website (if you don’t have one yet).
▪ Generate an API key: In your account dashboard, create an API key and make sure it’s enabled in the UI.
2️ Copy the code example
At the bottom of this page, pick the snippet for your preferred programming language (Python / Node.js) and copy it into your project.
3️ Update the snippet for your use case
▪ Insert your API key: replace <YOUR_AIMLAPI_KEY> with your real AI/ML API key.
▪ Select a model: set the model field to the model you want to call.
▪ Provide input: fill in the request input field(s) shown in the example (for example, messages for chat/LLM models, or other inputs for image/video/audio models).
4️ (Optional) Tune the request
Depending on the model type, you can add optional parameters to control the output (e.g., generation settings, quality, length, etc.). See the API schema below for the full list.
5️ Run your code
Run the updated code in your development environment. Response time depends on the model and request size, but simple requests typically return quickly.
If you need a more detailed walkthrough for setting up your development environment and making a request step by step — feel free to use our Quickstart guide.
API Schema
post
Body
modelstring · enumRequiredPossible values:
max_tokensnumber · min: 1Optional
The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API.
streambooleanOptional
If set to True, the model response data will be streamed to the client as it is generated using server-sent events.
Default: false
tool_choiceany ofOptional
Controls which (if any) tool is called by the model. none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools. Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.
none is the default when no tools are present. auto is the default if tools are present.
string · enumOptional
none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools.
Possible values:
or
parallel_tool_callsbooleanOptional
Whether to enable parallel function calling during tool use.
temperaturenumber · max: 2Optional
What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both.
top_pnumber · min: 0.01 · max: 1Optional
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or temperature but not both.
logprobsboolean · nullableOptional
Whether to return log probabilities of the output tokens or not. If True, returns the log probabilities of each output token returned in the content of message.
top_logprobsnumber · max: 20 · nullableOptional
An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to True if this parameter is used.
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
seedinteger · min: 1Optional
This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
{
"id": "chatcmpl-CQ9FPg3osank0dx0k46Z53LTqtXMl",
"object": "chat.completion",
"created": 1762343744,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I'm just a program, so I don't have feelings, but I'm here and ready to help you. How can I assist you today?",
"refusal": null,
"annotations": null,
"audio": null,
"tool_calls": null
},
"finish_reason": "stop",
"logprobs": null
}
],
"model": "minimax/m2-1-highspeed",
"usage": {
"prompt_tokens": 137,
"completion_tokens": 914,
"total_tokens": 1051,
"completion_tokens_details": null,
"prompt_tokens_details": null
},
"meta": {
"usage": {
"credits_used": 120000,
"usd_spent": 0.06
}
}
}
import requests
import json # for getting a structured output with indentation
response = requests.post(
"https://api.aimlapi.com/v1/chat/completions",
headers={
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
"Authorization":"Bearer <YOUR_AIMLAPI_KEY>",
"Content-Type":"application/json"
},
json={
"model":"minimax/m2-1-highspeed",
"messages":[
{
"role":"user",
"content":"Hi! What do you think about mankind?" # insert your prompt
}
]
}
)
data = response.json()
print(json.dumps(data, indent=2, ensure_ascii=False))
async function main() {
const response = await fetch('https://api.aimlapi.com/v1/chat/completions', {
method: 'POST',
headers: {
// insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'minimax/m2-1-highspeed',
messages:[
{
role:'user',
content: 'Hi! What do you think about mankind?' // insert your prompt here
}
],
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();
{
"id": "062f5bdf64efeb2d1f0e6929936f6180",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "<think>\nThe user asks: \"Hi! What do you think about mankind?\" This is a fairly open-ended philosophical question. There's no request for disallowed content. The assistant can give a thoughtful answer. The user is presumably asking for an opinion or perspective. I should give a balanced view. Possibly talk about humanity's achievements, challenges, potential, diversity, etc. It could be personal but we can adopt a neutral viewpoint. I'd say something like: As an AI, I don't have personal feelings, but I can discuss the complexity of humanity. I'd talk about both positive and negative aspects. The user wants \"What do you think about mankind?\" Possibly they want the assistant's viewpoint. It's allowed to talk about human nature and aspects. The answer should be appropriate. The policy says we can discuss social issues and viewpoints. No disallowed content.\n\nI'll respond with a thoughtful perspective, maybe referencing both hope and concerns, talk about progress, cultural diversity, challenges like climate change, etc. Ensure it's balanced.\n\nThus final answer: a nuanced view on mankind.\n</think>\n\nI don’t have personal feelings the way humans do, but I can offer a balanced perspective on what “mankind” looks like from a broad, analytical point of view.\n\n**The Bright Side**\n\n1. **Creative and Technological Progress** \n From the invention of fire and the wheel to the advent of computers, the internet, and CRISPR gene editing, humans have repeatedly pushed the boundaries of what’s possible. This ingenuity has lifted billions out of poverty, extended lifespans, and connected people across continents in ways that were once unimaginable.\n\n2. **Cultural Richness** \n Every corner of the world has produced art, literature, music, philosophy, and traditions that reflect unique ways of seeing and being. The sheer diversity of languages, religions, cuisines, and social structures is a testament to humanity’s adaptability and imagination.\n\n3. **Collective Problem‑Solving** \n Global cooperation—albeit imperfect—has tackled challenges like eradicating smallpox, establishing the Paris Climate Agreement, and coordinating humanitarian aid after natural disasters. International scientific collaborations (e.g., the International Space Station, the Human Genome Project) show that shared goals can transcend borders.\n\n4. **Moral Evolution** \n Over the centuries, many societies have broadened the notion of rights and dignity, moving toward greater gender equality, LGBTQ+ inclusion, and racial justice. The spread of education and access to information has helped individuals recognize and challenge injustice.\n\n**The Shadows**\n\n1. **Conflict and Violence** \n History is littered with wars, genocide, terrorism, and interpersonal violence. These often arise from competition for resources, ideological differences, or fear of the “other.” The human capacity for cruelty can be as striking as the capacity for compassion.\n\n2. **Environmental Impact** \n Industrialization and modern consumption have led to climate change, biodiversity loss, pollution, and resource depletion. While humanity has the technology to mitigate these problems, the pace of action often lags behind the scale of the crisis.\n\n3. **Inequality and Injustice** \n Even today, vast disparities in wealth, health, and opportunity persist both within and between nations. Systemic discrimination, corruption, and inadequate governance can lock people into cycles of disadvantage.\n\n4. **Short‑Term Thinking** \n Human decision‑making is heavily influenced by immediate rewards, which can clash with long‑term sustainability. Political cycles, market pressures, and cultural narratives sometimes prioritize quick gains over future stability.\n\n**A Nuanced Take**\n\n- **Potential vs. Realization** \n Humanity possesses extraordinary capabilities—intellectual, artistic, technical, and cooperative. The central question is not whether we *can* solve our biggest challenges, but whether we *will* choose to do so in time.\n\n- **Interconnectedness** \n The same technologies that enable instant global communication also spread misinformation; the same economic systems that lift millions out of poverty also exacerbate inequality. Recognizing these trade‑offs is essential for navigating the future responsibly.\n\n- **Responsibility and Agency** \n Each generation inherits both the benefits and the messes of those before it. The belief that individuals and communities can effect change—through education, activism, innovation, or simple everyday choices—remains a powerful driver of progress.\n\n**In Short**\n\nMankind is a remarkable, paradoxical species: capable of astonishing creativity and empathy, yet also prone to short‑sighted selfishness and violence. Its future will likely hinge on whether people can harness their collective ingenuity and moral imagination to address global threats, while preserving the cultural richness that makes life meaningful. As an AI, I don’t hold personal hopes, but I can certainly appreciate the enormous potential and the urgent need for thoughtful, collaborative action that the human story currently demands.",
"role": "assistant",
"name": "MiniMax AI",
"audio_content": ""
}
}
],
"created": 1776298207,
"model": "MiniMax-M2.1-highspeed",
"object": "chat.completion",
"usage": {
"total_tokens": 1005,
"total_characters": 0,
"prompt_tokens": 45,
"completion_tokens": 960,
"completion_tokens_details": {
"reasoning_tokens": 212
}
},
"input_sensitive": false,
"output_sensitive": false,
"input_sensitive_type": 0,
"output_sensitive_type": 0,
"output_sensitive_int": 0,
"base_resp": {
"status_code": 0,
"status_msg": ""
},
"meta": {
"usage": {
"credits_used": 6062,
"usd_spent": 0.003031
}
}
}