Skip to main content
POST
/
messages
Python
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,
{
  "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
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.infercom.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Infercom API Key

Headers

anthropic-version
string

The API version to use. Supported but optional.

Example:

"2023-06-01"

Body

application/json

Message creation parameters

Request body for creating a message.

model
string
required

The model ID to use. Call GET /v1/models to retrieve the current list of available models. See available models for details.

Example:

"MiniMax-M2.7"

messages
Input Message · object[]
required

The conversation messages.

Minimum array length: 1
max_tokens
integer
required

The maximum number of tokens to generate.

Required range: x >= 1
Example:

1024

system

System prompt providing context and instructions.

temperature
number

Sampling temperature between 0 and 1.

Required range: 0 <= x <= 1
Example:

1

top_p
number

Nucleus sampling parameter.

Required range: 0 <= x <= 1
top_k
integer

Top-k sampling parameter.

Required range: x >= 0
stop_sequences
string[]

Custom stop sequences.

stream
boolean
default:false

Whether to stream the response.

tools
Tool · object[]

Tools the model may use.

tool_choice
Tool Choice Auto · object

How the model should use the provided tools.

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.

id
string
required

Unique message identifier.

Example:

"msg_013Zva2CMHLNnXjNJJKqJ2EF"

type
string
required

Object type, always "message".

Allowed value: "message"
role
string
required

The role of the message author, always "assistant".

Allowed value: "assistant"
content
(Text Block · object | Tool Use Block · object)[]
required

The generated content blocks.

A text content block in an Anthropic message.

model
string
required

The model used to generate the response.

Example:

"MiniMax-M2.7"

stop_reason
enum<string> | null
required

The reason generation stopped.

Available options:
end_turn,
max_tokens,
stop_sequence,
tool_use
usage
Usage · object
required

Token usage information.

stop_sequence
string | null

The stop sequence that triggered stopping, if any.