OpenRouter runs the tool during the request and returns the result to the model, so no client-side tool loop is needed.
Supported APIs: Chat Completions and Responses.
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.2",
"tools": [
{
"type": "openrouter:subagent",
"parameters": {
"model": "~anthropic/claude-haiku-latest"
}
}
],
"messages": [
{
"role": "user",
"content": "Research three competing databases and delegate one comparison to a subagent each."
}
]
}'