thinking 参数时,最低预算为 1,024 tokens。扩展思考消耗的 tokens 计入 max_tokens 限制。curl --location --request POST 'https://api.deerapi.com/v1/messages' \
--header 'Authorization: Bearer ' \
--header 'anthropic-beta: compact-2026-01-12' \
--header 'Content-Type: application/json' \
--data-raw '{
"max_tokens": 1024,
"system": "You are a helpful assistant.",
"messages": [
{
"content": "Hello, world",
"role": "user"
}
],
"model": "claude-sonnet-4-6"
}'{
"id": "chatcmpl-a1568ee22c7a4f31848f3dc16c2f3",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! It's nice to meet you. I'm Claude, an AI assistant. How can I help you today? Feel free to ask me anything you'd like - I'm happy to assist with a wide range of topics and tasks."
}
],
"model": "claude-3-5-sonnet-20240620",
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 3,
"output_tokens": 52,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0
}
}