import anthropic
client = anthropic.Anthropic(
base_url="https://api.infercom.ai",
api_key="your-infercom-api-key",
)
message = client.messages.create(
model="MiniMax-M2.7",
max_tokens=1024,curl --request POST \
--url https://api.infercom.ai/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "MiniMax-M2.7",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'MiniMax-M2.7',
max_tokens: 1024,
messages: [{role: 'user', content: 'Hello, how are you?'}]
})
};
fetch('https://api.infercom.ai/v1/messages', 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.infercom.ai/v1/messages",
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-M2.7',
'max_tokens' => 1024,
'messages' => [
[
'role' => 'user',
'content' => 'Hello, how are you?'
]
]
]),
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.infercom.ai/v1/messages"
payload := strings.NewReader("{\n \"model\": \"MiniMax-M2.7\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\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.infercom.ai/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"MiniMax-M2.7\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.infercom.ai/v1/messages")
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-M2.7\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_013Zva2CMHLNnXjNJJKqJ2EF",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! I'm doing well, thank you for asking. How can I help you today?"
}
],
"model": "MiniMax-M2.7",
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 12,
"output_tokens": 18
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "messages: field required"
},
"request_id": "abc123"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "The model `nonexistent-model` does not exist or you do not have access to it.",
"param": "model"
},
"request_id": "2f8274e5"
}{
"type": "error",
"error": {
"type": "not_found_error",
"message": "The model `nonexistent-model` does not exist or you do not have access to it."
},
"request_id": "req_5e55617e48434cdea3665c1d3044d8d4"
}{
"type": "error",
"error": {
"type": "not_found_error",
"message": "The requested model (MiniMax-M2.5) is not available on SambaNova Cloud."
},
"request_id": "req_dahdi1m7sdbsi2nnq710"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "The model `Qwen3-TTS-12Hz-1.7B-Base` is not available on your current plan."
},
"request_id": "req_dagknn5cohtmhkppf8d0"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "The model `nonexistent-model` does not exist or you do not have access to it.",
"param": "model"
},
"request_id": "2f8274e5"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "The model `nonexistent-model` does not exist or you do not have access to it.",
"param": "model"
},
"request_id": "2f8274e5"
}Create a message
Send a structured list of input messages and the model will generate the next message in the conversation. This endpoint is compatible with Anthropic’s Messages API format, allowing you to use the Anthropic SDK with Infercom models.
import anthropic
client = anthropic.Anthropic(
base_url="https://api.infercom.ai",
api_key="your-infercom-api-key",
)
message = client.messages.create(
model="MiniMax-M2.7",
max_tokens=1024,curl --request POST \
--url https://api.infercom.ai/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "MiniMax-M2.7",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'MiniMax-M2.7',
max_tokens: 1024,
messages: [{role: 'user', content: 'Hello, how are you?'}]
})
};
fetch('https://api.infercom.ai/v1/messages', 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.infercom.ai/v1/messages",
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-M2.7',
'max_tokens' => 1024,
'messages' => [
[
'role' => 'user',
'content' => 'Hello, how are you?'
]
]
]),
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.infercom.ai/v1/messages"
payload := strings.NewReader("{\n \"model\": \"MiniMax-M2.7\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\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.infercom.ai/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"MiniMax-M2.7\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.infercom.ai/v1/messages")
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-M2.7\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, how are you?\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_013Zva2CMHLNnXjNJJKqJ2EF",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! I'm doing well, thank you for asking. How can I help you today?"
}
],
"model": "MiniMax-M2.7",
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 12,
"output_tokens": 18
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "messages: field required"
},
"request_id": "abc123"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "The model `nonexistent-model` does not exist or you do not have access to it.",
"param": "model"
},
"request_id": "2f8274e5"
}{
"type": "error",
"error": {
"type": "not_found_error",
"message": "The model `nonexistent-model` does not exist or you do not have access to it."
},
"request_id": "req_5e55617e48434cdea3665c1d3044d8d4"
}{
"type": "error",
"error": {
"type": "not_found_error",
"message": "The requested model (MiniMax-M2.5) is not available on SambaNova Cloud."
},
"request_id": "req_dahdi1m7sdbsi2nnq710"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "The model `Qwen3-TTS-12Hz-1.7B-Base` is not available on your current plan."
},
"request_id": "req_dagknn5cohtmhkppf8d0"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "The model `nonexistent-model` does not exist or you do not have access to it.",
"param": "model"
},
"request_id": "2f8274e5"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "The model `nonexistent-model` does not exist or you do not have access to it.",
"param": "model"
},
"request_id": "2f8274e5"
}Authorizations
Infercom API Key
Headers
The API version to use. Supported but optional.
"2023-06-01"
Body
Message creation parameters
Request body for creating a message.
The model ID to use. Call GET /v1/models to retrieve the current list of available models. See available models for details.
"MiniMax-M2.7"
The conversation messages.
1Show child attributes
Show child attributes
The maximum number of tokens to generate.
x >= 11024
System prompt providing context and instructions.
Sampling temperature between 0 and 2. Unlike the Anthropic API, this endpoint has no default: omitting this parameter makes most models decode greedily, which behaves like temperature 0. Set it explicitly. See Recommended sampling parameters.
0 <= x <= 21
Nucleus sampling parameter.
0 <= x <= 1Top-K sampling. The minimum accepted value is 1; -1 and 0 are rejected with a 400. top_k has no effect unless temperature is 0.001 or above - below that, including when temperature is omitted, it is forced to 1 and decoding is greedy. When omitted, top_k is 1048576, which is effectively unrestricted. No upper bound is enforced.
x >= 1Custom stop sequences.
Whether to stream the response.
Tools the model may use.
Show child attributes
Show child attributes
How the model should use the provided tools.
- Tool Choice Auto
- Tool Choice Any
- Tool Choice Tool
Show child attributes
Show child attributes
Response
Successful response. Returns a Message object (non-streaming), or a stream of Server-Sent Events (when stream: true).
A message response from the API.
Unique message identifier.
"msg_013Zva2CMHLNnXjNJJKqJ2EF"
Object type, always "message".
"message"The role of the message author, always "assistant".
"assistant"The generated content blocks.
A text content block in an Anthropic message.
- Text Block
- Tool Use Block
Show child attributes
Show child attributes
The model used to generate the response.
"MiniMax-M2.7"
The reason generation stopped.
end_turn, max_tokens, stop_sequence, tool_use Token usage information.
Show child attributes
Show child attributes
The stop sequence that triggered stopping, if any.