{
  "version": 1,
  "metadata": {
    "model": "anthropic/claude-sonnet-4.6",
    "tags": [
      "prefix:openai-compatible-chat",
      "provider:vercel-ai-gateway",
      "protocol:openai-chat",
      "reasoning",
      "continuation",
      "tool",
      "tool-loop"
    ],
    "name": "vercel-ai-gateway-reasoning-tool-loop",
    "recordedAt": "2026-07-20T02:41:08.712Z"
  },
  "interactions": [
    {
      "transport": "http",
      "request": {
        "method": "POST",
        "url": "https://ai-gateway.vercel.sh/v1/chat/completions",
        "headers": {
          "content-type": "application/json"
        },
        "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"max_tokens\":1536,\"reasoning\":{\"enabled\":true,\"max_tokens\":1024}}"
      },
      "response": {
        "status": 200,
        "headers": {
          "content-type": "text/event-stream"
        },
        "body": "data: {\"id\":\"gen_01KXYPC0A2GBNS2101HEG2F5KR\",\"object\":\"chat.completion.chunk\",\"created\":1784515266,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_mcg1unonve\"}\n\ndata: {\"id\":\"gen_01KXYPC0A2GBNS2101HEG2F5KR\",\"object\":\"chat.completion.chunk\",\"created\":1784515266,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"reasoning\":\"The user wants\",\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"The user wants\",\"signature\":\"\",\"format\":\"anthropic-claude-v1\",\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_mcg1unonve\"}\n\ndata: {\"id\":\"gen_01KXYPC0A2GBNS2101HEG2F5KR\",\"object\":\"chat.completion.chunk\",\"created\":1784515266,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"reasoning\":\" to know the weather in Paris. I'll use the get_weather tool.\",\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\" to know the weather in Paris. I'll use the get_weather tool.\",\"signature\":\"\",\"format\":\"anthropic-claude-v1\",\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_mcg1unonve\"}\n\ndata: {\"id\":\"gen_01KXYPC0A2GBNS2101HEG2F5KR\",\"object\":\"chat.completion.chunk\",\"created\":1784515266,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"reasoning\":\"\",\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"\",\"signature\":\"ErkCCosBCA8YAipAjKnRKpxkZ4eHrMPJ63IWEOYPSzb+XSHyG+vLK+2ks2O9T4N9M37Xn2kausQSH1rfsrdmKxgUlBg6yUFRgMVR7DIRY2xhdWRlLXNvbm5ldC00LTY4AEIIdGhpbmtpbmdaJDNiOTNhNWRkLTczMDItNDgzZi1hZWFlLTM2MjA3NTU0OGFlMRIMM48xcuzdqvMYIVj0GgzNLyWlqYpowmh/ekwiMNJ+av0MqXkfQP9JJBuSQzhxreyzG6b3V4o6WMG4AkUForVcNy8B6FU3LLmarZghWCpbMd005YC11uuZgsB10K00Rc2RYIfbL13mm3KLNj/iImbEkB6E/7OqxcbQjG3rM6JJrcmRhQk+wWk26tlenw/upR99KkrILrAv22RFK5sxzqOkdWz8t4qzVPKfVxgB\",\"format\":\"anthropic-claude-v1\",\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_mcg1unonve\"}\n\ndata: {\"id\":\"gen_01KXYPC0A2GBNS2101HEG2F5KR\",\"object\":\"chat.completion.chunk\",\"created\":1784515266,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Sure! Let me check the weather in Paris for you!\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_mcg1unonve\"}\n\ndata: {\"id\":\"gen_01KXYPC0A2GBNS2101HEG2F5KR\",\"object\":\"chat.completion.chunk\",\"created\":1784515266,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"id\":\"toolu_01KBCTV7MS4TY6U2zSTF2K2n\",\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_mcg1unonve\"}\n\ndata: {\"id\":\"gen_01KXYPC0A2GBNS2101HEG2F5KR\",\"object\":\"chat.completion.chunk\",\"created\":1784515266,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"city\\\": \\\"Paris\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_mcg1unonve\"}\n\ndata: {\"id\":\"gen_01KXYPC0A2GBNS2101HEG2F5KR\",\"object\":\"chat.completion.chunk\",\"created\":1784515266,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_mcg1unonve\"}\n\ndata: {\"id\":\"gen_01KXYPC0A2GBNS2101HEG2F5KR\",\"object\":\"chat.completion.chunk\",\"created\":1784515266,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":623,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":93,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":24}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-4.6\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[\"vertexAnthropic\",\"bedrock\"],\"planningReasoning\":\"System credentials planned for: anthropic, vertexAnthropic, bedrock. Total execution order: anthropic(system) → vertexAnthropic(system) → bedrock(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1784515265180,\"endTime\":1784515267361,\"providerRequestId\":\"req_011CdCY7kJywwSSDhvHjPDNQ\",\"statusCode\":200,\"providerResponseId\":\"msg_011CdCY7n1gYrbgoik1oNbaP\"}]}],\"totalProviderAttemptCount\":1},\"cost\":\"0.003264\",\"marketCost\":\"0.003264\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.003264\",\"inferenceCost\":\"0.003264\",\"inputInferenceCost\":\"0.001869\",\"outputInferenceCost\":\"0.001395\",\"generationId\":\"gen_01KXYPC0A2GBNS2101HEG2F5KR\"}}},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"prompt_tokens\":623,\"completion_tokens\":93,\"total_tokens\":716,\"cost\":0.003264,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0,\"upstream_inference_completions_cost\":0},\"completion_tokens_details\":{\"reasoning_tokens\":19,\"reasoning_tokens_estimated\":true,\"image_tokens\":0},\"cache_creation_input_tokens\":0,\"market_cost\":0.003264,\"gateway_cost\":0.003264},\"system_fingerprint\":\"fp_mcg1unonve\",\"generationId\":\"gen_01KXYPC0A2GBNS2101HEG2F5KR\"}\n\ndata: [DONE]\n\n"
      }
    },
    {
      "transport": "http",
      "request": {
        "method": "POST",
        "url": "https://ai-gateway.vercel.sh/v1/chat/completions",
        "headers": {
          "content-type": "application/json"
        },
        "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"},{\"role\":\"assistant\",\"content\":\"Sure! Let me check the weather in Paris for you!\",\"tool_calls\":[{\"id\":\"toolu_01KBCTV7MS4TY6U2zSTF2K2n\",\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}}],\"reasoning\":\"The user wants to know the weather in Paris. I'll use the get_weather tool.\",\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"The user wants to know the weather in Paris. I'll use the get_weather tool.\",\"signature\":\"ErkCCosBCA8YAipAjKnRKpxkZ4eHrMPJ63IWEOYPSzb+XSHyG+vLK+2ks2O9T4N9M37Xn2kausQSH1rfsrdmKxgUlBg6yUFRgMVR7DIRY2xhdWRlLXNvbm5ldC00LTY4AEIIdGhpbmtpbmdaJDNiOTNhNWRkLTczMDItNDgzZi1hZWFlLTM2MjA3NTU0OGFlMRIMM48xcuzdqvMYIVj0GgzNLyWlqYpowmh/ekwiMNJ+av0MqXkfQP9JJBuSQzhxreyzG6b3V4o6WMG4AkUForVcNy8B6FU3LLmarZghWCpbMd005YC11uuZgsB10K00Rc2RYIfbL13mm3KLNj/iImbEkB6E/7OqxcbQjG3rM6JJrcmRhQk+wWk26tlenw/upR99KkrILrAv22RFK5sxzqOkdWz8t4qzVPKfVxgB\",\"format\":\"anthropic-claude-v1\",\"index\":0}]},{\"role\":\"tool\",\"tool_call_id\":\"toolu_01KBCTV7MS4TY6U2zSTF2K2n\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"max_tokens\":1536,\"reasoning\":{\"enabled\":true,\"max_tokens\":1024}}"
      },
      "response": {
        "status": 200,
        "headers": {
          "content-type": "text/event-stream"
        },
        "body": "data: {\"id\":\"gen_01KXYPC2WN8PT0Y6ZDH00AF3K4\",\"object\":\"chat.completion.chunk\",\"created\":1784515268,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_ljjqzh6v2k\"}\n\ndata: {\"id\":\"gen_01KXYPC2WN8PT0Y6ZDH00AF3K4\",\"object\":\"chat.completion.chunk\",\"created\":1784515268,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Paris\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_ljjqzh6v2k\"}\n\ndata: {\"id\":\"gen_01KXYPC2WN8PT0Y6ZDH00AF3K4\",\"object\":\"chat.completion.chunk\",\"created\":1784515268,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" is sunny.\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_ljjqzh6v2k\"}\n\ndata: {\"id\":\"gen_01KXYPC2WN8PT0Y6ZDH00AF3K4\",\"object\":\"chat.completion.chunk\",\"created\":1784515268,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":737,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":7,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-4.6\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[\"vertexAnthropic\",\"bedrock\"],\"planningReasoning\":\"System credentials planned for: anthropic, vertexAnthropic, bedrock. Total execution order: anthropic(system) → vertexAnthropic(system) → bedrock(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1784515267510,\"endTime\":1784515268708,\"providerRequestId\":\"req_011CdCY7vEY4aNuG8jvsZXQR\",\"statusCode\":200,\"providerResponseId\":\"msg_011CdCY7w49RtKGdr45xU8Bx\"}]}],\"totalProviderAttemptCount\":1},\"cost\":\"0.002316\",\"marketCost\":\"0.002316\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.002316\",\"inferenceCost\":\"0.002316\",\"inputInferenceCost\":\"0.002211\",\"outputInferenceCost\":\"0.000105\",\"generationId\":\"gen_01KXYPC2WN8PT0Y6ZDH00AF3K4\"}}},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":737,\"completion_tokens\":7,\"total_tokens\":744,\"cost\":0.002316,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0,\"upstream_inference_completions_cost\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0},\"cache_creation_input_tokens\":0,\"market_cost\":0.002316,\"gateway_cost\":0.002316},\"system_fingerprint\":\"fp_ljjqzh6v2k\",\"generationId\":\"gen_01KXYPC2WN8PT0Y6ZDH00AF3K4\"}\n\ndata: [DONE]\n\n"
      }
    }
  ]
}
