{
"model": "claude-sonnet-4-20250514",
"max_tokens": 1024,
"tools": [
{
"name": "get_weather",
"description": "Get the current weather in a given location",
"input_schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
}
},
"required": [
"location"
]
}
}
],
"messages": [
{
"role": "user",
"content": "What is the weather like in San Francisco?"
}
]
}
curl --location --request POST '/v1/messages' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "claude-sonnet-4-20250514",
"max_tokens": 1024,
"tools": [
{
"name": "get_weather",
"description": "Get the current weather in a given location",
"input_schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
}
},
"required": [
"location"
]
}
}
],
"messages": [
{
"role": "user",
"content": "What is the weather like in San Francisco?"
}
]
}'
{
"id": "chatcmpl-89D7UVB9Lac3rIZD7Wgt69AT33Njf",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": " I don't see any image in your message. Could you please upload or share the image you'd like me to describe? Once you do, I'll be happy to provide a detailed description of what I see."
}
],
"stop_reason": "end_turn",
"model": "claude-sonnet-4-20250514",
"usage": {
"input_tokens": 96,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"output_tokens": 43
}
}