Chat Completions
Creates a model response for the given chat conversation.
curl --request POST \
--url https://api.aerspan.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "minimax/minimax-m2.1",
"messages": [
{
"role": "user",
"content": "What opportunities and challenges will the Chinese large model industry face in 2025?"
}
],
"stream": false,
"max_tokens": 4096,
"enable_thinking": false,
"thinking_budget": 4096,
"min_p": 0.05,
"stop": null,
"temperature": 0.7,
"top_p": 0.7,
"top_k": 50,
"frequency_penalty": 0.5,
"n": 1,
"response_format": {
"type": "text"
},
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": false
}
}
]
}
'import requests
url = "https://api.aerspan.com/v1/chat/completions"
payload = {
"model": "minimax/minimax-m2.1",
"messages": [
{
"role": "user",
"content": "What opportunities and challenges will the Chinese large model industry face in 2025?"
}
],
"stream": False,
"max_tokens": 4096,
"enable_thinking": False,
"thinking_budget": 4096,
"min_p": 0.05,
"stop": None,
"temperature": 0.7,
"top_p": 0.7,
"top_k": 50,
"frequency_penalty": 0.5,
"n": 1,
"response_format": { "type": "text" },
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": False
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'minimax/minimax-m2.1',
messages: [
{
role: 'user',
content: 'What opportunities and challenges will the Chinese large model industry face in 2025?'
}
],
stream: false,
max_tokens: 4096,
enable_thinking: false,
thinking_budget: 4096,
min_p: 0.05,
stop: null,
temperature: 0.7,
top_p: 0.7,
top_k: 50,
frequency_penalty: 0.5,
n: 1,
response_format: {type: 'text'},
tools: [
{
type: 'function',
function: {name: '<string>', description: '<string>', parameters: {}, strict: false}
}
]
})
};
fetch('https://api.aerspan.com/v1/chat/completions', 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.aerspan.com/v1/chat/completions",
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/minimax-m2.1',
'messages' => [
[
'role' => 'user',
'content' => 'What opportunities and challenges will the Chinese large model industry face in 2025?'
]
],
'stream' => false,
'max_tokens' => 4096,
'enable_thinking' => false,
'thinking_budget' => 4096,
'min_p' => 0.05,
'stop' => null,
'temperature' => 0.7,
'top_p' => 0.7,
'top_k' => 50,
'frequency_penalty' => 0.5,
'n' => 1,
'response_format' => [
'type' => 'text'
],
'tools' => [
[
'type' => 'function',
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
],
'strict' => false
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.aerspan.com/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"minimax/minimax-m2.1\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What opportunities and challenges will the Chinese large model industry face in 2025?\"\n }\n ],\n \"stream\": false,\n \"max_tokens\": 4096,\n \"enable_thinking\": false,\n \"thinking_budget\": 4096,\n \"min_p\": 0.05,\n \"stop\": null,\n \"temperature\": 0.7,\n \"top_p\": 0.7,\n \"top_k\": 50,\n \"frequency_penalty\": 0.5,\n \"n\": 1,\n \"response_format\": {\n \"type\": \"text\"\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": false\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.aerspan.com/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"minimax/minimax-m2.1\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What opportunities and challenges will the Chinese large model industry face in 2025?\"\n }\n ],\n \"stream\": false,\n \"max_tokens\": 4096,\n \"enable_thinking\": false,\n \"thinking_budget\": 4096,\n \"min_p\": 0.05,\n \"stop\": null,\n \"temperature\": 0.7,\n \"top_p\": 0.7,\n \"top_k\": 50,\n \"frequency_penalty\": 0.5,\n \"n\": 1,\n \"response_format\": {\n \"type\": \"text\"\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": false\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aerspan.com/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"minimax/minimax-m2.1\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What opportunities and challenges will the Chinese large model industry face in 2025?\"\n }\n ],\n \"stream\": false,\n \"max_tokens\": 4096,\n \"enable_thinking\": false,\n \"thinking_budget\": 4096,\n \"min_p\": 0.05,\n \"stop\": null,\n \"temperature\": 0.7,\n \"top_p\": 0.7,\n \"top_k\": 50,\n \"frequency_penalty\": 0.5,\n \"n\": 1,\n \"response_format\": {\n \"type\": \"text\"\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": false\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"choices": [
{
"message": {
"role": "assistant",
"content": "<string>",
"reasoning_content": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"created": 123,
"model": "<string>",
"object": "chat.completion"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Body
- LLM
- VLM
Corresponding Model Name. To better enhance service quality, we will make periodic changes to the models provided by this service, including but not limited to model on/offlining and adjustments to model service capabilities. We will notify you of such changes through appropriate means such as announcements or message pushes where feasible.
minimax-m2.1, deepseek-v3-0324, deepseek-v3, deepseek-v3.1, deepseek-v3.2, deepseek-r1, deepseek-r1-0528, glm-4.6, glm-4.6v, glm-4.7, qwen3-coder-480b-a35b-instruct, qwen3-235b-a22b-instruct-2507, gpt-oss-120b, gpt-oss-20b "minimax/minimax-m2.1"
The maximum number of tokens to generate. Ensure that input tokens + max_tokens do not exceed the model’s context window. As some services are still being updated, avoid setting max_tokens to the window’s upper bound; reserve ~10k tokens as buffer for input and system overhead. See Models(https://app.aerspan.com/models) for details.
4096
Switches between thinking and non-thinking modes. Default is True. This field supports the following models:
- Qwen/Qwen3-8B
- Qwen/Qwen3-14B
- Qwen/Qwen3-32B
- wen/Qwen3-30B-A3B
- Qwen/Qwen3-235B-A22B
- tencent/Hunyuan-A13B-Instruct
- zai-org/GLM-4.6V
- zai-org/GLM-4.5V
- deepseek-ai/DeepSeek-V3.1
- deepseek-ai/DeepSeek-V3.1-Terminus
- deepseek-ai/DeepSeek-V3.2-Exp
- deepseek-ai/DeepSeek-V3.2
If you want to use the function call feature for deepseek-ai/DeepSeek-V3.1, you need to set enable_thinking to false.
false
Was this page helpful?
curl --request POST \
--url https://api.aerspan.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "minimax/minimax-m2.1",
"messages": [
{
"role": "user",
"content": "What opportunities and challenges will the Chinese large model industry face in 2025?"
}
],
"stream": false,
"max_tokens": 4096,
"enable_thinking": false,
"thinking_budget": 4096,
"min_p": 0.05,
"stop": null,
"temperature": 0.7,
"top_p": 0.7,
"top_k": 50,
"frequency_penalty": 0.5,
"n": 1,
"response_format": {
"type": "text"
},
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": false
}
}
]
}
'import requests
url = "https://api.aerspan.com/v1/chat/completions"
payload = {
"model": "minimax/minimax-m2.1",
"messages": [
{
"role": "user",
"content": "What opportunities and challenges will the Chinese large model industry face in 2025?"
}
],
"stream": False,
"max_tokens": 4096,
"enable_thinking": False,
"thinking_budget": 4096,
"min_p": 0.05,
"stop": None,
"temperature": 0.7,
"top_p": 0.7,
"top_k": 50,
"frequency_penalty": 0.5,
"n": 1,
"response_format": { "type": "text" },
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": False
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'minimax/minimax-m2.1',
messages: [
{
role: 'user',
content: 'What opportunities and challenges will the Chinese large model industry face in 2025?'
}
],
stream: false,
max_tokens: 4096,
enable_thinking: false,
thinking_budget: 4096,
min_p: 0.05,
stop: null,
temperature: 0.7,
top_p: 0.7,
top_k: 50,
frequency_penalty: 0.5,
n: 1,
response_format: {type: 'text'},
tools: [
{
type: 'function',
function: {name: '<string>', description: '<string>', parameters: {}, strict: false}
}
]
})
};
fetch('https://api.aerspan.com/v1/chat/completions', 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.aerspan.com/v1/chat/completions",
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/minimax-m2.1',
'messages' => [
[
'role' => 'user',
'content' => 'What opportunities and challenges will the Chinese large model industry face in 2025?'
]
],
'stream' => false,
'max_tokens' => 4096,
'enable_thinking' => false,
'thinking_budget' => 4096,
'min_p' => 0.05,
'stop' => null,
'temperature' => 0.7,
'top_p' => 0.7,
'top_k' => 50,
'frequency_penalty' => 0.5,
'n' => 1,
'response_format' => [
'type' => 'text'
],
'tools' => [
[
'type' => 'function',
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
],
'strict' => false
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.aerspan.com/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"minimax/minimax-m2.1\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What opportunities and challenges will the Chinese large model industry face in 2025?\"\n }\n ],\n \"stream\": false,\n \"max_tokens\": 4096,\n \"enable_thinking\": false,\n \"thinking_budget\": 4096,\n \"min_p\": 0.05,\n \"stop\": null,\n \"temperature\": 0.7,\n \"top_p\": 0.7,\n \"top_k\": 50,\n \"frequency_penalty\": 0.5,\n \"n\": 1,\n \"response_format\": {\n \"type\": \"text\"\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": false\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.aerspan.com/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"minimax/minimax-m2.1\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What opportunities and challenges will the Chinese large model industry face in 2025?\"\n }\n ],\n \"stream\": false,\n \"max_tokens\": 4096,\n \"enable_thinking\": false,\n \"thinking_budget\": 4096,\n \"min_p\": 0.05,\n \"stop\": null,\n \"temperature\": 0.7,\n \"top_p\": 0.7,\n \"top_k\": 50,\n \"frequency_penalty\": 0.5,\n \"n\": 1,\n \"response_format\": {\n \"type\": \"text\"\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": false\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aerspan.com/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"minimax/minimax-m2.1\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What opportunities and challenges will the Chinese large model industry face in 2025?\"\n }\n ],\n \"stream\": false,\n \"max_tokens\": 4096,\n \"enable_thinking\": false,\n \"thinking_budget\": 4096,\n \"min_p\": 0.05,\n \"stop\": null,\n \"temperature\": 0.7,\n \"top_p\": 0.7,\n \"top_k\": 50,\n \"frequency_penalty\": 0.5,\n \"n\": 1,\n \"response_format\": {\n \"type\": \"text\"\n },\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": false\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"choices": [
{
"message": {
"role": "assistant",
"content": "<string>",
"reasoning_content": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"created": 123,
"model": "<string>",
"object": "chat.completion"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}