when:
  path: /v1/messages
  method: POST
  query_param: []
  header:
  - name: accept
    value: text/event-stream
  - name: content-type
    value: application/json
  - name: anthropic-version
    value: 2023-06-01
  body: '{"max_tokens":16384,"messages":[{"content":[{"text":"I''m planning a trip. What is the current weather in Tokyo, Japan? Based on the weather conditions, should I pack an umbrella or sunscreen? Use the get_weather tool to check before answering.","type":"text"}],"role":"user"}],"model":"claude-sonnet-4-6","stream":true,"system":[{"text":"You are a weather assistant. You have access to a get_weather tool. You must call the get_weather tool for any weather question and never guess weather data. After receiving the tool result, provide a concise summary of the weather.","type":"text"}],"thinking":{"type":"adaptive"},"tool_choice":{"type":"auto"},"tools":[{"description":"Get the current weather for a city. Must be called for weather questions.","input_schema":{"properties":{"city":{"description":"City name to get weather for","type":"string"}},"required":["city"],"type":"object"},"name":"get_weather"}]}'
then:
  status: 200
  header:
  - name: content-type
    value: text/event-stream; charset=utf-8
  body: |+
    event: message_start
    data: {"message":{"content":[],"id":"msg_REDACTED_1","model":"claude-sonnet-4-6","role":"assistant","stop_details":null,"stop_reason":null,"stop_sequence":null,"type":"message","usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":0},"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"inference_geo":"global","input_tokens":671,"output_tokens":8,"service_tier":"standard"}},"type":"message_start"}

    event: content_block_start
    data: {"content_block":{"signature":"signature_REDACTED_1","thinking":"","type":"thinking"},"index":0,"type":"content_block_start"}

    event: ping
    data: {"type":"ping"}

    event: content_block_delta
    data: {"delta":{"thinking":"The","type":"thinking_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"thinking":" user wants to know the current weather in Tokyo, Japan. I'll call the get_weather tool with \"Tokyo\" as the city.","type":"thinking_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"signature":"signature_REDACTED_2","type":"signature_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_stop
    data: {"index":0,"type":"content_block_stop"}

    event: content_block_start
    data: {"content_block":{"text":"","type":"text"},"index":1,"type":"content_block_start"}

    event: content_block_delta
    data: {"delta":{"text":"Sure! Let me check the current weather in Tokyo right away!","type":"text_delta"},"index":1,"type":"content_block_delta"}

    event: content_block_stop
    data: {"index":1,"type":"content_block_stop"}

    event: content_block_start
    data: {"content_block":{"caller":{"type":"direct"},"id":"toolu_REDACTED_1","input":{},"name":"get_weather","type":"tool_use"},"index":2,"type":"content_block_start"}

    event: content_block_delta
    data: {"delta":{"partial_json":"","type":"input_json_delta"},"index":2,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"partial_json":"{\"city\": \"T","type":"input_json_delta"},"index":2,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"partial_json":"okyo, ","type":"input_json_delta"},"index":2,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"partial_json":"Japan\"}","type":"input_json_delta"},"index":2,"type":"content_block_delta"}

    event: content_block_stop
    data: {"index":2,"type":"content_block_stop"}

    event: message_delta
    data: {"delta":{"stop_details":null,"stop_reason":"tool_use","stop_sequence":null},"type":"message_delta","usage":{"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"input_tokens":671,"output_tokens":113,"output_tokens_details":{"thinking_tokens":41}}}

    event: message_stop
    data: {"type":"message_stop"}

---
when:
  path: /v1/messages
  method: POST
  query_param: []
  header:
  - name: accept
    value: text/event-stream
  - name: content-type
    value: application/json
  - name: anthropic-version
    value: 2023-06-01
  body: '{"max_tokens":16384,"messages":[{"content":[{"text":"I''m planning a trip. What is the current weather in Tokyo, Japan? Based on the weather conditions, should I pack an umbrella or sunscreen? Use the get_weather tool to check before answering.","type":"text"}],"role":"user"},{"content":[{"signature":"signature_REDACTED_2","thinking":"The user wants to know the current weather in Tokyo, Japan. I''ll call the get_weather tool with \"Tokyo\" as the city.","type":"thinking"},{"text":"Sure! Let me check the current weather in Tokyo right away!","type":"text"},{"id":"toolu_REDACTED_1","input":{"city":"Tokyo, Japan"},"name":"get_weather","type":"tool_use"}],"role":"assistant"},{"content":[{"content":[{"text":"Weather in Tokyo, Japan: 72F (22C), sunny with light clouds, humidity 45%, wind 8 mph NW","type":"text"}],"tool_use_id":"toolu_REDACTED_1","type":"tool_result"}],"role":"user"}],"model":"claude-sonnet-4-6","stream":true,"system":[{"text":"You are a weather assistant. You have access to a get_weather tool. You must call the get_weather tool for any weather question and never guess weather data. After receiving the tool result, provide a concise summary of the weather.","type":"text"}],"thinking":{"type":"adaptive"},"tool_choice":{"type":"auto"},"tools":[{"description":"Get the current weather for a city. Must be called for weather questions.","input_schema":{"properties":{"city":{"description":"City name to get weather for","type":"string"}},"required":["city"],"type":"object"},"name":"get_weather"}]}'
then:
  status: 200
  header:
  - name: content-type
    value: text/event-stream; charset=utf-8
  body: |+
    event: message_start
    data: {"message":{"content":[],"id":"msg_REDACTED_2","model":"claude-sonnet-4-6","role":"assistant","stop_details":null,"stop_reason":null,"stop_sequence":null,"type":"message","usage":{"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":0},"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"inference_geo":"global","input_tokens":825,"output_tokens":1,"service_tier":"standard"}},"type":"message_start"}

    event: content_block_start
    data: {"content_block":{"text":"","type":"text"},"index":0,"type":"content_block_start"}

    event: ping
    data: {"type":"ping"}

    event: content_block_delta
    data: {"delta":{"text":"Here","type":"text_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"text":"'s the current weather report for **Tokyo, Japan** 🗼:\n\n| Detail |","type":"text_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"text":" Condition |\n|---|---|\n| 🌡️ Temperature | 72°F (22°C) |\n| ☁","type":"text_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"text":"️ Sky | Sunny with light clouds |\n| 💧 Humidity | 45% |\n| 💨 Wind | 8 mph, Northwest","type":"text_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"text":" |\n\n---\n\n### 🧳 Packing Recommendation: **","type":"text_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"text":"Sunscreen!** ☀️\n\nBased on the current conditions, here's what I","type":"text_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"text":" suggest:\n\n- **✅ Pack Sunscreen** – Tokyo is currently","type":"text_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"text":" experiencing sunny skies with only light clouds. With comfortable","type":"text_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"text":" temperatures and moderate humidity, you'll likely be spending time outdoors, so sun protection is a","type":"text_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"text":" must!\n- **🌂 Skip the Umbrella (for now)** – There's no rain","type":"text_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"text":" in the current conditions, so an umbrella isn't immediately necessary. However, weather","type":"text_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"text":" can change, so if you're staying for multiple days, a compact","type":"text_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"text":" travel umbrella wouldn't hurt as a backup.\n\n**Overall**, it sounds","type":"text_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_delta
    data: {"delta":{"text":" like a lovely day in Tokyo! Enjoy your trip! 🎌","type":"text_delta"},"index":0,"type":"content_block_delta"}

    event: content_block_stop
    data: {"index":0,"type":"content_block_stop"}

    event: message_delta
    data: {"delta":{"stop_details":null,"stop_reason":"end_turn","stop_sequence":null},"type":"message_delta","usage":{"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"input_tokens":825,"output_tokens":264,"output_tokens_details":{"thinking_tokens":0}}}

    event: message_stop
    data: {"type":"message_stop"}

