Skip to content

Commit 5b540ea

Browse files
techpro-aimlapigitbook-bot
authored andcommitted
GITBOOK-483: docs: add 2 kimi2 and minimax m2
1 parent 2c3c6ee commit 5b540ea

13 files changed

Lines changed: 835 additions & 16 deletions

File tree

docs/SUMMARY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
* [MiniMax](api-references/text-models-llm/MiniMax/README.md)
7676
* [text-01](api-references/text-models-llm/MiniMax/text-01.md)
7777
* [m1](api-references/text-models-llm/minimax/m1.md)
78+
* [m2](api-references/text-models-llm/minimax/m2.md)
7879
* [Mistral AI](api-references/text-models-llm/Mistral-AI/README.md)
7980
* [codestral-2501](api-references/text-models-llm/Mistral-AI/codestral-2501.md)
8081
* [mistral-nemo](api-references/text-models-llm/Mistral-AI/mistral-nemo.md)
@@ -83,6 +84,7 @@
8384
* [Mixtral-8x7B-Instruct](api-references/text-models-llm/Mistral-AI/Mixtral-8x7B-Instruct-v0.1.md)
8485
* [Moonshot](api-references/text-models-llm/moonshot/README.md)
8586
* [kimi-k2-preview](api-references/text-models-llm/moonshot/kimi-k2-preview.md)
87+
* [kimi-k2-turbo-preview](api-references/text-models-llm/moonshot/kimi-k2-turbo-preview.md)
8688
* [NousResearch](api-references/text-models-llm/nousresearch/README.md)
8789
* [hermes-4-405b](api-references/text-models-llm/nousresearch/hermes-4-405b.md)
8890
* [NVIDIA](api-references/text-models-llm/NVIDIA/README.md)
@@ -176,6 +178,7 @@
176178
* [Stable Diffusion v3.5 Large](api-references/image-models/Stability-AI/stable-diffusion-v35-large.md)
177179
* [Tencent](api-references/image-models/tencent/README.md)
178180
* [Hunyuan Image V3](api-references/image-models/tencent/hunyuan-image-v3-text-to-image.md)
181+
* [Hunyuan Part](api-references/image-models/tencent/hunyuan-part.md)
179182
* [Topaz Labs](api-references/image-models/topaz-labs/README.md)
180183
* [Sharpen](api-references/image-models/topaz-labs/sharpen.md)
181184
* [Sharpen Generative](api-references/image-models/topaz-labs/sharpen-generative.md)
@@ -202,6 +205,7 @@
202205
* [Seedance 1.0 pro (Text-to-Video)](api-references/video-models/bytedance/seedance-1.0-pro-text-to-video.md)
203206
* [Seedance 1.0 pro (Image-to-Video)](api-references/video-models/bytedance/seedance-1.0-pro-image-to-video.md)
204207
* [OmniHuman](api-references/video-models/bytedance/omnihuman.md)
208+
* [OmniHuman 1.5](api-references/video-models/bytedance/omnihuman-1.5.md)
205209
* [Google](api-references/video-models/google/README.md)
206210
* [Veo 2 (Text-to-Video)](api-references/video-models/google/veo2-text-to-video.md)
207211
* [Veo 2 (Image-to-Video)](api-references/video-models/google/veo2-image-to-video.md)

docs/api-references/image-models/tencent/hunyuan-image-v3-text-to-image.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Hunyuan Image V3
22

33
{% columns %}
4-
{% column width="75%" %}
4+
{% column width="66.66666666666666%" %}
55
{% hint style="info" %}
66
This documentation is valid for the following list of our models:
77

88
* `hunyuan/hunyuan-image-v3-text-to-image`
99
{% endhint %}
1010
{% endcolumn %}
1111

12-
{% column width="25%" %}
12+
{% column width="33.33333333333334%" %}
1313
<a href="https://aimlapi.com/app/?model=hunyuan/hunyuan-image-v3-text-to-image&#x26;mode=image" class="button primary">Try in Playground</a>
1414
{% endcolumn %}
1515
{% endcolumns %}
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
hidden: true
3+
noIndex: true
4+
---
5+
6+
# Hunyuan Part
7+
8+
{% columns %}
9+
{% column width="66.66666666666666%" %}
10+
{% hint style="info" %}
11+
This documentation is valid for the following list of our models:
12+
13+
* `tencent/hunyuan-part`
14+
{% endhint %}
15+
{% endcolumn %}
16+
17+
{% column width="33.33333333333334%" %}
18+
<a href="https://aimlapi.com/app/?model=hunyuan/hunyuan-image-v3-text-to-image&#x26;mode=image" class="button primary">Try in Playground</a>
19+
{% endcolumn %}
20+
{% endcolumns %}
21+
22+
## Model Overview
23+
24+
An advanced capabilities of Hunyuan Image 3.0 to generate compelling visuals that seamlessly enhance and communicate your written content.
25+
26+
## Setup your API Key
27+
28+
If you don’t have an API key for the AI/ML API yet, feel free to use our [Quickstart guide](https://docs.aimlapi.com/quickstart/setting-up).
29+
30+
## API Schema
31+
32+
{% openapi-operation spec="hunyuan-image-v3-text-to-image" path="/v1/images/generations" method="post" %}
33+
[OpenAPI hunyuan-image-v3-text-to-image](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/image-models/Tencent/hunyuan-image-v3-text-to-image.json)
34+
{% endopenapi-operation %}
35+
36+
## Quick Example
37+
38+
Let's generate an image using a simple prompt.
39+
40+
{% tabs %}
41+
{% tab title="Python" %}
42+
{% code overflow="wrap" %}
43+
```python
44+
import requests
45+
import json
46+
47+
def main():
48+
response = requests.post(
49+
"https://api.aimlapi.com/v1/images/generations",
50+
headers={
51+
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
52+
"Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
53+
"Content-Type": "application/json",
54+
},
55+
json={
56+
"prompt": "A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.",
57+
"model": "hunyuan/hunyuan-image-v3-text-to-image",
58+
"image_size": "landscape_16_9"
59+
}
60+
)
61+
62+
data = response.json()
63+
print(json.dumps(data, indent=2, ensure_ascii=False))
64+
65+
if __name__ == "__main__":
66+
main()
67+
```
68+
{% endcode %}
69+
{% endtab %}
70+
71+
{% tab title="JS" %}
72+
{% code overflow="wrap" %}
73+
```javascript
74+
async function main() {
75+
const response = await fetch('https://api.aimlapi.com/v1/images/generations', {
76+
method: 'POST',
77+
headers: {
78+
// Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
79+
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
80+
'Content-Type': 'application/json',
81+
},
82+
body: JSON.stringify({
83+
model: 'hunyuan/hunyuan-image-v3-text-to-image',
84+
prompt: 'A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses. Realistic photo.',
85+
image_size: 'landscape_16_9'
86+
}),
87+
});
88+
89+
const data = await response.json();
90+
console.log(data);
91+
}
92+
93+
main();
94+
```
95+
{% endcode %}
96+
{% endtab %}
97+
{% endtabs %}
98+
99+
<details>
100+
101+
<summary>Response</summary>
102+
103+
{% code overflow="wrap" %}
104+
```json5
105+
{
106+
"data": [
107+
{
108+
"url": "https://v3b.fal.media/files/b/lion/JdrvNguTlt29LmURRbKKN.png",
109+
"content_type": "image/png",
110+
"file_name": null,
111+
"file_size": null,
112+
"width": 1280,
113+
"height": 768
114+
}
115+
],
116+
"meta": {
117+
"usage": {
118+
"tokens_used": 210000
119+
}
120+
}
121+
}
122+
```
123+
{% endcode %}
124+
125+
</details>
126+
127+
We obtained the following 1280x768 image by running this code example:
128+
129+
<figure><img src="https://v3b.fal.media/files/b/lion/JdrvNguTlt29LmURRbKKN.png" alt=""><figcaption><p>A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.</p></figcaption></figure>

docs/api-references/model-database.md

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

docs/api-references/text-models-llm/README.md

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# m2
2+
3+
<table data-header-hidden data-full-width="true"><thead><tr><th width="546.4443969726562" valign="top"></th><th width="202.666748046875" valign="top"></th></tr></thead><tbody><tr><td valign="top"><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>This documentation is valid for the following list of our models:</p><ul><li><code>minimax/m2</code></li></ul></div></td><td valign="top"><a href="https://aimlapi.com/app/?model=minimax/m2&#x26;mode=chat" class="button primary">Try in Playground</a></td></tr></tbody></table>
4+
5+
## Model Overview
6+
7+
A high-performance language model optimized for coding and autonomous agent workflows.
8+
9+
## How to Make a Call
10+
11+
<details>
12+
13+
<summary>Step-by-Step Instructions</summary>
14+
15+
### :digit\_one: Setup You Can’t Skip
16+
17+
:black\_small\_square: [**Create an Account**](https://aimlapi.com/app/sign-up): Visit the AI/ML API website and create an account (if you don’t have one yet).\
18+
:black\_small\_square: [**Generate an API Key**](https://aimlapi.com/app/keys): After logging in, navigate to your account dashboard and generate your API key. Ensure that key is enabled on UI.
19+
20+
### :digit\_two: Copy the code example
21+
22+
At the bottom of this page, you'll find [a code example](m2.md#code-example) that shows how to structure the request. Choose the code snippet in your preferred programming language and copy it into your development environment.
23+
24+
### :digit\_three: Modify the code example
25+
26+
:black\_small\_square: Replace `<YOUR_AIMLAPI_KEY>` with your actual AI/ML API key from your account.\
27+
:black\_small\_square: Insert your question or request into the `content` field—this is what the model will respond to.
28+
29+
### :digit\_four: <sup><sub><mark style="background-color:yellow;">(Optional)<mark style="background-color:yellow;"><sub></sup> Adjust other optional parameters if needed
30+
31+
Only `model` and `messages` are required parameters for this model (and we’ve already filled them in for you in the example), but you can include optional parameters if needed to adjust the model’s behavior. Below, you can find the corresponding [API schema](m2.md#api-schema), which lists all available parameters along with notes on how to use them.
32+
33+
### :digit\_five: Run your modified code
34+
35+
Run your modified code in your development environment. Response time depends on various factors, but for simple prompts it rarely exceeds a few seconds.
36+
37+
{% hint style="success" %}
38+
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](../../../quickstart/setting-up.md).
39+
{% endhint %}
40+
41+
</details>
42+
43+
## API Schema
44+
45+
{% openapi-operation spec="m2" path="/v1/chat/completions" method="post" %}
46+
[OpenAPI m2](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/text-models-llm/MiniMax/m2.json)
47+
{% endopenapi-operation %}
48+
49+
## Code Example
50+
51+
{% tabs %}
52+
{% tab title="Python" %}
53+
{% code overflow="wrap" %}
54+
```python
55+
import requests
56+
import json # for getting a structured output with indentation
57+
58+
response = requests.post(
59+
"https://api.aimlapi.com/v1/chat/completions",
60+
headers={
61+
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
62+
"Authorization":"Bearer <YOUR_AIMLAPI_KEY>",
63+
"Content-Type":"application/json"
64+
},
65+
json={
66+
"model":"minimax/m2",
67+
"messages":[
68+
{
69+
"role":"user",
70+
"content":"Hello" # insert your prompt here, instead of Hello
71+
}
72+
]
73+
}
74+
)
75+
76+
data = response.json()
77+
print(json.dumps(data, indent=2, ensure_ascii=False))
78+
```
79+
{% endcode %}
80+
{% endtab %}
81+
82+
{% tab title="JavaScript" %}
83+
{% code overflow="wrap" %}
84+
```javascript
85+
async function main() {
86+
const response = await fetch('https://api.aimlapi.com/v1/chat/completions', {
87+
method: 'POST',
88+
headers: {
89+
// insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>
90+
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
91+
'Content-Type': 'application/json',
92+
},
93+
body: JSON.stringify({
94+
model: 'minimax/m2',
95+
messages:[
96+
{
97+
role:'user',
98+
content: 'Hello' // insert your prompt here, instead of Hello
99+
}
100+
],
101+
}),
102+
});
103+
104+
const data = await response.json();
105+
console.log(JSON.stringify(data, null, 2));
106+
}
107+
108+
main();
109+
```
110+
{% endcode %}
111+
{% endtab %}
112+
{% endtabs %}
113+
114+
<details>
115+
116+
<summary>Response</summary>
117+
118+
{% code overflow="wrap" %}
119+
```json5
120+
{
121+
"id": "0557b8f7fa197172a75531a82ae6c887",
122+
"object": "chat.completion",
123+
"choices": [
124+
{
125+
"index": 0,
126+
"finish_reason": "stop",
127+
"message": {
128+
"role": "assistant",
129+
"content": "<think>\nThe user says \"Hello\". This is a simple greeting. There's no request. According to policy, we respond politely, perhaps ask how we can help. So answer \"Hello! How can I assist you today?\" Should keep tone friendly.\n\nThus final answer.\n</think>\n\nHello! How can I help you today?"
130+
}
131+
}
132+
],
133+
"created": 1762166263,
134+
"model": "MiniMax-M2",
135+
"usage": {
136+
"prompt_tokens": 26,
137+
"completion_tokens": 159,
138+
"total_tokens": 185
139+
}
140+
}
141+
```
142+
{% endcode %}
143+
144+
</details>

docs/api-references/text-models-llm/moonshot/kimi-k2-preview.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# kimi-k2-preview
22

3-
<table data-header-hidden data-full-width="true"><thead><tr><th width="546.4443969726562" valign="top"></th><th width="202.666748046875" valign="top"></th></tr></thead><tbody><tr><td valign="top"><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>This documentation is valid for the following model: <br> <code>moonshot/kimi-k2-preview</code></p></div></td><td valign="top"><a href="https://aimlapi.com/app/?model=moonshot/kimi-k2-preview&#x26;mode=chat" class="button primary">Try in Playground</a></td></tr></tbody></table>
3+
<table data-header-hidden data-full-width="true"><thead><tr><th width="546.4443969726562" valign="top"></th><th width="202.666748046875" valign="top"></th></tr></thead><tbody><tr><td valign="top"><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>This documentation is valid for the following list of our models:</p><ul><li> <code>moonshot/kimi-k2-preview</code> </li><li><code>moonshot/kimi-k2-0905-preview</code> </li></ul></div></td><td valign="top"><a href="https://aimlapi.com/app/?model=moonshot/kimi-k2-preview&#x26;mode=chat" class="button primary">Try in Playground</a> <br><a href="https://aimlapi.com/app/?model=moonshot/kimi-k2-0905-preview&#x26;mode=chat" class="button primary">Try in Playground</a></td></tr></tbody></table>
44

55
## Model Overview
66

7-
A mixture-of-experts model with strong reasoning, coding, and agentic capabilities.
7+
`moonshot/kimi-k2-preview` (July 2025) is a mixture-of-experts model with strong reasoning, coding, and agentic capabilities.
8+
9+
`moonshot/kimi-k2-0905-preview` (September 2025) is an upgraded version with improved grounding, better instruction following, and a stronger focus on coding and agentic tasks. The memory has doubled from 128k to a decent 256k tokens.
810

911
## How to Make a Call
1012

@@ -63,7 +65,7 @@ response = requests.post(
6365
"Content-Type":"application/json"
6466
},
6567
json={
66-
"model":"moonshot/kimi-k2-preview",
68+
"model":"moonshot/kimi-k2-0905-preview",
6769
"messages":[
6870
{
6971
"role":"user",
@@ -91,7 +93,7 @@ async function main() {
9193
'Content-Type': 'application/json',
9294
},
9395
body: JSON.stringify({
94-
model: 'moonshot/kimi-k2-preview',
96+
model: 'moonshot/kimi-k2-0905-preview',
9597
messages:[
9698
{
9799
role:'user',
@@ -118,7 +120,7 @@ main();
118120
{% code overflow="wrap" %}
119121
```json5
120122
{
121-
"id": "chatcmpl-6881021ed173a2ae63fab92b",
123+
"id": "chatcmpl-6908c55b7589dac387b2bd3b",
122124
"object": "chat.completion",
123125
"choices": [
124126
{
@@ -130,12 +132,12 @@ main();
130132
}
131133
}
132134
],
133-
"created": 1753285150,
134-
"model": "kimi-k2-0711-preview",
135+
"created": 1762182491,
136+
"model": "kimi-k2-0905-preview",
135137
"usage": {
136-
"prompt_tokens": 11,
138+
"prompt_tokens": 3,
137139
"completion_tokens": 53,
138-
"total_tokens": 64
140+
"total_tokens": 56
139141
}
140142
}
141143
```
@@ -170,7 +172,7 @@ def search_impl(arguments: Dict[str, Any]) -> Any:
170172
def chat(messages):
171173
url = f"{BASE_URL}/chat/completions"
172174
payload = {
173-
"model": "moonshot/kimi-k2-preview",
175+
"model": "moonshot/kimi-k2-0905-preview",
174176
"messages": messages,
175177
"temperature": 0.6,
176178
"tools": [

0 commit comments

Comments
 (0)