跳转到主要内容
1

安装 Anthropic SDK(推荐)

pip install anthropic
2

调用 MiniMax-M2.7

Python
import anthropic

client = anthropic.Anthropic()

message = client.messages.create(
    model="MiniMax-M2.7",
    max_tokens=1000,
    system="You are a helpful assistant.",
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "Hi, how are you?"
                }
            ]
        }
    ]
)

for block in message.content:
    if block.type == "thinking":
        print(f"Thinking:\n{block.thinking}\n")
    elif block.type == "text":
        print(f"Text:\n{block.text}\n")
3

示例输出

{
  "thinking": "The user is just greeting me casually. I should respond in a friendly, professional manner.",
  "text": "Hi there! I'm doing well, thanks for asking. I'm ready to help you with whatever you need today—whether it's coding, answering questions, brainstorming ideas, or just chatting. What can I do for you?"
}

探索更多

文本生成

探索 MiniMax 最新文本模型

图生视频

使用 Hailuo 2.3 创建图生视频任务

文生视频

使用 Hailuo 2.3 创建文生视频任务

同步语音合成

使用 Speech 2.6 进行同步语音合成

异步语音合成

使用 Speech 2.6 进行异步语音合成

音色复刻

创建音色复刻任务

音乐生成

使用 Music 2.5+ 进行音乐创作