API 响应将包括思考和文本内容块:
tags:
- 聊天(Chat)/Claude 官方格式
parameters:
- name: Content-Type
in: header
description: ''
required: false
example: application/json
schema:
type: string
- name: Accept
in: header
description: ''
required: false
example: '*/*'
schema:
type: string
- name: x-api-key
in: header
description: ''
required: false
example: '{{key}}'
schema:
type: string
- name: Authorization
in: header
description: ''
required: false
example: Bearer {{YOUR_API_KEY}}
schema:
type: string
default: Bearer {{YOUR_API_KEY}}
requestBody:
content:
application/json:
schema:
type: object
properties: {}
example:
model: claude-3-7-sonnet-20250219
max_tokens: 20000
thinking:
type: enabled
budget_tokens: 16000
messages:
- role: user
content: 你是谁?
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties: {}
headers: {}
x-apifox-name: 成功
security: []
x-apifox-folder: 聊天(Chat)/Claude 官方格式
x-apifox-status: released
x-run-in-apifox: https://app.apifox.com/web/project/3868318/apis/api-266125085-run
components:
schemas: {}
securitySchemes: {}
servers: []
security: []
curl --location --globoff '{{BASE_URL}}/v1/messages' \
--header 'Authorization: {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
"model": "claude-3-7-sonnet-20250219",
"max_tokens": 20000,
"thinking": {
"type": "enabled",
"budget_tokens": 16000
},
"messages": [
{
"role": "user",
"content": "你是谁?"
}
]
}'{}