⌘K

Claude Sonnet 5.5

claude-sonnet-5-5

Claude Sonnet 5.5 是兼顾速度和智能的 Sonnet 模型, 适合高级推理、代码生成、智能体任务和多模态理解. 支持文本和图片输入、文本输出, 上下文窗口为 1,000,000 token, 最大输出为 128,000 token, 可通过 OpenAI 兼容 Chat Completions 接口使用.

认证

authorization string 必填

所有 API 均使用 Bearer Token 鉴权

获取 API Key:

访问 API Key 管理页面 获取 API Key

用法:

将以下 Header 添加到请求中:

Authorization: Bearer YOUR_API_KEY

参数

model string 必填

请求使用的模型 ID

值: claude-sonnet-5-5


messages array 必填

表示对话历史的消息对象数组

role string 必填

消息角色

可选值: user, assistant, system, developer

content string | array 必填

文本字符串或多模态数组


max_tokens integer

生成的最大 token 数量

范围:1 - 128000


temperature number

采样温度

默认值:1.0

范围:0.0 - 2.0


top_p number

核采样参数

默认值:1.0

范围:0.0 - 1.0


stream boolean

是否增量流式返回响应

默认值:false