Making this request via Open Router issues an error:
Minimum Repro
{
"messages": [
{
"role": "assistant",
"content": "",
"tool_calls": [
{
"id": "toolu_vrtx_01BUEnscXFBdeCwds9zSLXJB",
"type": "function",
"function": {
"name": "file_read",
"arguments": "abc.txt"
}
}
]
},
{
"role": "tool",
"content": "Hello World!",
"name": "file_read",
"tool_call_id": "toolu_vrtx_01BUEnscXFBdeCwds9zSLXJB"
}
],
"model": "anthropic/claude-sonnet-4",
"stream": false,
}
ERROR
{
"error": {
"message": "Provider returned error",
"code": 400,
"metadata": {
"raw": "{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.0.content.0: unexpected `tool_use_id` found in `tool_result` blocks: toolu_vrtx_01BUEnscXFBdeCwds9zSLXJB. Each `tool_result` block must have a corresponding `tool_use` block in the previous message.\"}}",
"provider_name": "Anthropic"
}
},
"user_id": "user_2q36EtHSol1CeC92ASe8n5NfpRV"
}