PixMind Docs
API 参考语言模型Claude Sonnet 5.5

Claude Sonnet 5.5 聊天补全

通过 PixMind 调用 Claude Sonnet 5.5,查看 Token 价格、缓存费率和请求参数。

使用 Claude Sonnet 5.5 处理日常编程、结构化写作和长文档综合。

通过 PixMind 兼容 OpenAI 的聊天补全接口调用 Claude Sonnet 5.5。

提供方

Anthropic

模型 ID

claude-sonnet-5-5

请求端点

POST /api-platform/v1/chat/completions

鉴权与请求地址

API 地址为 https://aihub-admin.aimix.pro。创建和查询任务均须传入 Authorization: Bearer <PIXMIND_API_KEY>;提交 JSON 时还须设置 Content-Type: application/json。请将密钥保存在服务端环境变量中。

模型说明

  • 请将 API Key 保存在服务端;客户端需要增量输出时可启用流式返回。
  • Claude 5.5、5 与 4.8 使用 adaptive thinking。可通过 output_config.effort 设置 low、medium、high、xhigh 或 max;也可使用兼容 OpenAI 的 reasoning_effort 别名。
  • 更改 thinking 或 effort 会产生新的提示词缓存前缀。
  • 缓存读取以及保留 5 分钟、1 小时的缓存写入 Token 用量分别返回。
  • 当前线路输入上限为 1,000,000 Token,输出上限为 128,000 Token。

请求参数

参数类型必填说明
modelstring是

稳定的 PixMind 模型 ID,请使用 `claude-sonnet-5-5`。

可选值: claude-sonnet-5-5

messagesarray是

兼容 OpenAI 的对话消息。Gemini 用户消息的 content 可以是字符串,也可以是 text、image_url 和 video_url 内容块数组。

max_tokensinteger否

本次最多生成的 completion token 数量,须为不超过 128000 的正整数。

Playground 默认值: 4096

thinkingobject否

Claude 思考模式,请使用 {"type":"adaptive"}。

默认值: {"type":"adaptive"}

output_configobject否

思考深度,例如 {"effort":"high"}。

默认值: {"effort":"high"}

streamboolean否

启用后逐步流式返回 token。

可选值: true, false

默认值: false

请求示例

cURL
curl --request POST 'https://aihub-admin.aimix.pro/api-platform/v1/chat/completions' \
  -H "Authorization: Bearer $PIXMIND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "claude-sonnet-5-5",
  "messages": [
    {
      "role": "user",
      "content": "Draft three launch concepts for this product."
    }
  ],
  "thinking": {
    "type": "adaptive"
  },
  "output_config": {
    "effort": "high"
  },
  "stream": false
}'
JavaScript
// Node.js 20+. Keep the API key on your server.
const apiKey = process.env.PIXMIND_API_KEY;
if (!apiKey) throw new Error("PIXMIND_API_KEY is required");

const response = await fetch("https://aihub-admin.aimix.pro/api-platform/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${apiKey}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "model": "claude-sonnet-5-5",
  "messages": [
    {
      "role": "user",
      "content": "Draft three launch concepts for this product."
    }
  ],
  "thinking": {
    "type": "adaptive"
  },
  "output_config": {
    "effort": "high"
  },
  "stream": false
}),
  signal: AbortSignal.timeout(30_000)
});

const task = await response.json();
if (!response.ok) {
  throw new Error(task.message ?? task.error?.message ?? `HTTP ${response.status}`);
}
console.log(task);

响应示例

非流式对话补全直接返回 choices。传入 stream: true 时应读取 SSE 流。

200 OK
{
  "id": "chatcmpl_example",
  "object": "chat.completion",
  "model": "claude-sonnet-5-5",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello!"
      },
      "finish_reason": "stop"
    }
  ]
}

On this page