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-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":"The user is asking for","reasoning_details":[{"type":"reasoning.text","text":"The user is asking for","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 28
 29      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" weather","reasoning_details":[{"type":"reasoning.text","text":" weather","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 30
 31      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" information for","reasoning_details":[{"type":"reasoning.text","text":" information for","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 32
 33      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"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}]}
 34
 35      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" to a weather function that takes","reasoning_details":[{"type":"reasoning.text","text":" to a weather function that takes","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 36
 37      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" a location parameter. The location","reasoning_details":[{"type":"reasoning.text","text":" a location parameter. The location","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 38
 39      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" is","reasoning_details":[{"type":"reasoning.text","text":" is","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 40
 41      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" clearly","reasoning_details":[{"type":"reasoning.text","text":" clearly","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 42
 43      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" specified","reasoning_details":[{"type":"reasoning.text","text":" specified","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 44
 45      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" as \"Florence, Italy\" so I","reasoning_details":[{"type":"reasoning.text","text":" as \"Florence, Italy\" so I","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 46
 47      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" have all the required parameters","reasoning_details":[{"type":"reasoning.text","text":" have all the required parameters","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 48
 49      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning":" to make the","reasoning_details":[{"type":"reasoning.text","text":" to make the","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 50
 51      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"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}]}
 52
 53      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"id":"toolu_vrtx_01HKfUyb4tpj4kvPgTuusByf","type":"function","function":{"name":"weather","arguments":""}}]},"finish_reason":null,"native_finish_reason":null}]}
 54
 55      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"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}]}
 56
 57      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"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}]}
 58
 59      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":"{\"locati"}}]},"finish_reason":null,"native_finish_reason":null}]}
 60
 61      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"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}]}
 62
 63      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":"\": \"Flor"}}]},"finish_reason":null,"native_finish_reason":null}]}
 64
 65      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":null,"role":"assistant","tool_calls":[{"index":0,"function":{"arguments":"ence, I"}}]},"finish_reason":null,"native_finish_reason":null}]}
 66
 67      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"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}]}
 68
 69      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"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}]}
 70
 71      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant","reasoning_details":[{"type":"reasoning.text","signature":"EqcDCkgICxACGAIqQM0Cd2vack9XE5bBfQ+UzUmO6mtcCD9QEy7/W2YXPJaAq8xvtMBNeQKGAoNiRvy3r9GXKYMe5MmAW+7LfgsburkSDD2T6pIVGFhXrqFeyBoM5VdxjM6/xX3P78QMIjCWe/6ttXxKOW/sdYJ4JzE4bKGjIuYfTJv+0i8OZkAF/FvXHIKSm8jG0D/Li44mdqkqjAJGEtZwg9srd1Q47ovDJqfU3QaOz7F34UKA+VQ5WhcY8sO1GyjqPYMLxcgo794PsisD6/0pZPqtvBFW28e3sd/iedHI6adxgJs83k5ap/B5rhJY6AJcCjcEfO+Fi7b6CYRElRvWI1vSDIct251jOTZ51tt9T1kw1u6UhoJfIY/SmiEI6AgP3wBpESi7H+bnrX9/w/97V7tbdDclP09MgZqLrt4+ECvNLn04lXXLGQYAOglRm8Tixk1IN4LGV6TJtDngbwk+Be+Zn6kqvJ8bo0BOZJOhRAbgc1HF+kgV4z80aTtBILpbYo0uV/IQRElhU5/Y7sbVTDwRft/bzZxdTdUJN/vqvb+BAkiSbxWCGAE=","format":"anthropic-claude-v1","index":0}]},"finish_reason":null,"native_finish_reason":null}]}
 72
 73      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"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"}]}
 74
 75      data: {"id":"gen-1773326264-OoghvABlt3eLCw2WPlqS","object":"chat.completion.chunk","created":1773326264,"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":63,"image_tokens":0,"audio_tokens":0}}}
 76
 77      data: [DONE]
 78
 79    headers:
 80      Content-Type:
 81      - text/event-stream
 82    status: 200 OK
 83    code: 200
 84    duration: 1.00973575s
 85- id: 1
 86  request:
 87    proto: HTTP/1.1
 88    proto_major: 1
 89    proto_minor: 1
 90    content_length: 1991
 91    host: ""
 92    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_01HKfUyb4tpj4kvPgTuusByf","function":{"arguments":"{\"location\": \"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant","reasoning_details":[{"format":"anthropic-claude-v1","index":0,"signature":"EqcDCkgICxACGAIqQM0Cd2vack9XE5bBfQ+UzUmO6mtcCD9QEy7/W2YXPJaAq8xvtMBNeQKGAoNiRvy3r9GXKYMe5MmAW+7LfgsburkSDD2T6pIVGFhXrqFeyBoM5VdxjM6/xX3P78QMIjCWe/6ttXxKOW/sdYJ4JzE4bKGjIuYfTJv+0i8OZkAF/FvXHIKSm8jG0D/Li44mdqkqjAJGEtZwg9srd1Q47ovDJqfU3QaOz7F34UKA+VQ5WhcY8sO1GyjqPYMLxcgo794PsisD6/0pZPqtvBFW28e3sd/iedHI6adxgJs83k5ap/B5rhJY6AJcCjcEfO+Fi7b6CYRElRvWI1vSDIct251jOTZ51tt9T1kw1u6UhoJfIY/SmiEI6AgP3wBpESi7H+bnrX9/w/97V7tbdDclP09MgZqLrt4+ECvNLn04lXXLGQYAOglRm8Tixk1IN4LGV6TJtDngbwk+Be+Zn6kqvJ8bo0BOZJOhRAbgc1HF+kgV4z80aTtBILpbYo0uV/IQRElhU5/Y7sbVTDwRft/bzZxdTdUJN/vqvb+BAkiSbxWCGAE=","text":" weather information for Florence, Italy. I have access to a weather function that takes a location parameter. The location is clearly specified as \"Florence, Italy\" so I have all the required parameters to make the function call.","type":"reasoning.text"}],"reasoning":" weather information for Florence, Italy. I have access to a weather function that takes a location parameter. The location is clearly specified as \"Florence, Italy\" so I have all the required parameters to make the function call."},{"content":"40 C","tool_call_id":"toolu_vrtx_01HKfUyb4tpj4kvPgTuusByf","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"}],"usage":{"include":true},"reasoning":{"effort":"medium"},"stream":true}'
 93    headers:
 94      Accept:
 95      - application/json
 96      Content-Type:
 97      - application/json
 98      User-Agent:
 99      - OpenAI/Go 2.7.1
100    url: https://openrouter.ai/api/v1/chat/completions
101    method: POST
102  response:
103    proto: HTTP/2.0
104    proto_major: 2
105    proto_minor: 0
106    content_length: -1
107    body: |+
108      data: {"id":"gen-1773326267-RCoDFUZUJvX71yoT5AUB","object":"chat.completion.chunk","created":1773326267,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"The current","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
109
110      data: {"id":"gen-1773326267-RCoDFUZUJvX71yoT5AUB","object":"chat.completion.chunk","created":1773326267,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":" weather in Florence, Italy shows","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
111
112      data: {"id":"gen-1773326267-RCoDFUZUJvX71yoT5AUB","object":"chat.completion.chunk","created":1773326267,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":" a","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
113
114      data: {"id":"gen-1773326267-RCoDFUZUJvX71yoT5AUB","object":"chat.completion.chunk","created":1773326267,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":" temperature of 40°C (104","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
115
116      data: {"id":"gen-1773326267-RCoDFUZUJvX71yoT5AUB","object":"chat.completion.chunk","created":1773326267,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"°F). That","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
117
118      data: {"id":"gen-1773326267-RCoDFUZUJvX71yoT5AUB","object":"chat.completion.chunk","created":1773326267,"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}]}
119
120      data: {"id":"gen-1773326267-RCoDFUZUJvX71yoT5AUB","object":"chat.completion.chunk","created":1773326267,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"!","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
121
122      data: {"id":"gen-1773326267-RCoDFUZUJvX71yoT5AUB","object":"chat.completion.chunk","created":1773326267,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":" It's a very","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
123
124      data: {"id":"gen-1773326267-RCoDFUZUJvX71yoT5AUB","object":"chat.completion.chunk","created":1773326267,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":" warm day in Florence.","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}
125
126      data: {"id":"gen-1773326267-RCoDFUZUJvX71yoT5AUB","object":"chat.completion.chunk","created":1773326267,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[{"index":0,"delta":{"content":"","role":"assistant"},"finish_reason":"stop","native_finish_reason":"stop"}]}
127
128      data: {"id":"gen-1773326267-RCoDFUZUJvX71yoT5AUB","object":"chat.completion.chunk","created":1773326267,"model":"anthropic/claude-4-sonnet-20250522","provider":"Google","choices":[],"usage":{"prompt_tokens":549,"completion_tokens":37,"total_tokens":586,"cost":0.002202,"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.002202,"upstream_inference_prompt_cost":0.001647,"upstream_inference_completions_cost":0.000555},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}}
129
130      data: [DONE]
131
132    headers:
133      Content-Type:
134      - text/event-stream
135    status: 200 OK
136    code: 200
137    duration: 1.070964125s