thinking-streaming.yaml

  1---
  2version: 2
  3interactions:
  4- id: 0
  5  request:
  6    proto: HTTP/1.1
  7    proto_major: 1
  8    proto_minor: 1
  9    content_length: 561
 10    host: ""
 11    body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence, Italy?","role":"user"}],"model":"anthropic/claude-sonnet-4","stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"reasoning":{"effort":"medium"},"usage":{"include":true},"stream":true}'
 12    headers:
 13      Accept:
 14      - application/json
 15      Content-Type:
 16      - application/json
 17      User-Agent:
 18      - OpenAI/Go 2.7.1
 19    url: https://openrouter.ai/api/v1/chat/completions
 20    method: POST
 21  response:
 22    proto: HTTP/2.0
 23    proto_major: 2
 24    proto_minor: 0
 25    content_length: -1
 26    body: |+
 27      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":"The user is asking for weather information for","reasoning_details":[{"type":"reasoning.text","text":"The user is asking for weather information for","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 28
 29      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" Florence, Italy. I have access","reasoning_details":[{"type":"reasoning.text","text":" Florence, Italy. I have access","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 30
 31      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" to a weather function that requires","reasoning_details":[{"type":"reasoning.text","text":" to a weather function that requires","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 32
 33      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" a location parameter. The","reasoning_details":[{"type":"reasoning.text","text":" a location parameter. The","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 34
 35      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" user has provided the location as \"Florence","reasoning_details":[{"type":"reasoning.text","text":" user has provided the location as \"Florence","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 36
 37      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":", Italy\".","reasoning_details":[{"type":"reasoning.text","text":", Italy\".","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 38
 39      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" I have","reasoning_details":[{"type":"reasoning.text","text":" I have","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 40
 41      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" all the required parameters to make the","reasoning_details":[{"type":"reasoning.text","text":" all the required parameters to make the","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 42
 43      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" function call.","reasoning_details":[{"type":"reasoning.text","text":" function call.","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 44
 45      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"id":"toolu_vrtx_01NRAptSJVJEik354SSeQZAs","type":"function","function":{"name":"weather","arguments":""}}]},"finish_reason":null,"native_finish_reason":null}]}
 46
 47      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":""}}]},"finish_reason":null,"native_finish_reason":null}]}
 48
 49      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":""}}]},"finish_reason":null,"native_finish_reason":null}]}
 50
 51      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":"{\"loca"}}]},"finish_reason":null,"native_finish_reason":null}]}
 52
 53      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":"ti"}}]},"finish_reason":null,"native_finish_reason":null}]}
 54
 55      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":"on\""}}]},"finish_reason":null,"native_finish_reason":null}]}
 56
 57      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":": \"Florence,"}}]},"finish_reason":null,"native_finish_reason":null}]}
 58
 59      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":" I"}}]},"finish_reason":null,"native_finish_reason":null}]}
 60
 61      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":"taly\"}"}}]},"finish_reason":null,"native_finish_reason":null}]}
 62
 63      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning_details":[{"type":"reasoning.text","signature":"EqkDCkgICxACGAIqQPS7GVr0GXPH6M+WzQ1vKtUqRBHv1LhaC0/WFMQlYmVaM9CGfR2D2LPkjWcVDLyv3VhSBwhzqJ7/TqPBgU19uX8SDNcW4mQhOGZ8NT+CyxoMbbl8zeAq03liEOT4IjCrFqSXlBQ4fKC4vLk5pvUFsStMTVC7lQqOCgx9Wi8wbWQARs0NgwUqMGRaPvyqqKkqjgL/UoXjowlOTTm2Fr7eWoiV5ZakWSRVesu8jBjxWWADiYR6i7YMTq7J32a/5C9br4HoEiD8g8Qdt3wOqrFMZWNhAQQ7kTS6bxYNLPE9SIVRuLyVpcvjcXLZviedK3AJ+EZrO/mx4efFo9TFIQ5vf59fecRWPc4QwJ7bDK4v9s+SLrA6tulpJBmiC3c7ZoaHXRV/qIbBTUDG9yifohjgmYZHo/PARPH7dqxkwYS25UtZHa5r8ENHvPhCuK4CowY8+3dj1qi1NjbR6xJPIrCBW9OZCtIB8/0zdmz6LoY/CCYhuOKPKClNgMoxLUtA79MgcC/kMndvWauXkbk2g2hMRGnOD6yvhGU8Hs1q0y+5yTQYAQ==","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 64
 65      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":null},"finish_reason":"tool_calls","native_finish_reason":"tool_calls"}]}
 66
 67      data: {"id":"gen-1773326256-GfjuN0tRbvSxE7XpT5vu","object":"chat.completion.chunk","created":1773326256,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[],"usage":{"prompt_tokens":424,"completion_tokens":110,"total_tokens":534,"cost":0.002922,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"cache_write_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.002922,"upstream_inference_prompt_cost":0.001272,"upstream_inference_completions_cost":0.00165},"completion_tokens_details":{"reasoning_tokens":64,"image_tokens":0,"audio_tokens":0}}}
 68
 69      data: [DONE]
 70
 71    headers:
 72      Content-Type:
 73      - text/event-stream
 74    status: 200 OK
 75    code: 200
 76    duration: 1.126881375s
 77- id: 1
 78  request:
 79    proto: HTTP/1.1
 80    proto_major: 1
 81    proto_minor: 1
 82    content_length: 1951
 83    host: ""
 84    body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence, Italy?","role":"user"},{"tool_calls":[{"id":"toolu_vrtx_01NRAptSJVJEik354SSeQZAs","function":{"arguments":"{\"location\": \"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant","reasoning_details":[{"format":"anthropic-claude-v1","index":0,"signature":"EqkDCkgICxACGAIqQPS7GVr0GXPH6M+WzQ1vKtUqRBHv1LhaC0/WFMQlYmVaM9CGfR2D2LPkjWcVDLyv3VhSBwhzqJ7/TqPBgU19uX8SDNcW4mQhOGZ8NT+CyxoMbbl8zeAq03liEOT4IjCrFqSXlBQ4fKC4vLk5pvUFsStMTVC7lQqOCgx9Wi8wbWQARs0NgwUqMGRaPvyqqKkqjgL/UoXjowlOTTm2Fr7eWoiV5ZakWSRVesu8jBjxWWADiYR6i7YMTq7J32a/5C9br4HoEiD8g8Qdt3wOqrFMZWNhAQQ7kTS6bxYNLPE9SIVRuLyVpcvjcXLZviedK3AJ+EZrO/mx4efFo9TFIQ5vf59fecRWPc4QwJ7bDK4v9s+SLrA6tulpJBmiC3c7ZoaHXRV/qIbBTUDG9yifohjgmYZHo/PARPH7dqxkwYS25UtZHa5r8ENHvPhCuK4CowY8+3dj1qi1NjbR6xJPIrCBW9OZCtIB8/0zdmz6LoY/CCYhuOKPKClNgMoxLUtA79MgcC/kMndvWauXkbk2g2hMRGnOD6yvhGU8Hs1q0y+5yTQYAQ==","text":" Florence, Italy. I have access to a weather function that requires a location parameter. The user has provided the location as \"Florence, Italy\". I have all the required parameters to make the function call.","type":"reasoning.text"}],"reasoning":" Florence, Italy. I have access to a weather function that requires a location parameter. The user has provided the location as \"Florence, Italy\". I have all the required parameters to make the function call."},{"content":"40 C","tool_call_id":"toolu_vrtx_01NRAptSJVJEik354SSeQZAs","role":"tool"}],"model":"anthropic/claude-sonnet-4","stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"reasoning":{"effort":"medium"},"usage":{"include":true},"stream":true}'
 85    headers:
 86      Accept:
 87      - application/json
 88      Content-Type:
 89      - application/json
 90      User-Agent:
 91      - OpenAI/Go 2.7.1
 92    url: https://openrouter.ai/api/v1/chat/completions
 93    method: POST
 94  response:
 95    proto: HTTP/2.0
 96    proto_major: 2
 97    proto_minor: 0
 98    content_length: -1
 99    body: |+
100      data: {"id":"gen-1773326258-WHvws41Vctn3G2tYV7Ov","object":"chat.completion.chunk","created":1773326258,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"The current","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
101
102      data: {"id":"gen-1773326258-WHvws41Vctn3G2tYV7Ov","object":"chat.completion.chunk","created":1773326258,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":" weather in Florence, Italy is ","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
103
104      data: {"id":"gen-1773326258-WHvws41Vctn3G2tYV7Ov","object":"chat.completion.chunk","created":1773326258,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"40°C (104°F).","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
105
106      data: {"id":"gen-1773326258-WHvws41Vctn3G2tYV7Ov","object":"chat.completion.chunk","created":1773326258,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":" That","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
107
108      data: {"id":"gen-1773326258-WHvws41Vctn3G2tYV7Ov","object":"chat.completion.chunk","created":1773326258,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"'s quite hot","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
109
110      data: {"id":"gen-1773326258-WHvws41Vctn3G2tYV7Ov","object":"chat.completion.chunk","created":1773326258,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"!","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
111
112      data: {"id":"gen-1773326258-WHvws41Vctn3G2tYV7Ov","object":"chat.completion.chunk","created":1773326258,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":" If","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
113
114      data: {"id":"gen-1773326258-WHvws41Vctn3G2tYV7Ov","object":"chat.completion.chunk","created":1773326258,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":" you're planning to visit or","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
115
116      data: {"id":"gen-1773326258-WHvws41Vctn3G2tYV7Ov","object":"chat.completion.chunk","created":1773326258,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":" are","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
117
118      data: {"id":"gen-1773326258-WHvws41Vctn3G2tYV7Ov","object":"chat.completion.chunk","created":1773326258,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":" currently there, make","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
119
120      data: {"id":"gen-1773326258-WHvws41Vctn3G2tYV7Ov","object":"chat.completion.chunk","created":1773326258,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":" sure to stay","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
121
122      data: {"id":"gen-1773326258-WHvws41Vctn3G2tYV7Ov","object":"chat.completion.chunk","created":1773326258,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":" hydrated and seek","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
123
124      data: {"id":"gen-1773326258-WHvws41Vctn3G2tYV7Ov","object":"chat.completion.chunk","created":1773326258,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":" shade during the hottest parts","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
125
126      data: {"id":"gen-1773326258-WHvws41Vctn3G2tYV7Ov","object":"chat.completion.chunk","created":1773326258,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":" of the day.","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
127
128      data: {"id":"gen-1773326258-WHvws41Vctn3G2tYV7Ov","object":"chat.completion.chunk","created":1773326258,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant"},"finish_reason":"stop","native_finish_reason":"stop"}]}
129
130      data: {"id":"gen-1773326258-WHvws41Vctn3G2tYV7Ov","object":"chat.completion.chunk","created":1773326258,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[],"usage":{"prompt_tokens":549,"completion_tokens":54,"total_tokens":603,"cost":0.002457,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"cache_write_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.002457,"upstream_inference_prompt_cost":0.001647,"upstream_inference_completions_cost":0.00081},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}}
131
132      data: [DONE]
133
134    headers:
135      Content-Type:
136      - text/event-stream
137    status: 200 OK
138    code: 200
139    duration: 1.487207542s