> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hubto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude 消息

> Claude Messages 兼容接口。

## 用途

用于兼容 Claude Messages 请求格式。

## 请求头

<ParamField header="Authorization" type="string" default="Bearer YOUR_API_KEY" required>
  Bearer 鉴权请求头。
</ParamField>

## 请求体

<ParamField body="model" type="string" default="claude-opus-4-7" required>
  Claude 模型名称，可在模型广场查看当前可用模型。
</ParamField>

<ParamField body="max_tokens" type="integer" default="512" required>
  最大输出 token 数。
</ParamField>

<ParamField body="messages" type="object[]" default="[{&#x22;role&#x22;:&#x22;user&#x22;,&#x22;content&#x22;:&#x22;请介绍一下 HubTo。&#x22;}]" required>
  Claude Messages 消息数组。
</ParamField>

<ParamField body="temperature" type="number" default="0.7">
  可选，控制生成随机性。
</ParamField>

## 示例请求体

```json theme={null}
{
  "model": "claude-opus-4-7",
  "max_tokens": 512,
  "messages": [
    {
      "role": "user",
      "content": "请介绍一下 HubTo。"
    }
  ]
}
```

## 响应

成功时返回 Claude Messages 兼容结构。

当前可用模型请以模型广场显示为准。
