chore: add more tests

kujtimiihoxha created

Change summary

providertests/common_test.go                                                                   |   2 
providertests/testdata/TestAnthropicCommon/multi_tool_claude-sonnet-4.yaml                     |  40 
providertests/testdata/TestAnthropicCommon/multi_tool_streaming_claude-sonnet-4.yaml           | 105 
providertests/testdata/TestAnthropicCommon/tool_claude-sonnet-4.yaml                           |  63 
providertests/testdata/TestAnthropicCommon/tool_streaming_claude-sonnet-4.yaml                 | 145 
providertests/testdata/TestGoogleCommon/multi_tool_gemini-2.5-flash.yaml                       |  86 
providertests/testdata/TestGoogleCommon/multi_tool_gemini-2.5-pro.yaml                         |  86 
providertests/testdata/TestGoogleCommon/multi_tool_streaming_gemini-2.5-flash.yaml             |  42 
providertests/testdata/TestGoogleCommon/multi_tool_streaming_gemini-2.5-pro.yaml               |  27 
providertests/testdata/TestGoogleCommon/tool_gemini-2.5-flash.yaml                             | 126 
providertests/testdata/TestGoogleCommon/tool_gemini-2.5-pro.yaml                               | 126 
providertests/testdata/TestGoogleCommon/tool_streaming_gemini-2.5-flash.yaml                   |  27 
providertests/testdata/TestGoogleCommon/tool_streaming_gemini-2.5-pro.yaml                     |  27 
providertests/testdata/TestOpenAICommon/multi_tool_gpt-4o-mini.yaml                            |  94 
providertests/testdata/TestOpenAICommon/multi_tool_gpt-4o.yaml                                 |  94 
providertests/testdata/TestOpenAICommon/multi_tool_gpt-5.yaml                                  |  93 
providertests/testdata/TestOpenAICommon/multi_tool_streaming_gpt-4o-mini.yaml                  |  67 
providertests/testdata/TestOpenAICommon/multi_tool_streaming_gpt-4o.yaml                       |  67 
providertests/testdata/TestOpenAICommon/multi_tool_streaming_gpt-5.yaml                        |  67 
providertests/testdata/TestOpenAICommon/tool_gpt-4o-mini.yaml                                  | 145 
providertests/testdata/TestOpenAICommon/tool_gpt-4o.yaml                                       | 145 
providertests/testdata/TestOpenAICommon/tool_gpt-5.yaml                                        | 143 
providertests/testdata/TestOpenAICommon/tool_streaming_gpt-4o-mini.yaml                        | 117 
providertests/testdata/TestOpenAICommon/tool_streaming_gpt-4o.yaml                             | 117 
providertests/testdata/TestOpenAICommon/tool_streaming_gpt-5.yaml                              | 125 
providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_baseten.yaml                    |  26 
providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_chutes.yaml                     |  26 
providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_deepinfra.yaml                  |  26 
providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_fireworks.yaml                  |  26 
providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_moonshotai.yaml                 |  26 
providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_moonshotai/turbo.yaml           |  26 
providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_novita.yaml                     |  26 
providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_siliconflow.yaml                |  26 
providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_together.yaml                   |  26 
providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_wandb.yaml                      |  26 
providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_baseten.yaml          | 123 
providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_chutes.yaml           | 123 
providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_deepinfra.yaml        |  51 
providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_fireworks.yaml        | 129 
providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_moonshotai.yaml       | 123 
providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_moonshotai/turbo.yaml | 129 
providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_novita.yaml           | 125 
providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_siliconflow.yaml      | 115 
providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_together.yaml         |  83 
providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_wandb.yaml            | 168 
providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_baseten.yaml                        |  18 
providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_chutes.yaml                         |  20 
providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_deepinfra.yaml                      |  18 
providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_fireworks.yaml                      |  12 
providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_moonshotai.yaml                     |  20 
providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_moonshotai/turbo.yaml               |  18 
providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_novita.yaml                         |  18 
providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_siliconflow.yaml                    |  47 
providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_together.yaml                       |  20 
providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_wandb.yaml                          | 154 
providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_baseten.yaml              |  26 
providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_chutes.yaml               |  28 
providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_deepinfra.yaml            |  28 
providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_fireworks.yaml            |  26 
providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_moonshotai.yaml           |  30 
providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_moonshotai/turbo.yaml     |  28 
providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_novita.yaml               |  26 
providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_siliconflow.yaml          |  28 
providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_together.yaml             |  28 
providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_wandb.yaml                |  28 
providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_baseten.yaml                          |  26 
providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_chutes.yaml                           |  26 
providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_deepinfra.yaml                        |  56 
providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_fireworks.yaml                        |  26 
providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_moonshotai.yaml                       |  26 
providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_moonshotai/turbo.yaml                 |  26 
providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_novita.yaml                           |  26 
providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_siliconflow.yaml                      |  26 
providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_together.yaml                         |  26 
providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_wandb.yaml                            |  84 
providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_baseten.yaml                | 201 
providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_chutes.yaml                 | 143 
providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_deepinfra.yaml              |  77 
providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_fireworks.yaml              | 143 
providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_moonshotai.yaml             | 203 
providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_moonshotai/turbo.yaml       | 173 
providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_novita.yaml                 | 127 
providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_siliconflow.yaml            | 197 
providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_together.yaml               | 151 
providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_wandb.yaml                  | 220 
providertests/thinking_test.go                                                                 |  90 
86 files changed, 5,943 insertions(+), 356 deletions(-)

Detailed changes

providertests/common_test.go 🔗

@@ -22,6 +22,8 @@ type builderPair struct {
 func testCommon(t *testing.T, pairs []builderPair) {
 	for _, pair := range pairs {
 		testSimple(t, pair)
+		testTool(t, pair)
+		testMultiTool(t, pair)
 	}
 }
 

providertests/testdata/TestAnthropicCommon/multi_tool_claude-sonnet-4.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 798
+        host: ""
+        body: '{"max_tokens":4000,"messages":[{"content":[{"text":"Add and multiply the number 2 and 3","type":"text"}],"role":"user"}],"model":"claude-sonnet-4-20250514","system":[{"text":"You are a helpful assistant. Always use both add and multiply at the same time.","type":"text"}],"tool_choice":{"disable_parallel_tool_use":false,"type":"auto"},"tools":[{"input_schema":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"add","description":"Add two numbers"},{"input_schema":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"multiply","description":"Multiply two numbers"}]}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - Anthropic/Go 1.10.0
+        url: https://api.anthropic.com/v1/messages
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: '{"id":"msg_013DyADL2b8gwq4uwov9GxR5","type":"message","role":"assistant","model":"claude-sonnet-4-20250514","content":[{"type":"text","text":"I''ll add and multiply 2 and 3 for you."},{"type":"tool_use","id":"toolu_01YZNn6ySZTtThrtxiT2abfn","name":"add","input":{"a":2,"b":3}},{"type":"tool_use","id":"toolu_01ASXi6vdP7BAesefAvRidof","name":"multiply","input":{"a":2,"b":3}}],"stop_reason":"tool_use","stop_sequence":null,"usage":{"input_tokens":502,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":135,"service_tier":"standard"}}'
+        headers:
+            Content-Type:
+              - application/json
+        status: 200 OK
+        code: 200
+        duration: 3.89495125s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1332
+        host: ""

providertests/testdata/TestAnthropicCommon/multi_tool_streaming_claude-sonnet-4.yaml 🔗

@@ -0,0 +1,157 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 812
+        host: ""
+        body: '{"max_tokens":4000,"messages":[{"content":[{"text":"Add and multiply the number 2 and 3","type":"text"}],"role":"user"}],"model":"claude-sonnet-4-20250514","system":[{"text":"You are a helpful assistant. Always use both add and multiply at the same time.","type":"text"}],"tool_choice":{"disable_parallel_tool_use":false,"type":"auto"},"tools":[{"input_schema":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"add","description":"Add two numbers"},{"input_schema":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"},"name":"multiply","description":"Multiply two numbers"}],"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - Anthropic/Go 1.10.0
+        url: https://api.anthropic.com/v1/messages
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            event: message_start
+            data: {"type":"message_start","message":{"id":"msg_0187V18q2Hm2atsKZf2PT1JR","type":"message","role":"assistant","model":"claude-sonnet-4-20250514","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":502,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":4,"service_tier":"standard"}} }
+
+            event: content_block_start
+            data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}              }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"I'll add an"}             }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d multiply the numbers 2 and 3 for"}}
+
+            event: ping
+            data: {"type": "ping"}
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" you."}   }
+
+            event: content_block_stop
+            data: {"type":"content_block_stop","index":0              }
+
+            event: content_block_start
+            data: {"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_01XmAjSozdWpZr5YL5qMH9La","name":"add","input":{}}              }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""}             }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\"a\":"}         }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" 2"} }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":", \"b\": 3}"}      }
+
+            event: content_block_stop
+            data: {"type":"content_block_stop","index":1              }
+
+            event: content_block_start
+            data: {"type":"content_block_start","index":2,"content_block":{"type":"tool_use","id":"toolu_01C3hLiMRwSQPofrTZnX42En","name":"multiply","input":{}}           }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":""}           }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":"{\"a\":"}  }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":" 2"}     }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":", \"b\""}   }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":2,"delta":{"type":"input_json_delta","partial_json":": 3}"} }
+
+            event: content_block_stop
+            data: {"type":"content_block_stop","index":2            }
+
+            event: message_delta
+            data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":502,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":137}            }
+
+            event: message_stop
+            data: {"type":"message_stop"     }
+
+        headers:
+            Content-Type:
+              - text/event-stream; charset=utf-8
+        status: 200 OK
+        code: 200
+        duration: 1.001479417s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1358
+        host: ""

providertests/testdata/TestAnthropicCommon/tool_claude-sonnet-4.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 496
+        host: ""
+        body: '{"max_tokens":4000,"messages":[{"content":[{"text":"What''s the weather in Florence,Italy?","type":"text"}],"role":"user"}],"model":"claude-sonnet-4-20250514","system":[{"text":"You are a helpful assistant","type":"text"}],"tool_choice":{"disable_parallel_tool_use":false,"type":"auto"},"tools":[{"input_schema":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location"}]}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - Anthropic/Go 1.10.0
+        url: https://api.anthropic.com/v1/messages
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: '{"id":"msg_01XS5ugdqXSWzdgv1t8KCAgM","type":"message","role":"assistant","model":"claude-sonnet-4-20250514","content":[{"type":"text","text":"I''ll get the weather information for Florence, Italy for you."},{"type":"tool_use","id":"toolu_01H9xgJiNz1LrNwZBL2mhDSZ","name":"weather","input":{"location":"Florence,Italy"}}],"stop_reason":"tool_use","stop_sequence":null,"usage":{"input_tokens":394,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":67,"service_tier":"standard"}}'
+        headers:
+            Content-Type:
+              - application/json
+        status: 200 OK
+        code: 200
+        duration: 2.846444333s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 869
+        host: ""
+        body: '{"max_tokens":4000,"messages":[{"content":[{"text":"What''s the weather in Florence,Italy?","type":"text"}],"role":"user"},{"content":[{"text":"I''ll get the weather information for Florence, Italy for you.","type":"text"},{"id":"toolu_01H9xgJiNz1LrNwZBL2mhDSZ","input":{"location":"Florence,Italy"},"name":"weather","type":"tool_use"}],"role":"assistant"},{"content":[{"tool_use_id":"toolu_01H9xgJiNz1LrNwZBL2mhDSZ","content":[{"text":"40 C","type":"text"}],"type":"tool_result"}],"role":"user"}],"model":"claude-sonnet-4-20250514","system":[{"text":"You are a helpful assistant","type":"text"}],"tool_choice":{"disable_parallel_tool_use":false,"type":"auto"},"tools":[{"input_schema":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location"}]}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - Anthropic/Go 1.10.0
+        url: https://api.anthropic.com/v1/messages
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: '{"id":"msg_013cdiX8KF7mYMg4iXHqHMq5","type":"message","role":"assistant","model":"claude-sonnet-4-20250514","content":[{"type":"text","text":"The current weather in Florence, Italy shows a temperature of 40°C (104°F). That''s quite hot! It would be a good idea to stay hydrated and seek shade or air conditioning if you''re planning to be outdoors."}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":476,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":53,"service_tier":"standard"}}'
+        headers:
+            Content-Type:
+              - application/json
+        status: 200 OK
+        code: 200
+        duration: 2.396289583s

providertests/testdata/TestAnthropicCommon/tool_streaming_claude-sonnet-4.yaml 🔗

@@ -0,0 +1,145 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 510
+        host: ""
+        body: '{"max_tokens":4000,"messages":[{"content":[{"text":"What''s the weather in Florence,Italy?","type":"text"}],"role":"user"}],"model":"claude-sonnet-4-20250514","system":[{"text":"You are a helpful assistant","type":"text"}],"tool_choice":{"disable_parallel_tool_use":false,"type":"auto"},"tools":[{"input_schema":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location"}],"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - Anthropic/Go 1.10.0
+        url: https://api.anthropic.com/v1/messages
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            event: message_start
+            data: {"type":"message_start","message":{"id":"msg_01Ev2qZySqgvcng4tnssxBCo","type":"message","role":"assistant","model":"claude-sonnet-4-20250514","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":394,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard"}}        }
+
+            event: content_block_start
+            data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}               }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"I'll get"}               }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" the current weather information for Florence, Italy for you."}         }
+
+            event: ping
+            data: {"type": "ping"}
+
+            event: content_block_stop
+            data: {"type":"content_block_stop","index":0               }
+
+            event: ping
+            data: {"type": "ping"}
+
+            event: content_block_start
+            data: {"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_01UJ8W4Q3xN4BF7BQbn4hx4p","name":"weather","input":{}}              }
+
+            event: ping
+            data: {"type": "ping"}
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""} }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\""}           }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"locat"}     }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ion\":"}  }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":" \"Florence, "}            }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"Italy\"}"}               }
+
+            event: content_block_stop
+            data: {"type":"content_block_stop","index":1          }
+
+            event: message_delta
+            data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":394,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":68}               }
+
+            event: message_stop
+            data: {"type":"message_stop"     }
+
+        headers:
+            Content-Type:
+              - text/event-stream; charset=utf-8
+        status: 200 OK
+        code: 200
+        duration: 990.073459ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 892
+        host: ""
+        body: '{"max_tokens":4000,"messages":[{"content":[{"text":"What''s the weather in Florence,Italy?","type":"text"}],"role":"user"},{"content":[{"text":"I''ll get the current weather information for Florence, Italy for you.","type":"text"},{"id":"toolu_01UJ8W4Q3xN4BF7BQbn4hx4p","input":{"location":"Florence, Italy"},"name":"weather","type":"tool_use"}],"role":"assistant"},{"content":[{"tool_use_id":"toolu_01UJ8W4Q3xN4BF7BQbn4hx4p","content":[{"text":"40 C","type":"text"}],"type":"tool_result"}],"role":"user"}],"model":"claude-sonnet-4-20250514","system":[{"text":"You are a helpful assistant","type":"text"}],"tool_choice":{"disable_parallel_tool_use":false,"type":"auto"},"tools":[{"input_schema":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"},"name":"weather","description":"Get weather information for a location"}],"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - Anthropic/Go 1.10.0
+        url: https://api.anthropic.com/v1/messages
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            event: message_start
+            data: {"type":"message_start","message":{"id":"msg_01UQXrLmqCxBjSvkL5m4cPoV","type":"message","role":"assistant","model":"claude-sonnet-4-20250514","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":477,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}}      }
+
+            event: content_block_start
+            data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}         }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"The current"}     }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" weather in Florence, Italy shows a temperature of 40°C ("}              }
+
+            event: ping
+            data: {"type": "ping"}
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"104°F). That's quite hot"}             }
+
+            event: content_block_delta
+            data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"! Florence is experiencing very warm weather today."}      }
+
+            event: content_block_stop
+            data: {"type":"content_block_stop","index":0     }
+
+            event: message_delta
+            data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":477,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":36}            }
+
+            event: message_stop
+            data: {"type":"message_stop"}
+
+        headers:
+            Content-Type:
+              - text/event-stream; charset=utf-8
+        status: 200 OK
+        code: 200
+        duration: 1.728299292s

providertests/testdata/TestGoogleCommon/multi_tool_gemini-2.5-flash.yaml 🔗

@@ -0,0 +1,136 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 809
+        host: generativelanguage.googleapis.com
+        body: |
+            {"contents":[{"parts":[{"text":"Add and multiply the number 2 and 3"}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"systemInstruction":{"parts":[{"text":"You are a helpful assistant. Always use both add and multiply at the same time."}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Add two numbers","name":"add","parameters":{"properties":{"a":{"description":"first number","type":"INTEGER"},"b":{"description":"second number","type":"INTEGER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Multiply two numbers","name":"multiply","parameters":{"properties":{"a":{"description":"first number","type":"INTEGER"},"b":{"description":"second number","type":"INTEGER"}},"required":["a","b"],"type":"OBJECT"}}]}]}
+        headers:
+            Content-Type:
+              - application/json
+            User-Agent:
+              - google-genai-sdk/1.23.0 gl-go/go1.25.1
+        url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: |
+            {
+              "candidates": [
+                {
+                  "content": {
+                    "parts": [
+                      {
+                        "functionCall": {
+                          "name": "add",
+                          "args": {
+                            "a": 2,
+                            "b": 3
+                          }
+                        },
+                        "thoughtSignature": "Cr4BAdHtim+cc4R/lZZLTviErIzS7PH5kRUo4UoV6HmeP9hVsd+EF2Q8ETzs2R7kYsXQJdQGwwNdgZiJDzl3lacLJGCY83hhVDlAa8WNRPC+xpZ6MvH2CbaV0MXk5kMmRwEmpzh/RkodNQ0EsSevnTJWpQ1oQxL8clBDKGAP+Xj4EeIXqdVoYK/b1bLl1kAn6CuDhQyWsP2F2A5fNR57Yg8qtAC3qniCWsvOQo8ol8kp2HH1buVko0MhE0bBGZg7Eg=="
+                      },
+                      {
+                        "functionCall": {
+                          "name": "multiply",
+                          "args": {
+                            "b": 3,
+                            "a": 2
+                          }
+                        }
+                      }
+                    ],
+                    "role": "model"
+                  },
+                  "finishReason": "STOP",
+                  "index": 0
+                }
+              ],
+              "usageMetadata": {
+                "promptTokenCount": 121,
+                "candidatesTokenCount": 36,
+                "totalTokenCount": 196,
+                "promptTokensDetails": [
+                  {
+                    "modality": "TEXT",
+                    "tokenCount": 121
+                  }
+                ],
+                "thoughtsTokenCount": 39
+              },
+              "modelVersion": "gemini-2.5-flash",
+              "responseId": "X9XSaI6dKcy0vdIPx7qMAQ"
+            }
+        headers:
+            Content-Type:
+              - application/json; charset=UTF-8
+        status: 200 OK
+        code: 200
+        duration: 868.600833ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1156
+        host: generativelanguage.googleapis.com
+        body: |

providertests/testdata/TestGoogleCommon/multi_tool_gemini-2.5-pro.yaml 🔗

@@ -0,0 +1,136 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 809
+        host: generativelanguage.googleapis.com
+        body: |
+            {"contents":[{"parts":[{"text":"Add and multiply the number 2 and 3"}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"systemInstruction":{"parts":[{"text":"You are a helpful assistant. Always use both add and multiply at the same time."}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Add two numbers","name":"add","parameters":{"properties":{"a":{"description":"first number","type":"INTEGER"},"b":{"description":"second number","type":"INTEGER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Multiply two numbers","name":"multiply","parameters":{"properties":{"a":{"description":"first number","type":"INTEGER"},"b":{"description":"second number","type":"INTEGER"}},"required":["a","b"],"type":"OBJECT"}}]}]}
+        headers:
+            Content-Type:
+              - application/json
+            User-Agent:
+              - google-genai-sdk/1.23.0 gl-go/go1.25.1
+        url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: |
+            {
+              "candidates": [
+                {
+                  "content": {
+                    "parts": [
+                      {
+                        "functionCall": {
+                          "name": "add",
+                          "args": {
+                            "b": 3,
+                            "a": 2
+                          }
+                        },
+                        "thoughtSignature": "CvAEAdHtim/2ef1jh8ZO4NSTOv4dXIwLikxDXe8Ro2kEJe7fBF1Ld1CgmVbNeXTZM6GbyyR/i/h4PwW1K6h7FVR+iXt/SUeEqxpcSaVbTLqb0qZEZafWTZGACKh7YQXo3RgvUWLpMhaU0geEtvTYgEGfvCNdqMpJ9cWRGGAWsOLbo6Fht51RGOTTrJ3YtR7Tvkuky99o1eomQnat/o0JLRdOOr4wEpLKveVOM8ZqVsr8f3rKirOK1cLmeKkM4CRsXO5UnvFzAwlYjMLCx+/l4jWWXBZgQo8A+oa9ZEndYBcmPWmI2V0xwfavRFL9zSE/dhOHVdtceebbbashVHCbOZOJt4ZadvDUr7JP1kXqSEKMPyqiZZ2tPrs4+6Ox1TFIpc2bXPNcUV3DohoN8QvM9iI1+bmDcYoR1JSKsFmQc0VnLZ7IherjoJsy/shZYmAO54hSmMb9U3YM0Whs7ba47+eQlsccv8teNjCksDj0nERGPuedk+Nsmk+vdudmgQNIIVMovaXaS4cvNT2eElUlPRcjpYm/9etxMgFJWP6bwRyVgUFL4AmKjiEYFeks7T7iXblGacLp5RArO2Dbd/R0oc/mN6LUaO27dpnbZoZqFKDMoI2EztI9EboXw6uxTKsyr8Sa/eGCrVgy1c7C4gswi6kVSwxmIQ+6R10OeAQqwFWn1D302UpaQQIdedmKU9EnxRXE4DTy64A7ND0iwVaOucijKPco/lhNSkxZ51frodeIo534wwguW1gj9cbsisBMi2Ac6snXifQIyxa7HLlbZEQT/w4dOdkzEys6jZpndOLUtIFkOMIAkzw+CBC8VvoMvMPD"
+                      },
+                      {
+                        "functionCall": {
+                          "name": "multiply",
+                          "args": {
+                            "b": 3,
+                            "a": 2
+                          }
+                        }
+                      }
+                    ],
+                    "role": "model"
+                  },
+                  "finishReason": "STOP",
+                  "index": 0
+                }
+              ],
+              "usageMetadata": {
+                "promptTokenCount": 121,
+                "candidatesTokenCount": 36,
+                "totalTokenCount": 322,
+                "promptTokensDetails": [
+                  {
+                    "modality": "TEXT",
+                    "tokenCount": 121
+                  }
+                ],
+                "thoughtsTokenCount": 165
+              },
+              "modelVersion": "gemini-2.5-pro",
+              "responseId": "b9XSaPb2POvVvdIP38GV4Qg"
+            }
+        headers:
+            Content-Type:
+              - application/json; charset=UTF-8
+        status: 200 OK
+        code: 200
+        duration: 3.517938292s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1156
+        host: generativelanguage.googleapis.com
+        body: |

providertests/testdata/TestGoogleCommon/multi_tool_streaming_gemini-2.5-flash.yaml 🔗

@@ -0,0 +1,65 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 809
+        host: generativelanguage.googleapis.com
+        body: |
+            {"contents":[{"parts":[{"text":"Add and multiply the number 2 and 3"}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"systemInstruction":{"parts":[{"text":"You are a helpful assistant. Always use both add and multiply at the same time."}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Add two numbers","name":"add","parameters":{"properties":{"a":{"description":"first number","type":"INTEGER"},"b":{"description":"second number","type":"INTEGER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Multiply two numbers","name":"multiply","parameters":{"properties":{"a":{"description":"first number","type":"INTEGER"},"b":{"description":"second number","type":"INTEGER"}},"required":["a","b"],"type":"OBJECT"}}]}]}
+        form:
+            alt:
+              - sse
+        headers:
+            Content-Type:
+              - application/json
+            User-Agent:
+              - google-genai-sdk/1.23.0 gl-go/go1.25.1
+        url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: "data: {\"candidates\": [{\"content\": {\"parts\": [{\"functionCall\": {\"name\": \"add\",\"args\": {\"a\": 2,\"b\": 3}},\"thoughtSignature\": \"CiQB0e2Kb5E4OKCjT4VbQFskqctTHECXFCFdGLgtecb7MATYuf0KYwHR7YpvQnkPjihUHBTCrEWPMUSb693t60aNSBxzH3hsLILr/4CMENrVt4/Ozv9/FJAaYeleQ+NgcgmZGjDhvi4NkYF2+xHMwQxg4Ttvug7TSfjXbPmFqbAfvZ0vdtpyZNCZXwp2AdHtim8HBUjRxC/09SLxzygTNmatbBIMu/fYEdX2fZUQvNxneovtPMAg0cT/FZb7Fwb+YHzkRRoR0ua3rwTvz1E3CuH2+uqGK6i4iJGnB06TJMEFL1rdspnIX8YCKta1xQ5OZ9nwpjJ7c/7KY+QJJWUsp3k6qA==\"},{\"functionCall\": {\"name\": \"multiply\",\"args\": {\"b\": 3,\"a\": 2}}}],\"role\": \"model\"},\"finishReason\": \"STOP\",\"index\": 0}],\"usageMetadata\": {\"promptTokenCount\": 121,\"candidatesTokenCount\": 36,\"totalTokenCount\": 195,\"promptTokensDetails\": [{\"modality\": \"TEXT\",\"tokenCount\": 121}],\"thoughtsTokenCount\": 38},\"modelVersion\": \"gemini-2.5-flash\",\"responseId\": \"YdXSaPvvCvasvdIPrPSs8A8\"}\r\n\r\n"
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 598.797416ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1156
+        host: generativelanguage.googleapis.com
+        body: |

providertests/testdata/TestGoogleCommon/multi_tool_streaming_gemini-2.5-pro.yaml 🔗

@@ -0,0 +1,65 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 809
+        host: generativelanguage.googleapis.com
+        body: |
+            {"contents":[{"parts":[{"text":"Add and multiply the number 2 and 3"}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"systemInstruction":{"parts":[{"text":"You are a helpful assistant. Always use both add and multiply at the same time."}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Add two numbers","name":"add","parameters":{"properties":{"a":{"description":"first number","type":"INTEGER"},"b":{"description":"second number","type":"INTEGER"}},"required":["a","b"],"type":"OBJECT"}},{"description":"Multiply two numbers","name":"multiply","parameters":{"properties":{"a":{"description":"first number","type":"INTEGER"},"b":{"description":"second number","type":"INTEGER"}},"required":["a","b"],"type":"OBJECT"}}]}]}
+        form:
+            alt:
+              - sse
+        headers:
+            Content-Type:
+              - application/json
+            User-Agent:
+              - google-genai-sdk/1.23.0 gl-go/go1.25.1
+        url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:streamGenerateContent?alt=sse
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1

providertests/testdata/TestGoogleCommon/tool_gemini-2.5-flash.yaml 🔗

@@ -0,0 +1,126 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 509
+        host: generativelanguage.googleapis.com
+        body: |
+            {"contents":[{"parts":[{"text":"What's the weather in Florence,Italy?"}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]}
+        headers:
+            Content-Type:
+              - application/json
+            User-Agent:
+              - google-genai-sdk/1.23.0 gl-go/go1.25.1
+        url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: |
+            {
+              "candidates": [
+                {
+                  "content": {
+                    "parts": [
+                      {
+                        "functionCall": {
+                          "name": "weather",
+                          "args": {
+                            "location": "Florence,Italy"
+                          }
+                        },
+                        "thoughtSignature": "CrICAdHtim/gZoWocgB+XI87BU6vh9bvMt0gEZv5kkwIiXSyxYqnM5y1VgXh7GyS65m7wqlKPsHg5Qbk5DHsCSzvu9XP7s3K+FbzV/bVHJ0Ajm+lNrK1n5zAQPx5FVDV9CYW39XxT8tF8DBOH7y1/dafG0z3J4N/ZGoU5QudSwp99SiGWa4RHIEL1nIoZf2a3WPUrmNfBwvtZNL8Un4fDbTeAjwULvAhGKopxpihz/RNGrRgsGrC7j2NZKMWjYCXddMNW1w2y49VqZa1JUwDAUREHAPqBxabgjQnGHRFUrc7FgZycp3dieT+0FFiiVDGdw+B94pucHg6LZqZw/PRD8Va4KZI1uT0ljtD0Z8/ALD4m9+5S9C/eCCsy6VKlinKx5Yarlu/TDFE0UG+WDUMC9J0ff3m"
+                      }
+                    ],
+                    "role": "model"
+                  },
+                  "finishReason": "STOP",
+                  "index": 0
+                }
+              ],
+              "usageMetadata": {
+                "promptTokenCount": 54,
+                "candidatesTokenCount": 15,
+                "totalTokenCount": 133,
+                "promptTokensDetails": [
+                  {
+                    "modality": "TEXT",
+                    "tokenCount": 54
+                  }
+                ],
+                "thoughtsTokenCount": 64
+              },
+              "modelVersion": "gemini-2.5-flash",
+              "responseId": "XNXSaO-0M_rlvdIP9eyjqQo"
+            }
+        headers:
+            Content-Type:
+              - application/json; charset=UTF-8
+        status: 200 OK
+        code: 200
+        duration: 1.271185916s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 734
+        host: generativelanguage.googleapis.com
+        body: |
+            {"contents":[{"parts":[{"text":"What's the weather in Florence,Italy?"}],"role":"user"},{"parts":[{"functionCall":{"args":{"location":"Florence,Italy"},"id":"weather","name":"weather"}}],"role":"model"},{"parts":[{"functionResponse":{"id":"weather","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]}
+        headers:
+            Content-Type:
+              - application/json
+            User-Agent:
+              - google-genai-sdk/1.23.0 gl-go/go1.25.1
+        url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: |
+            {
+              "candidates": [
+                {
+                  "content": {
+                    "parts": [
+                      {
+                        "text": "The weather in Florence, Italy is 40 C."
+                      }
+                    ],
+                    "role": "model"
+                  },
+                  "finishReason": "STOP",
+                  "index": 0
+                }
+              ],
+              "usageMetadata": {
+                "promptTokenCount": 84,
+                "candidatesTokenCount": 12,
+                "totalTokenCount": 96,
+                "promptTokensDetails": [
+                  {
+                    "modality": "TEXT",
+                    "tokenCount": 84
+                  }
+                ]
+              },
+              "modelVersion": "gemini-2.5-flash",
+              "responseId": "XdXSaNjmFuSExN8Pu5SpuQY"
+            }
+        headers:
+            Content-Type:
+              - application/json; charset=UTF-8
+        status: 200 OK
+        code: 200
+        duration: 524.095333ms

providertests/testdata/TestGoogleCommon/tool_gemini-2.5-pro.yaml 🔗

@@ -0,0 +1,126 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 509
+        host: generativelanguage.googleapis.com
+        body: |
+            {"contents":[{"parts":[{"text":"What's the weather in Florence,Italy?"}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]}
+        headers:
+            Content-Type:
+              - application/json
+            User-Agent:
+              - google-genai-sdk/1.23.0 gl-go/go1.25.1
+        url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: |
+            {
+              "candidates": [
+                {
+                  "content": {
+                    "parts": [
+                      {
+                        "functionCall": {
+                          "name": "weather",
+                          "args": {
+                            "location": "Florence, Italy"
+                          }
+                        },
+                        "thoughtSignature": "CtkEAdHtim8vRS2q1TrAJdxVzvbHAeN0QbQAxCL0vvQyS4N+jnaAROjFe/JfRm0AorpQwVb54O4bSeJY+Z7KC+fvGGVBX0GsrBxovx6ekQGfiUee4CI/sl6QpXoHc0go3sAl5Lmem2aSWbVkmNUz02PvcVvt8E4y2unBFPbmho4yM7hNDwOP1Rlr1GAjjTyapXMBJFPC6PHAUZXtOEmGc3xMur89XZrt1YAQuW/FOliDSYSmSZbu+DiEWu0UrGnwKXVq7vPpB939rowjTKN35sW0iifbEy2AQm0WfPyD6Qcwejx2K1RHcesW7G2Syn/07ckElPDJNXjt1rKdpBD63RuaqfyIfNXLfXWTIsb2T/wh1X8FCBQl0802uN5khAkRfhMmGkD53lp874f62Yph8c68Wbogkbl9NvH8t4ZWaa5K+lT4jAJXHOtkiCOAiCxsHaYz/DHxmghcPL8kZomsoFCKq/Q2HsBgDu1piTm6Oj2dUs1hCO0pa8Q5jjpwS64ASDC9JZYYpOoQUWmtlth1KR3C8UxDa0WIS7by6QTA7mY0cQSr3XEQcn1UHnc0FFCoolR2PJxOK2n7ZFLPn3b+RDme0urxYoF3GAZOvGBf/bY9tNV5WYamVPX633iXJE6KZb2WxvbYEeEg8khe09/sQmPffQ9/Br7PAdCyrgGKfHqwkWQP/dI/5Wq4cIfmHtBIwBQlRo3eG3fz9yAyJZh/dLa2V7Y7R/fShTf7f4TUdtnRR3u1DghargS9thMZQ9KBx1/CNCcBu2P8f/H3SJ7rJqtN4YA7e01eDLVRVg=="
+                      }
+                    ],
+                    "role": "model"
+                  },
+                  "finishReason": "STOP",
+                  "index": 0
+                }
+              ],
+              "usageMetadata": {
+                "promptTokenCount": 54,
+                "candidatesTokenCount": 15,
+                "totalTokenCount": 211,
+                "promptTokensDetails": [
+                  {
+                    "modality": "TEXT",
+                    "tokenCount": 54
+                  }
+                ],
+                "thoughtsTokenCount": 142
+              },
+              "modelVersion": "gemini-2.5-pro",
+              "responseId": "ZNXSaLjiNNTVxN8P_4XRCQ"
+            }
+        headers:
+            Content-Type:
+              - application/json; charset=UTF-8
+        status: 200 OK
+        code: 200
+        duration: 2.822218166s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 735
+        host: generativelanguage.googleapis.com
+        body: |
+            {"contents":[{"parts":[{"text":"What's the weather in Florence,Italy?"}],"role":"user"},{"parts":[{"functionCall":{"args":{"location":"Florence, Italy"},"id":"weather","name":"weather"}}],"role":"model"},{"parts":[{"functionResponse":{"id":"weather","name":"weather","response":{"result":"40 C"}}}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]}
+        headers:
+            Content-Type:
+              - application/json
+            User-Agent:
+              - google-genai-sdk/1.23.0 gl-go/go1.25.1
+        url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: |
+            {
+              "candidates": [
+                {
+                  "content": {
+                    "parts": [
+                      {
+                        "text": "The weather in Florence, Italy is 40 C. \n"
+                      }
+                    ],
+                    "role": "model"
+                  },
+                  "finishReason": "STOP",
+                  "index": 0
+                }
+              ],
+              "usageMetadata": {
+                "promptTokenCount": 84,
+                "candidatesTokenCount": 12,
+                "totalTokenCount": 96,
+                "promptTokensDetails": [
+                  {
+                    "modality": "TEXT",
+                    "tokenCount": 84
+                  }
+                ]
+              },
+              "modelVersion": "gemini-2.5-pro",
+              "responseId": "ZtXSaPujMt_UxN8PwdDxuAI"
+            }
+        headers:
+            Content-Type:
+              - application/json; charset=UTF-8
+        status: 200 OK
+        code: 200
+        duration: 1.956346125s

providertests/testdata/TestGoogleCommon/tool_streaming_gemini-2.5-flash.yaml 🔗

@@ -0,0 +1,65 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 509
+        host: generativelanguage.googleapis.com
+        body: |
+            {"contents":[{"parts":[{"text":"What's the weather in Florence,Italy?"}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]}
+        form:
+            alt:
+              - sse
+        headers:
+            Content-Type:
+              - application/json
+            User-Agent:
+              - google-genai-sdk/1.23.0 gl-go/go1.25.1
+        url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1

providertests/testdata/TestGoogleCommon/tool_streaming_gemini-2.5-pro.yaml 🔗

@@ -0,0 +1,65 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 509
+        host: generativelanguage.googleapis.com
+        body: |
+            {"contents":[{"parts":[{"text":"What's the weather in Florence,Italy?"}],"role":"user"}],"generationConfig":{"maxOutputTokens":4000},"systemInstruction":{"parts":[{"text":"You are a helpful assistant"}],"role":"user"},"toolConfig":{"functionCallingConfig":{"mode":"AUTO"}},"tools":[{"functionDeclarations":[{"description":"Get weather information for a location","name":"weather","parameters":{"properties":{"location":{"description":"the city","type":"STRING"}},"required":["location"],"type":"OBJECT"}}]}]}
+        form:
+            alt:
+              - sse
+        headers:
+            Content-Type:
+              - application/json
+            User-Agent:
+              - google-genai-sdk/1.23.0 gl-go/go1.25.1
+        url: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:streamGenerateContent?alt=sse
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1

providertests/testdata/TestOpenAICommon/multi_tool_gpt-4o-mini.yaml 🔗

@@ -0,0 +1,153 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 799
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"gpt-4o-mini","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}]}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: |
+            {
+              "id": "chatcmpl-CJ0tEeBsiJrcCok70gEzlNzmL8vYx",
+              "object": "chat.completion",
+              "created": 1758647688,
+              "model": "gpt-4o-mini-2024-07-18",
+              "choices": [
+                {
+                  "index": 0,
+                  "message": {
+                    "role": "assistant",
+                    "content": null,
+                    "tool_calls": [
+                      {
+                        "id": "call_IuNta21HfV8XZ4sGOz1xX6s0",
+                        "type": "function",
+                        "function": {
+                          "name": "add",
+                          "arguments": "{\"a\": 2, \"b\": 3}"
+                        }
+                      },
+                      {
+                        "id": "call_KVjSGunOLjNXLkrMpvLxMu9u",
+                        "type": "function",
+                        "function": {
+                          "name": "multiply",
+                          "arguments": "{\"a\": 2, \"b\": 3}"
+                        }
+                      }
+                    ],
+                    "refusal": null,
+                    "annotations": []
+                  },
+                  "logprobs": null,
+                  "finish_reason": "tool_calls"
+                }
+              ],
+              "usage": {
+                "prompt_tokens": 106,
+                "completion_tokens": 50,
+                "total_tokens": 156,
+                "prompt_tokens_details": {
+                  "cached_tokens": 0,
+                  "audio_tokens": 0
+                },
+                "completion_tokens_details": {
+                  "reasoning_tokens": 0,
+                  "audio_tokens": 0,
+                  "accepted_prediction_tokens": 0,
+                  "rejected_prediction_tokens": 0
+                }
+              },
+              "service_tier": "default",
+              "system_fingerprint": "fp_560af6e559"
+            }
+        headers:
+            Content-Type:
+              - application/json
+        status: 200 OK
+        code: 200
+        duration: 2.610235s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1230
+        host: ""

providertests/testdata/TestOpenAICommon/multi_tool_gpt-4o.yaml 🔗

@@ -0,0 +1,153 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 794
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"gpt-4o","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}]}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: |
+            {
+              "id": "chatcmpl-CJ0t5GEkpC4J8lWcgG3S3FTg4kEUw",
+              "object": "chat.completion",
+              "created": 1758647679,
+              "model": "gpt-4o-2024-08-06",
+              "choices": [
+                {
+                  "index": 0,
+                  "message": {
+                    "role": "assistant",
+                    "content": null,
+                    "tool_calls": [
+                      {
+                        "id": "call_SyTwOtPIqGPjiZoULQYimQkl",
+                        "type": "function",
+                        "function": {
+                          "name": "add",
+                          "arguments": "{\"a\": 2, \"b\": 3}"
+                        }
+                      },
+                      {
+                        "id": "call_dWNYAaqowSo1vI3YIjpFAwHp",
+                        "type": "function",
+                        "function": {
+                          "name": "multiply",
+                          "arguments": "{\"a\": 2, \"b\": 3}"
+                        }
+                      }
+                    ],
+                    "refusal": null,
+                    "annotations": []
+                  },
+                  "logprobs": null,
+                  "finish_reason": "tool_calls"
+                }
+              ],
+              "usage": {
+                "prompt_tokens": 106,
+                "completion_tokens": 50,
+                "total_tokens": 156,
+                "prompt_tokens_details": {
+                  "cached_tokens": 0,
+                  "audio_tokens": 0
+                },
+                "completion_tokens_details": {
+                  "reasoning_tokens": 0,
+                  "audio_tokens": 0,
+                  "accepted_prediction_tokens": 0,
+                  "rejected_prediction_tokens": 0
+                }
+              },
+              "service_tier": "default",
+              "system_fingerprint": "fp_cbf1785567"
+            }
+        headers:
+            Content-Type:
+              - application/json
+        status: 200 OK
+        code: 200
+        duration: 945.390333ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1225
+        host: ""

providertests/testdata/TestOpenAICommon/multi_tool_gpt-5.yaml 🔗

@@ -0,0 +1,151 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 804
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"gpt-5","max_completion_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}]}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: |
+            {
+              "id": "chatcmpl-CJ0tchUwNad6KkHQ8EvUT3IOQeVrI",
+              "object": "chat.completion",
+              "created": 1758647712,
+              "model": "gpt-5-2025-08-07",
+              "choices": [
+                {
+                  "index": 0,
+                  "message": {
+                    "role": "assistant",
+                    "content": null,
+                    "tool_calls": [
+                      {
+                        "id": "call_AJvaByHRmrdY8F8ahTfyEuwt",
+                        "type": "function",
+                        "function": {
+                          "name": "add",
+                          "arguments": "{\"a\": 2, \"b\": 3}"
+                        }
+                      },
+                      {
+                        "id": "call_YZPAky6rN2y6wFVa8dFpv8bS",
+                        "type": "function",
+                        "function": {
+                          "name": "multiply",
+                          "arguments": "{\"a\": 2, \"b\": 3}"
+                        }
+                      }
+                    ],
+                    "refusal": null,
+                    "annotations": []
+                  },
+                  "finish_reason": "tool_calls"
+                }
+              ],
+              "usage": {
+                "prompt_tokens": 190,
+                "completion_tokens": 315,
+                "total_tokens": 505,
+                "prompt_tokens_details": {
+                  "cached_tokens": 0,
+                  "audio_tokens": 0
+                },
+                "completion_tokens_details": {
+                  "reasoning_tokens": 256,
+                  "audio_tokens": 0,
+                  "accepted_prediction_tokens": 0,
+                  "rejected_prediction_tokens": 0
+                }
+              },
+              "service_tier": "default",
+              "system_fingerprint": null
+            }
+        headers:
+            Content-Type:
+              - application/json
+        status: 200 OK
+        code: 200
+        duration: 4.623959125s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1235
+        host: ""

providertests/testdata/TestOpenAICommon/multi_tool_streaming_gpt-4o-mini.yaml 🔗

@@ -0,0 +1,151 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 853
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"gpt-4o-mini","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"chatcmpl-CJ0tHVHEl3lIe2EokHvXwIgQS66p4","object":"chat.completion.chunk","created":1758647691,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null},"logprobs":null,"finish_reason":null}],"obfuscation":"SoU4qb"}
+
+            data: {"id":"chatcmpl-CJ0tHVHEl3lIe2EokHvXwIgQS66p4","object":"chat.completion.chunk","created":1758647691,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_jkkFAJnsPgeuEXqRmh2NmIna","type":"function","function":{"name":"add","arguments":""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"ePDqXVoESY1Tc"}
+
+            data: {"id":"chatcmpl-CJ0tHVHEl3lIe2EokHvXwIgQS66p4","object":"chat.completion.chunk","created":1758647691,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"a\""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"tiGL9aWnzPn"}
+
+            data: {"id":"chatcmpl-CJ0tHVHEl3lIe2EokHvXwIgQS66p4","object":"chat.completion.chunk","created":1758647691,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":": 2, "}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"u7nRrcON6AyP"}
+
+            data: {"id":"chatcmpl-CJ0tHVHEl3lIe2EokHvXwIgQS66p4","object":"chat.completion.chunk","created":1758647691,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"b\": 3"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"ixzC46ubw"}
+
+            data: {"id":"chatcmpl-CJ0tHVHEl3lIe2EokHvXwIgQS66p4","object":"chat.completion.chunk","created":1758647691,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":""}
+
+            data: {"id":"chatcmpl-CJ0tHVHEl3lIe2EokHvXwIgQS66p4","object":"chat.completion.chunk","created":1758647691,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"id":"call_vNaooQUOTpYbLfI21M7KDdO8","type":"function","function":{"name":"multiply","arguments":""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"TMfEGedN"}
+
+            data: {"id":"chatcmpl-CJ0tHVHEl3lIe2EokHvXwIgQS66p4","object":"chat.completion.chunk","created":1758647691,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"{\"a\""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"77TxcnMfqPT"}
+
+            data: {"id":"chatcmpl-CJ0tHVHEl3lIe2EokHvXwIgQS66p4","object":"chat.completion.chunk","created":1758647691,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":": 2, "}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"7lYVPr77JJ2t"}
+
+            data: {"id":"chatcmpl-CJ0tHVHEl3lIe2EokHvXwIgQS66p4","object":"chat.completion.chunk","created":1758647691,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"\"b\": 3"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"VBpxJCMFB"}
+
+            data: {"id":"chatcmpl-CJ0tHVHEl3lIe2EokHvXwIgQS66p4","object":"chat.completion.chunk","created":1758647691,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"}"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":""}
+
+            data: {"id":"chatcmpl-CJ0tHVHEl3lIe2EokHvXwIgQS66p4","object":"chat.completion.chunk","created":1758647691,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null,"obfuscation":"QcdFHMZq8lKk9EQ"}
+
+            data: {"id":"chatcmpl-CJ0tHVHEl3lIe2EokHvXwIgQS66p4","object":"chat.completion.chunk","created":1758647691,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[],"usage":{"prompt_tokens":106,"completion_tokens":50,"total_tokens":156,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"JtZHEabj"}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream; charset=utf-8
+        status: 200 OK
+        code: 200
+        duration: 1.67145325s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1284
+        host: ""

providertests/testdata/TestOpenAICommon/multi_tool_streaming_gpt-4o.yaml 🔗

@@ -0,0 +1,135 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 848
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"gpt-4o","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"chatcmpl-CJ0t8wpMovl963ZFdkn54mrweOWnn","object":"chat.completion.chunk","created":1758647682,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null},"logprobs":null,"finish_reason":null}],"obfuscation":"rZrKTLuaM3M"}
+
+            data: {"id":"chatcmpl-CJ0t8wpMovl963ZFdkn54mrweOWnn","object":"chat.completion.chunk","created":1758647682,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_we49ixAiJiXtgOjX53hUNsWh","type":"function","function":{"name":"add","arguments":""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"xC"}
+
+            data: {"id":"chatcmpl-CJ0t8wpMovl963ZFdkn54mrweOWnn","object":"chat.completion.chunk","created":1758647682,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"a\""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":""}
+
+            data: {"id":"chatcmpl-CJ0t8wpMovl963ZFdkn54mrweOWnn","object":"chat.completion.chunk","created":1758647682,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":": 2, "}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"s"}
+
+            data: {"id":"chatcmpl-CJ0t8wpMovl963ZFdkn54mrweOWnn","object":"chat.completion.chunk","created":1758647682,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"b\": 3"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"86lv6E0lmuGNjz"}
+
+            data: {"id":"chatcmpl-CJ0t8wpMovl963ZFdkn54mrweOWnn","object":"chat.completion.chunk","created":1758647682,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"FrLtX"}
+
+            data: {"id":"chatcmpl-CJ0t8wpMovl963ZFdkn54mrweOWnn","object":"chat.completion.chunk","created":1758647682,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"id":"call_eD7lMai9kbcUCwMSMVjUlZ3T","type":"function","function":{"name":"multiply","arguments":""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"uMHWC2JgrOs0S"}
+
+            data: {"id":"chatcmpl-CJ0t8wpMovl963ZFdkn54mrweOWnn","object":"chat.completion.chunk","created":1758647682,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"{\"a\""}}]},"logprobs":null,"finish_reason":null}],"obfuscation":""}
+
+            data: {"id":"chatcmpl-CJ0t8wpMovl963ZFdkn54mrweOWnn","object":"chat.completion.chunk","created":1758647682,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":": 2, "}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"8"}
+
+            data: {"id":"chatcmpl-CJ0t8wpMovl963ZFdkn54mrweOWnn","object":"chat.completion.chunk","created":1758647682,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"\"b\": 3"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"1Wrmr2yk0U8VVN"}
+
+            data: {"id":"chatcmpl-CJ0t8wpMovl963ZFdkn54mrweOWnn","object":"chat.completion.chunk","created":1758647682,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"}"}}]},"logprobs":null,"finish_reason":null}],"obfuscation":"1QpiI"}
+
+            data: {"id":"chatcmpl-CJ0t8wpMovl963ZFdkn54mrweOWnn","object":"chat.completion.chunk","created":1758647682,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null,"obfuscation":"qrCP"}
+
+            data: {"id":"chatcmpl-CJ0t8wpMovl963ZFdkn54mrweOWnn","object":"chat.completion.chunk","created":1758647682,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":106,"completion_tokens":50,"total_tokens":156,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"iRO6qrkatl8EM"}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream; charset=utf-8
+        status: 200 OK
+        code: 200
+        duration: 1.6431095s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1279
+        host: ""

providertests/testdata/TestOpenAICommon/multi_tool_streaming_gpt-5.yaml 🔗

@@ -0,0 +1,119 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 858
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"gpt-5","max_completion_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"chatcmpl-CJ0tifk5FC2DwlB6VneFqF0Yna04m","object":"chat.completion.chunk","created":1758647718,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null},"finish_reason":null}],"obfuscation":"km7Grds"}
+
+            data: {"id":"chatcmpl-CJ0tifk5FC2DwlB6VneFqF0Yna04m","object":"chat.completion.chunk","created":1758647718,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_LhPyB94mYobHVZ8vmXMPXkNq","type":"function","function":{"name":"add","arguments":""}}]},"finish_reason":null}],"obfuscation":"Si4eoFcHEyKfaY"}
+
+            data: {"id":"chatcmpl-CJ0tifk5FC2DwlB6VneFqF0Yna04m","object":"chat.completion.chunk","created":1758647718,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"a\""}}]},"finish_reason":null}],"obfuscation":"b6S4Y8B7WWgc"}
+
+            data: {"id":"chatcmpl-CJ0tifk5FC2DwlB6VneFqF0Yna04m","object":"chat.completion.chunk","created":1758647718,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":": 2, "}}]},"finish_reason":null}],"obfuscation":"CL9dblOJFBp4h"}
+
+            data: {"id":"chatcmpl-CJ0tifk5FC2DwlB6VneFqF0Yna04m","object":"chat.completion.chunk","created":1758647718,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"b\": 3"}}]},"finish_reason":null}],"obfuscation":"57iKH8Ot4E"}
+
+            data: {"id":"chatcmpl-CJ0tifk5FC2DwlB6VneFqF0Yna04m","object":"chat.completion.chunk","created":1758647718,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"obfuscation":"F"}
+
+            data: {"id":"chatcmpl-CJ0tifk5FC2DwlB6VneFqF0Yna04m","object":"chat.completion.chunk","created":1758647718,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"id":"call_WIQB4Obh8PH2URd87v1AujZk","type":"function","function":{"name":"multiply","arguments":""}}]},"finish_reason":null}],"obfuscation":"reX6nET1B"}
+
+            data: {"id":"chatcmpl-CJ0tifk5FC2DwlB6VneFqF0Yna04m","object":"chat.completion.chunk","created":1758647718,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"{\"a\""}}]},"finish_reason":null}],"obfuscation":"Rw71Xfho3jnc"}
+
+            data: {"id":"chatcmpl-CJ0tifk5FC2DwlB6VneFqF0Yna04m","object":"chat.completion.chunk","created":1758647718,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":": 2, "}}]},"finish_reason":null}],"obfuscation":"RUeTmIcp8tTUV"}
+
+            data: {"id":"chatcmpl-CJ0tifk5FC2DwlB6VneFqF0Yna04m","object":"chat.completion.chunk","created":1758647718,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"\"b\": 3"}}]},"finish_reason":null}],"obfuscation":"fPhRBnL1V0"}
+
+            data: {"id":"chatcmpl-CJ0tifk5FC2DwlB6VneFqF0Yna04m","object":"chat.completion.chunk","created":1758647718,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"}"}}]},"finish_reason":null}],"obfuscation":"I"}
+
+            data: {"id":"chatcmpl-CJ0tifk5FC2DwlB6VneFqF0Yna04m","object":"chat.completion.chunk","created":1758647718,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""}
+
+            data: {"id":"chatcmpl-CJ0tifk5FC2DwlB6VneFqF0Yna04m","object":"chat.completion.chunk","created":1758647718,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":190,"completion_tokens":187,"total_tokens":377,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":128,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"zsdmTK"}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream; charset=utf-8
+        status: 200 OK
+        code: 200
+        duration: 3.60880975s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1289
+        host: ""

providertests/testdata/TestOpenAICommon/tool_gpt-4o-mini.yaml 🔗

@@ -0,0 +1,145 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 453
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"gpt-4o-mini","max_tokens":4000,"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"}]}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: |
+            {
+              "id": "chatcmpl-CJ0tA9of0CM8ETGXxfZdS7K2U6fhV",
+              "object": "chat.completion",
+              "created": 1758647684,
+              "model": "gpt-4o-mini-2024-07-18",
+              "choices": [
+                {
+                  "index": 0,
+                  "message": {
+                    "role": "assistant",
+                    "content": null,
+                    "tool_calls": [
+                      {
+                        "id": "call_yWcF6pOXZEasjvDtCEk2QMxi",
+                        "type": "function",
+                        "function": {
+                          "name": "weather",
+                          "arguments": "{\"location\":\"Florence, Italy\"}"
+                        }
+                      }
+                    ],
+                    "refusal": null,
+                    "annotations": []
+                  },
+                  "logprobs": null,
+                  "finish_reason": "tool_calls"
+                }
+              ],
+              "usage": {
+                "prompt_tokens": 61,
+                "completion_tokens": 16,
+                "total_tokens": 77,
+                "prompt_tokens_details": {
+                  "cached_tokens": 0,
+                  "audio_tokens": 0
+                },
+                "completion_tokens_details": {
+                  "reasoning_tokens": 0,
+                  "audio_tokens": 0,
+                  "accepted_prediction_tokens": 0,
+                  "rejected_prediction_tokens": 0
+                }
+              },
+              "service_tier": "default",
+              "system_fingerprint": "fp_560af6e559"
+            }
+        headers:
+            Content-Type:
+              - application/json
+        status: 200 OK
+        code: 200
+        duration: 800.714667ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 705
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_yWcF6pOXZEasjvDtCEk2QMxi","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_yWcF6pOXZEasjvDtCEk2QMxi","role":"tool"}],"model":"gpt-4o-mini","max_tokens":4000,"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"}]}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: |
+            {
+              "id": "chatcmpl-CJ0tBUJaV0f3tn3An94PCF2ryFQ36",
+              "object": "chat.completion",
+              "created": 1758647685,
+              "model": "gpt-4o-mini-2024-07-18",
+              "choices": [
+                {
+                  "index": 0,
+                  "message": {
+                    "role": "assistant",
+                    "content": "The weather in Florence, Italy is currently 40°C.",
+                    "refusal": null,
+                    "annotations": []
+                  },
+                  "logprobs": null,
+                  "finish_reason": "stop"
+                }
+              ],
+              "usage": {
+                "prompt_tokens": 86,
+                "completion_tokens": 13,
+                "total_tokens": 99,
+                "prompt_tokens_details": {
+                  "cached_tokens": 0,
+                  "audio_tokens": 0
+                },
+                "completion_tokens_details": {
+                  "reasoning_tokens": 0,
+                  "audio_tokens": 0,
+                  "accepted_prediction_tokens": 0,
+                  "rejected_prediction_tokens": 0
+                }
+              },
+              "service_tier": "default",
+              "system_fingerprint": "fp_560af6e559"
+            }
+        headers:
+            Content-Type:
+              - application/json
+        status: 200 OK
+        code: 200
+        duration: 728.681917ms

providertests/testdata/TestOpenAICommon/tool_gpt-4o.yaml 🔗

@@ -0,0 +1,145 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 448
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"gpt-4o","max_tokens":4000,"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"}]}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: |
+            {
+              "id": "chatcmpl-CJ0t1KN0HyuYhTUOVdaJyIglR783c",
+              "object": "chat.completion",
+              "created": 1758647675,
+              "model": "gpt-4o-2024-08-06",
+              "choices": [
+                {
+                  "index": 0,
+                  "message": {
+                    "role": "assistant",
+                    "content": null,
+                    "tool_calls": [
+                      {
+                        "id": "call_rwEhF6Knw2t7cyFXf5CwFxhj",
+                        "type": "function",
+                        "function": {
+                          "name": "weather",
+                          "arguments": "{\"location\":\"Florence, Italy\"}"
+                        }
+                      }
+                    ],
+                    "refusal": null,
+                    "annotations": []
+                  },
+                  "logprobs": null,
+                  "finish_reason": "tool_calls"
+                }
+              ],
+              "usage": {
+                "prompt_tokens": 61,
+                "completion_tokens": 16,
+                "total_tokens": 77,
+                "prompt_tokens_details": {
+                  "cached_tokens": 0,
+                  "audio_tokens": 0
+                },
+                "completion_tokens_details": {
+                  "reasoning_tokens": 0,
+                  "audio_tokens": 0,
+                  "accepted_prediction_tokens": 0,
+                  "rejected_prediction_tokens": 0
+                }
+              },
+              "service_tier": "default",
+              "system_fingerprint": "fp_1827dd0c55"
+            }
+        headers:
+            Content-Type:
+              - application/json
+        status: 200 OK
+        code: 200
+        duration: 1.496159917s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 700
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_rwEhF6Knw2t7cyFXf5CwFxhj","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_rwEhF6Knw2t7cyFXf5CwFxhj","role":"tool"}],"model":"gpt-4o","max_tokens":4000,"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"}]}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: |
+            {
+              "id": "chatcmpl-CJ0t3lcTfNKs6bfvq2STBe95wG8hG",
+              "object": "chat.completion",
+              "created": 1758647677,
+              "model": "gpt-4o-2024-08-06",
+              "choices": [
+                {
+                  "index": 0,
+                  "message": {
+                    "role": "assistant",
+                    "content": "The current temperature in Florence, Italy is 40°C.",
+                    "refusal": null,
+                    "annotations": []
+                  },
+                  "logprobs": null,
+                  "finish_reason": "stop"
+                }
+              ],
+              "usage": {
+                "prompt_tokens": 86,
+                "completion_tokens": 13,
+                "total_tokens": 99,
+                "prompt_tokens_details": {
+                  "cached_tokens": 0,
+                  "audio_tokens": 0
+                },
+                "completion_tokens_details": {
+                  "reasoning_tokens": 0,
+                  "audio_tokens": 0,
+                  "accepted_prediction_tokens": 0,
+                  "rejected_prediction_tokens": 0
+                }
+              },
+              "service_tier": "default",
+              "system_fingerprint": "fp_f33640a400"
+            }
+        headers:
+            Content-Type:
+              - application/json
+        status: 200 OK
+        code: 200
+        duration: 1.449762542s

providertests/testdata/TestOpenAICommon/tool_gpt-5.yaml 🔗

@@ -0,0 +1,143 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 458
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"gpt-5","max_completion_tokens":4000,"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"}]}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: |
+            {
+              "id": "chatcmpl-CJ0tKYDkQYGemoIfxaHKoXjVkX0A5",
+              "object": "chat.completion",
+              "created": 1758647694,
+              "model": "gpt-5-2025-08-07",
+              "choices": [
+                {
+                  "index": 0,
+                  "message": {
+                    "role": "assistant",
+                    "content": null,
+                    "tool_calls": [
+                      {
+                        "id": "call_wIjmJXgmSCyQXBTzFqSCIxLK",
+                        "type": "function",
+                        "function": {
+                          "name": "weather",
+                          "arguments": "{\"location\":\"Florence, Italy\"}"
+                        }
+                      }
+                    ],
+                    "refusal": null,
+                    "annotations": []
+                  },
+                  "finish_reason": "tool_calls"
+                }
+              ],
+              "usage": {
+                "prompt_tokens": 145,
+                "completion_tokens": 153,
+                "total_tokens": 298,
+                "prompt_tokens_details": {
+                  "cached_tokens": 0,
+                  "audio_tokens": 0
+                },
+                "completion_tokens_details": {
+                  "reasoning_tokens": 128,
+                  "audio_tokens": 0,
+                  "accepted_prediction_tokens": 0,
+                  "rejected_prediction_tokens": 0
+                }
+              },
+              "service_tier": "default",
+              "system_fingerprint": null
+            }
+        headers:
+            Content-Type:
+              - application/json
+        status: 200 OK
+        code: 200
+        duration: 6.411118125s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 710
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_wIjmJXgmSCyQXBTzFqSCIxLK","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_wIjmJXgmSCyQXBTzFqSCIxLK","role":"tool"}],"model":"gpt-5","max_completion_tokens":4000,"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"}]}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: |
+            {
+              "id": "chatcmpl-CJ0tQT9E0buo6ZDtPWlqLBi78nACz",
+              "object": "chat.completion",
+              "created": 1758647700,
+              "model": "gpt-5-2025-08-07",
+              "choices": [
+                {
+                  "index": 0,
+                  "message": {
+                    "role": "assistant",
+                    "content": "It’s currently about 40°C (104°F) in Florence, Italy. Would you like a forecast or more details like wind and humidity?",
+                    "refusal": null,
+                    "annotations": []
+                  },
+                  "finish_reason": "stop"
+                }
+              ],
+              "usage": {
+                "prompt_tokens": 176,
+                "completion_tokens": 294,
+                "total_tokens": 470,
+                "prompt_tokens_details": {
+                  "cached_tokens": 0,
+                  "audio_tokens": 0
+                },
+                "completion_tokens_details": {
+                  "reasoning_tokens": 256,
+                  "audio_tokens": 0,
+                  "accepted_prediction_tokens": 0,
+                  "rejected_prediction_tokens": 0
+                }
+              },
+              "service_tier": "default",
+              "system_fingerprint": null
+            }
+        headers:
+            Content-Type:
+              - application/json
+        status: 200 OK
+        code: 200
+        duration: 4.986148625s

providertests/testdata/TestOpenAICommon/tool_streaming_gpt-4o-mini.yaml 🔗

@@ -0,0 +1,117 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 507
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"gpt-4o-mini","max_tokens":4000,"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"}],"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"chatcmpl-CJ0tBlueR3651IKlhIzPl3aK6mL6E","object":"chat.completion.chunk","created":1758647685,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_eaFZk5oKtBMZbnNRWRTJtLd8","type":"function","function":{"name":"weather","arguments":""}}],"refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"5KI0UtZk"}
+
+            data: {"id":"chatcmpl-CJ0tBlueR3651IKlhIzPl3aK6mL6E","object":"chat.completion.chunk","created":1758647685,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"xratVRRQUvO7ju"}
+
+            data: {"id":"chatcmpl-CJ0tBlueR3651IKlhIzPl3aK6mL6E","object":"chat.completion.chunk","created":1758647685,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"location"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"wYiTeV7h8"}
+
+            data: {"id":"chatcmpl-CJ0tBlueR3651IKlhIzPl3aK6mL6E","object":"chat.completion.chunk","created":1758647685,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"MPkLZkYPNsIR"}
+
+            data: {"id":"chatcmpl-CJ0tBlueR3651IKlhIzPl3aK6mL6E","object":"chat.completion.chunk","created":1758647685,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Flor"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"TCU5TS5ww2nCI"}
+
+            data: {"id":"chatcmpl-CJ0tBlueR3651IKlhIzPl3aK6mL6E","object":"chat.completion.chunk","created":1758647685,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ence"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"wDqHJX5wYfcOA"}
+
+            data: {"id":"chatcmpl-CJ0tBlueR3651IKlhIzPl3aK6mL6E","object":"chat.completion.chunk","created":1758647685,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":""}
+
+            data: {"id":"chatcmpl-CJ0tBlueR3651IKlhIzPl3aK6mL6E","object":"chat.completion.chunk","created":1758647685,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Italy"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"rLIAlWnSklw"}
+
+            data: {"id":"chatcmpl-CJ0tBlueR3651IKlhIzPl3aK6mL6E","object":"chat.completion.chunk","created":1758647685,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"cSZ8YHtvjZ0s1X"}
+
+            data: {"id":"chatcmpl-CJ0tBlueR3651IKlhIzPl3aK6mL6E","object":"chat.completion.chunk","created":1758647685,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null,"obfuscation":"XPQmeXulXZEoftW"}
+
+            data: {"id":"chatcmpl-CJ0tBlueR3651IKlhIzPl3aK6mL6E","object":"chat.completion.chunk","created":1758647685,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[],"usage":{"prompt_tokens":61,"completion_tokens":16,"total_tokens":77,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"obbGCGoTl9"}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream; charset=utf-8
+        status: 200 OK
+        code: 200
+        duration: 512.806041ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 759
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_eaFZk5oKtBMZbnNRWRTJtLd8","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_eaFZk5oKtBMZbnNRWRTJtLd8","role":"tool"}],"model":"gpt-4o-mini","max_tokens":4000,"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"}],"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"chatcmpl-CJ0tC6vKfIzgNkmkKDiGYcgC6i8h0","object":"chat.completion.chunk","created":1758647686,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"zaIgHcc89"}
+
+            data: {"id":"chatcmpl-CJ0tC6vKfIzgNkmkKDiGYcgC6i8h0","object":"chat.completion.chunk","created":1758647686,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"The"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"VmC7fB9t"}
+
+            data: {"id":"chatcmpl-CJ0tC6vKfIzgNkmkKDiGYcgC6i8h0","object":"chat.completion.chunk","created":1758647686,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" current"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"p8h"}
+
+            data: {"id":"chatcmpl-CJ0tC6vKfIzgNkmkKDiGYcgC6i8h0","object":"chat.completion.chunk","created":1758647686,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" weather"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"vXV"}
+
+            data: {"id":"chatcmpl-CJ0tC6vKfIzgNkmkKDiGYcgC6i8h0","object":"chat.completion.chunk","created":1758647686,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"kyKyXttg"}
+
+            data: {"id":"chatcmpl-CJ0tC6vKfIzgNkmkKDiGYcgC6i8h0","object":"chat.completion.chunk","created":1758647686,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" Florence"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"zA"}
+
+            data: {"id":"chatcmpl-CJ0tC6vKfIzgNkmkKDiGYcgC6i8h0","object":"chat.completion.chunk","created":1758647686,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ez5qB60FIe"}
+
+            data: {"id":"chatcmpl-CJ0tC6vKfIzgNkmkKDiGYcgC6i8h0","object":"chat.completion.chunk","created":1758647686,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" Italy"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Azhcm"}
+
+            data: {"id":"chatcmpl-CJ0tC6vKfIzgNkmkKDiGYcgC6i8h0","object":"chat.completion.chunk","created":1758647686,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"V8wzXyf1"}
+
+            data: {"id":"chatcmpl-CJ0tC6vKfIzgNkmkKDiGYcgC6i8h0","object":"chat.completion.chunk","created":1758647686,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"BXxv0GdxY8"}
+
+            data: {"id":"chatcmpl-CJ0tC6vKfIzgNkmkKDiGYcgC6i8h0","object":"chat.completion.chunk","created":1758647686,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"40"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"zkC1qjQIp"}
+
+            data: {"id":"chatcmpl-CJ0tC6vKfIzgNkmkKDiGYcgC6i8h0","object":"chat.completion.chunk","created":1758647686,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"°C"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"X76P2Vgf4"}
+
+            data: {"id":"chatcmpl-CJ0tC6vKfIzgNkmkKDiGYcgC6i8h0","object":"chat.completion.chunk","created":1758647686,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"DfAlLE2gti"}
+
+            data: {"id":"chatcmpl-CJ0tC6vKfIzgNkmkKDiGYcgC6i8h0","object":"chat.completion.chunk","created":1758647686,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"6WtHI"}
+
+            data: {"id":"chatcmpl-CJ0tC6vKfIzgNkmkKDiGYcgC6i8h0","object":"chat.completion.chunk","created":1758647686,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":"fp_560af6e559","choices":[],"usage":{"prompt_tokens":86,"completion_tokens":13,"total_tokens":99,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"cmTLrubMzR"}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream; charset=utf-8
+        status: 200 OK
+        code: 200
+        duration: 530.826042ms

providertests/testdata/TestOpenAICommon/tool_streaming_gpt-4o.yaml 🔗

@@ -0,0 +1,117 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 502
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"gpt-4o","max_tokens":4000,"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"}],"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"chatcmpl-CJ0t4RRGeoO2Fm6RBwapKmmznjkgN","object":"chat.completion.chunk","created":1758647678,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_DsLVX5dtxut3VpmGjk4pLjuJ","type":"function","function":{"name":"weather","arguments":""}}],"refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"vqSrDr5OyXU4m"}
+
+            data: {"id":"chatcmpl-CJ0t4RRGeoO2Fm6RBwapKmmznjkgN","object":"chat.completion.chunk","created":1758647678,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"bLY"}
+
+            data: {"id":"chatcmpl-CJ0t4RRGeoO2Fm6RBwapKmmznjkgN","object":"chat.completion.chunk","created":1758647678,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"location"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ROH2xDb2UHSlWt"}
+
+            data: {"id":"chatcmpl-CJ0t4RRGeoO2Fm6RBwapKmmznjkgN","object":"chat.completion.chunk","created":1758647678,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"P"}
+
+            data: {"id":"chatcmpl-CJ0t4RRGeoO2Fm6RBwapKmmznjkgN","object":"chat.completion.chunk","created":1758647678,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Flor"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"0k"}
+
+            data: {"id":"chatcmpl-CJ0t4RRGeoO2Fm6RBwapKmmznjkgN","object":"chat.completion.chunk","created":1758647678,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ence"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"J6"}
+
+            data: {"id":"chatcmpl-CJ0t4RRGeoO2Fm6RBwapKmmznjkgN","object":"chat.completion.chunk","created":1758647678,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"3N4p6"}
+
+            data: {"id":"chatcmpl-CJ0t4RRGeoO2Fm6RBwapKmmznjkgN","object":"chat.completion.chunk","created":1758647678,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Italy"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":""}
+
+            data: {"id":"chatcmpl-CJ0t4RRGeoO2Fm6RBwapKmmznjkgN","object":"chat.completion.chunk","created":1758647678,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"0KQ"}
+
+            data: {"id":"chatcmpl-CJ0t4RRGeoO2Fm6RBwapKmmznjkgN","object":"chat.completion.chunk","created":1758647678,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null,"obfuscation":"esuU"}
+
+            data: {"id":"chatcmpl-CJ0t4RRGeoO2Fm6RBwapKmmznjkgN","object":"chat.completion.chunk","created":1758647678,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[],"usage":{"prompt_tokens":61,"completion_tokens":16,"total_tokens":77,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"1rw5kFUcAkARKC6"}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream; charset=utf-8
+        status: 200 OK
+        code: 200
+        duration: 895.465916ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 754
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_DsLVX5dtxut3VpmGjk4pLjuJ","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_DsLVX5dtxut3VpmGjk4pLjuJ","role":"tool"}],"model":"gpt-4o","max_tokens":4000,"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"}],"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"chatcmpl-CJ0t5pNKMz4aUQirct25yb1MaEedf","object":"chat.completion.chunk","created":1758647679,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"7tOM3ZUD6ldT6q"}
+
+            data: {"id":"chatcmpl-CJ0t5pNKMz4aUQirct25yb1MaEedf","object":"chat.completion.chunk","created":1758647679,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"The"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"BZb5wdo6uPwk3"}
+
+            data: {"id":"chatcmpl-CJ0t5pNKMz4aUQirct25yb1MaEedf","object":"chat.completion.chunk","created":1758647679,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" current"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"LoRsZTOM"}
+
+            data: {"id":"chatcmpl-CJ0t5pNKMz4aUQirct25yb1MaEedf","object":"chat.completion.chunk","created":1758647679,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" temperature"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"vat0"}
+
+            data: {"id":"chatcmpl-CJ0t5pNKMz4aUQirct25yb1MaEedf","object":"chat.completion.chunk","created":1758647679,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"XepN7xFKXNBtG"}
+
+            data: {"id":"chatcmpl-CJ0t5pNKMz4aUQirct25yb1MaEedf","object":"chat.completion.chunk","created":1758647679,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" Florence"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"IoUT6Lf"}
+
+            data: {"id":"chatcmpl-CJ0t5pNKMz4aUQirct25yb1MaEedf","object":"chat.completion.chunk","created":1758647679,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":","},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"lTPPYj42jAOLfZq"}
+
+            data: {"id":"chatcmpl-CJ0t5pNKMz4aUQirct25yb1MaEedf","object":"chat.completion.chunk","created":1758647679,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" Italy"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ELkxqOy9cR"}
+
+            data: {"id":"chatcmpl-CJ0t5pNKMz4aUQirct25yb1MaEedf","object":"chat.completion.chunk","created":1758647679,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" is"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Xo9O5Qrg9rTG4"}
+
+            data: {"id":"chatcmpl-CJ0t5pNKMz4aUQirct25yb1MaEedf","object":"chat.completion.chunk","created":1758647679,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"OcilCqcnRrqI8b0"}
+
+            data: {"id":"chatcmpl-CJ0t5pNKMz4aUQirct25yb1MaEedf","object":"chat.completion.chunk","created":1758647679,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"40"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"AkKZH9iLTPLWwW"}
+
+            data: {"id":"chatcmpl-CJ0t5pNKMz4aUQirct25yb1MaEedf","object":"chat.completion.chunk","created":1758647679,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"°C"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ZgLJVEiJSDNwfh"}
+
+            data: {"id":"chatcmpl-CJ0t5pNKMz4aUQirct25yb1MaEedf","object":"chat.completion.chunk","created":1758647679,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Tgl1ypvC7DYEENV"}
+
+            data: {"id":"chatcmpl-CJ0t5pNKMz4aUQirct25yb1MaEedf","object":"chat.completion.chunk","created":1758647679,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"rXXXF1AO5c"}
+
+            data: {"id":"chatcmpl-CJ0t5pNKMz4aUQirct25yb1MaEedf","object":"chat.completion.chunk","created":1758647679,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[],"usage":{"prompt_tokens":86,"completion_tokens":13,"total_tokens":99,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"GiOGt9YVboGRIy6"}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream; charset=utf-8
+        status: 200 OK
+        code: 200
+        duration: 864.815125ms

providertests/testdata/TestOpenAICommon/tool_streaming_gpt-5.yaml 🔗

@@ -0,0 +1,125 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 512
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"gpt-5","max_completion_tokens":4000,"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"}],"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"chatcmpl-CJ0tV25SmllzFkgw9mB6R45W4UvB5","object":"chat.completion.chunk","created":1758647705,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_WSgpozR824ujfeAxEXnWmQBQ","type":"function","function":{"name":"weather","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"duGx3035D"}
+
+            data: {"id":"chatcmpl-CJ0tV25SmllzFkgw9mB6R45W4UvB5","object":"chat.completion.chunk","created":1758647705,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"Tztbt3c3Kbze6FE"}
+
+            data: {"id":"chatcmpl-CJ0tV25SmllzFkgw9mB6R45W4UvB5","object":"chat.completion.chunk","created":1758647705,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"location"}}]},"finish_reason":null}],"usage":null,"obfuscation":"26eQ3nimHA"}
+
+            data: {"id":"chatcmpl-CJ0tV25SmllzFkgw9mB6R45W4UvB5","object":"chat.completion.chunk","created":1758647705,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"TsD23k6WCx25H"}
+
+            data: {"id":"chatcmpl-CJ0tV25SmllzFkgw9mB6R45W4UvB5","object":"chat.completion.chunk","created":1758647705,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Flor"}}]},"finish_reason":null}],"usage":null,"obfuscation":"JjGknbF1INt5TF"}
+
+            data: {"id":"chatcmpl-CJ0tV25SmllzFkgw9mB6R45W4UvB5","object":"chat.completion.chunk","created":1758647705,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ence"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Gi8uBZzQIKsHiy"}
+
+            data: {"id":"chatcmpl-CJ0tV25SmllzFkgw9mB6R45W4UvB5","object":"chat.completion.chunk","created":1758647705,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"finish_reason":null}],"usage":null,"obfuscation":"x"}
+
+            data: {"id":"chatcmpl-CJ0tV25SmllzFkgw9mB6R45W4UvB5","object":"chat.completion.chunk","created":1758647705,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Italy"}}]},"finish_reason":null}],"usage":null,"obfuscation":"LW9lZdbCEZZW"}
+
+            data: {"id":"chatcmpl-CJ0tV25SmllzFkgw9mB6R45W4UvB5","object":"chat.completion.chunk","created":1758647705,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"95cXXqU4xVuJmzG"}
+
+            data: {"id":"chatcmpl-CJ0tV25SmllzFkgw9mB6R45W4UvB5","object":"chat.completion.chunk","created":1758647705,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""}
+
+            data: {"id":"chatcmpl-CJ0tV25SmllzFkgw9mB6R45W4UvB5","object":"chat.completion.chunk","created":1758647705,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":145,"completion_tokens":89,"total_tokens":234,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":64,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"gfOQndVH"}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream; charset=utf-8
+        status: 200 OK
+        code: 200
+        duration: 2.294974458s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 764
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"call_WSgpozR824ujfeAxEXnWmQBQ","function":{"arguments":"{\"location\":\"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_WSgpozR824ujfeAxEXnWmQBQ","role":"tool"}],"model":"gpt-5","max_completion_tokens":4000,"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"}],"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://api.openai.com/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"1p1YlAJWTw"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"It"},"finish_reason":null}],"usage":null,"obfuscation":"YZvt6jFlFB"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"’s"},"finish_reason":null}],"usage":null,"obfuscation":"DzZBdbfizD"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" currently"},"finish_reason":null}],"usage":null,"obfuscation":"Jd"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" about"},"finish_reason":null}],"usage":null,"obfuscation":"nPCpZB"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"V7WLM5bQiGv"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"40"},"finish_reason":null}],"usage":null,"obfuscation":"5uezkeMYMs"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"°C"},"finish_reason":null}],"usage":null,"obfuscation":"OWCuuGdnOp"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ("},"finish_reason":null}],"usage":null,"obfuscation":"NzvQsK86Pb"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"104"},"finish_reason":null}],"usage":null,"obfuscation":"XfNJqWzg2"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"°F"},"finish_reason":null}],"usage":null,"obfuscation":"uTIlmHt4OL"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":")"},"finish_reason":null}],"usage":null,"obfuscation":"u8dtXL0LscA"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" in"},"finish_reason":null}],"usage":null,"obfuscation":"7NixIZTSo"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Florence"},"finish_reason":null}],"usage":null,"obfuscation":"t53"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"finish_reason":null}],"usage":null,"obfuscation":"FztKEw6muKe"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Italy"},"finish_reason":null}],"usage":null,"obfuscation":"FgCTCh"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"finish_reason":null}],"usage":null,"obfuscation":"zsCfUMeT8fD"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"5Fm2lZ"}
+
+            data: {"id":"chatcmpl-CJ0tYuxf4NRj1f1izjE5LrYfxvqyY","object":"chat.completion.chunk","created":1758647708,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":176,"completion_tokens":217,"total_tokens":393,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":192,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"Sgd3oK"}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream; charset=utf-8
+        status: 200 OK
+        code: 200
+        duration: 4.122915208s

providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_baseten.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 868
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["baseten"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_chutes.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 867
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["chutes"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_deepinfra.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 870
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["deepinfra"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_fireworks.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 870
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["fireworks"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_moonshotai.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 871
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["moonshotai"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_moonshotai/turbo.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 877
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["moonshotai/turbo"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_novita.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 867
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["novita"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_siliconflow.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 872
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"usage":{"include":true},"provider":{"only":["siliconflow"]}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_together.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 869
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"usage":{"include":true},"provider":{"only":["together"]}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/multi_tool_kimi-k2_wandb.yaml 🔗

@@ -0,0 +1,92 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 866
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["wandb"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_baseten.yaml 🔗

@@ -0,0 +1,209 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 922
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["baseten"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":" perform"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":" both"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":" addition"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":" multiplication"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":" on"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":" numbers"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":"2"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":"3"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.add:0","type":"function","function":{"name":"add","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.add:0","type":"function","function":{"name":"","arguments":"{\"a"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.add:0","type":"function","function":{"name":"","arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.add:0","type":"function","function":{"name":"","arguments":" "}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.add:0","type":"function","function":{"name":"","arguments":"2"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.add:0","type":"function","function":{"name":"","arguments":","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.add:0","type":"function","function":{"name":"","arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.add:0","type":"function","function":{"name":"","arguments":"b"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.add:0","type":"function","function":{"name":"","arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.add:0","type":"function","function":{"name":"","arguments":" "}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.add:0","type":"function","function":{"name":"","arguments":"3"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.add:0","type":"function","function":{"name":"","arguments":"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"functions.multiply:1","type":"function","function":{"name":"multiply","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"functions.multiply:1","type":"function","function":{"name":"","arguments":"{\"a"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"functions.multiply:1","type":"function","function":{"name":"","arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"functions.multiply:1","type":"function","function":{"name":"","arguments":" "}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"functions.multiply:1","type":"function","function":{"name":"","arguments":"2"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"functions.multiply:1","type":"function","function":{"name":"","arguments":","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"functions.multiply:1","type":"function","function":{"name":"","arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"functions.multiply:1","type":"function","function":{"name":"","arguments":"b"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"functions.multiply:1","type":"function","function":{"name":"","arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"functions.multiply:1","type":"function","function":{"name":"","arguments":" "}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"functions.multiply:1","type":"function","function":{"name":"","arguments":"3"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"functions.multiply:1","type":"function","function":{"name":"","arguments":"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647856-5joIlQt34lrSZDGk4KUT","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647856,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":216,"completion_tokens":56,"total_tokens":272,"cost":0.0002696,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0001296,"upstream_inference_completions_cost":0.00014},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 524.640416ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1389
+        host: ""

providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_chutes.yaml 🔗

@@ -0,0 +1,209 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 921
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["chutes"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":" add"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":" multiply"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":" numbers"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":"2"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":"3"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":" you"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":":"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.add:0","index":0,"type":"function","function":{"name":"add","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"{\"a"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" "}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"2"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"b"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" "}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"3"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.multiply:1","index":1,"type":"function","function":{"name":"multiply","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":1,"type":"function","function":{"name":null,"arguments":"{\"a"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":1,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":1,"type":"function","function":{"name":null,"arguments":" "}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":1,"type":"function","function":{"name":null,"arguments":"2"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":1,"type":"function","function":{"name":null,"arguments":","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":1,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":1,"type":"function","function":{"name":null,"arguments":"b"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":1,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":1,"type":"function","function":{"name":null,"arguments":" "}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":1,"type":"function","function":{"name":null,"arguments":"3"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":1,"type":"function","function":{"name":null,"arguments":"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]}
+
+            data: {"id":"gen-1758647737-vvpk19T3xu6M8HpIoGnm","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647737,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":197,"completion_tokens":55,"total_tokens":252,"cost":0.00015846,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00007486,"upstream_inference_completions_cost":0.0000836},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 940.962625ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1369
+        host: ""

providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_deepinfra.yaml 🔗

@@ -0,0 +1,81 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 924
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["deepinfra"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647753-OdmjxRAXsDblNFJmAIPl","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647753,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647753-OdmjxRAXsDblNFJmAIPl","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647753,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll add and multiply the numbers 2 and 3 for you."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647753-OdmjxRAXsDblNFJmAIPl","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647753,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"0","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"add"},"type":"function"}]},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]}
+
+            data: {"id":"gen-1758647753-OdmjxRAXsDblNFJmAIPl","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647753,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"1","function":{"arguments":"{\"a\": 2, \"b\": 3}","name":"multiply"},"type":"function"}]},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]}
+
+            data: {"id":"gen-1758647753-OdmjxRAXsDblNFJmAIPl","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647753,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":171,"completion_tokens":25,"total_tokens":196,"cost":0.0001355,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000855,"upstream_inference_completions_cost":0.00005},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 755.247167ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1306
+        host: ""

providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_fireworks.yaml 🔗

@@ -0,0 +1,213 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 924
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["fireworks"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll add"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":" multiply"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":" numbers"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":"2"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":"3"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":" you"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.add:0","type":"function","function":{"name":"add"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"a"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" "}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"2"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"b"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" "}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"3"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"functions.multiply:1","type":"function","function":{"name":"multiply"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"a"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":" "}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"2"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"b"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":" "}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"3"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]}
+
+            data: {"id":"gen-1758647796-moKPayphq24N41Qgxvrr","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647796,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":210,"completion_tokens":55,"total_tokens":265,"cost":0.0002635,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000126,"upstream_inference_completions_cost":0.0001375},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 1.486259042s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1372
+        host: ""

providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_moonshotai.yaml 🔗

@@ -0,0 +1,215 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 925
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["moonshotai"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":" add"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":" multiply"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":"2"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":"3"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":" you"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"add:0","type":"function","function":{"name":"add","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"a"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" "},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"2"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":","},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"b"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" "},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"3"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"multiply:1","type":"function","function":{"name":"multiply","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"a"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":" "},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"2"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":","},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"b"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":" "},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"3"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647814-P0b6qNqhwWInBTL65YB3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647814,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":154,"completion_tokens":52,"total_tokens":206,"cost":0.0004448,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0001848,"upstream_inference_completions_cost":0.00026},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 1.371288625s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1321
+        host: ""

providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_moonshotai/turbo.yaml 🔗

@@ -0,0 +1,205 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 931
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["moonshotai/turbo"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":" perform"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":" both"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":" addition"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":" multiplication"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":" on"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":" numbers"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":"2"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":"3"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"add:0","type":"function","function":{"name":"add","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"a"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" "},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"2"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":","},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"b"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" "},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"3"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"multiply:1","type":"function","function":{"name":"multiply","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"a"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":" "},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"2"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":","},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"b"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":" "},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"3"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647920-0gJkbNA2sJnKBH3TZqkQ","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647920,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":154,"completion_tokens":55,"total_tokens":209,"cost":0.0004598,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0001848,"upstream_inference_completions_cost":0.000275},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 1.269723334s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1358
+        host: ""

providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_novita.yaml 🔗

@@ -0,0 +1,211 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 921
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["novita"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":" perform"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":" both"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":" operations"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":" with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":" numbers"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":"2"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":"3"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"add:0","type":"function","function":{"name":"add"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"a"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" "},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"2"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":","},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"b"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" "},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"3"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"multiply:1","type":"function","function":{"name":"multiply"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"a"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":" "},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"2"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":","},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"b"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":" "},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"3"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647840-OwHy8dIwszrhwc76VXyS","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647840,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":154,"completion_tokens":53,"total_tokens":207,"cost":0.0002249,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000924,"upstream_inference_completions_cost":0.0001325},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 2.01620825s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1333
+        host: ""

providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_siliconflow.yaml 🔗

@@ -0,0 +1,207 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 926
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["siliconflow"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":" add"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":" multiply"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":" numbers"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":"2"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":"3"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":" you"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":":"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.add:0","type":"function","function":{"name":"add","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"a"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"2"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":",\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"b"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"3"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"functions.multiply:1","type":"function","function":{"name":"multiply","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"a"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"2"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":",\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"b"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"3"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647778-pJmh9NSNSE9mnSRWdSXN","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647778,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":216,"completion_tokens":48,"total_tokens":264,"cost":0.0002352,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00012528,"upstream_inference_completions_cost":0.00010992},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 1.094847375s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1368
+        host: ""

providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_together.yaml 🔗

@@ -0,0 +1,159 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 923
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["together"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":" add"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":" multiply"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":"2"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":"3"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":" you"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":":"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_x8zrugtt6e519dz6vlnljaxj","type":"function","function":{"name":"add","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\"a\":2,"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\"b\":3}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"call_sl4zkjk4xmj59r92e0ieqfxw","type":"function","function":{"name":"multiply","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"{\"a\":2,"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"\"b\":3}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]}
+
+            data: {"id":"gen-1758647897-A5x2BTvxboJgl6Cs0evY","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647897,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":218,"completion_tokens":53,"total_tokens":271,"cost":0.000377,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000218,"upstream_inference_completions_cost":0.000159},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 4.992280875s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1399
+        host: ""

providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_kimi-k2_wandb.yaml 🔗

@@ -0,0 +1,291 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 920
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["wandb"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: '{"error":{"message":"Provider returned error","code":429,"metadata":{"raw":"moonshotai/kimi-k2-0905 is temporarily rate-limited upstream. Please retry shortly, or add your own key to accumulate your rate limits: https://openrouter.ai/settings/integrations","provider_name":"WandB"}},"user_id":"user_2zMGmKqlf4zmAvL9snVImB1Z1ZQ"}'
+        headers:
+            Content-Type:
+              - application/json
+        status: 429 Too Many Requests
+        code: 429
+        duration: 274.132125ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 920
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["wandb"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":" help"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":" you"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":" add"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":" multiply"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":" numbers"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":"2"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":"3"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":" at"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":" same"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":" time"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.add:0","type":"function","index":0,"function":{"name":"add"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"a"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" "},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"2"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":","},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"b"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" "},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"3"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.multiply:1","type":"function","index":1,"function":{"name":"multiply"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"a"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":" "},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"2"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":","},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"b"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":" "},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"3"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"function":{"arguments":"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]}
+
+            data: {"id":"gen-1758647949-VyHnJkppboLqimSlulNy","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647949,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":209,"completion_tokens":59,"total_tokens":268,"cost":0.00051815,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00028215,"upstream_inference_completions_cost":0.000236},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 316.566ms
+  - id: 2
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 1386
+        host: ""

providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_baseten.yaml 🔗

@@ -1,8 +1,8 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
@@ -11,23 +11,23 @@ interactions:
         body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"provider":{"only":["baseten"]},"usage":{"include":true}}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         uncompressed: true
-        body: "\n         \n\n         \n\n         \n\n         \n\n         \n\n         \n\n         \n{\"id\":\"gen-1758639328-AzATqlbuJcP77p24ALVP\",\"provider\":\"BaseTen\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758639328,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Olá!\",\"refusal\":null,\"reasoning\":null}}],\"system_fingerprint\":null,\"usage\":{\"prompt_tokens\":21,\"completion_tokens\":4,\"total_tokens\":25,\"cost\":0.0000226,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.0000126,\"upstream_inference_completions_cost\":0.00001},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
+        body: "\n         \n\n         \n\n         \n{\"id\":\"gen-1758647479-nBqgAxf99Z2GXMZQSqKs\",\"provider\":\"BaseTen\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758647479,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Olá!\",\"refusal\":null,\"reasoning\":null}}],\"system_fingerprint\":null,\"usage\":{\"prompt_tokens\":21,\"completion_tokens\":4,\"total_tokens\":25,\"cost\":0.0000226,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.0000126,\"upstream_inference_completions_cost\":0.00001},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
         headers:
             Content-Type:
-                - application/json
+              - application/json
         status: 200 OK
         code: 200
-        duration: 3.172332875s
+        duration: 1.610297166s

providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_chutes.yaml 🔗

@@ -1,33 +1,33 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
         content_length: 229
         host: ""
-        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"usage":{"include":true},"provider":{"only":["chutes"]}}'
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"provider":{"only":["chutes"]},"usage":{"include":true}}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         uncompressed: true
-        body: "\n         \n\n         \n{\"id\":\"gen-1758639299-GKSxis3jImn2oU1Eh6ny\",\"provider\":\"Chutes\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758639299,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Olá!\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":21,\"completion_tokens\":4,\"total_tokens\":25,\"cost\":0.00001406,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.00000798,\"upstream_inference_completions_cost\":0.00000608},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
+        body: "\n         \n\n         \n{\"id\":\"gen-1758647458-1lD823GzAnZns4HOVDuI\",\"provider\":\"Chutes\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758647458,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Oi!\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":21,\"completion_tokens\":3,\"total_tokens\":24,\"cost\":0.00001254,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.00000798,\"upstream_inference_completions_cost\":0.00000456},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
         headers:
             Content-Type:
-                - application/json
+              - application/json
         status: 200 OK
         code: 200
-        duration: 917.195084ms
+        duration: 1.022203375s

providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_deepinfra.yaml 🔗

@@ -1,8 +1,8 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
@@ -11,23 +11,23 @@ interactions:
         body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"provider":{"only":["deepinfra"]},"usage":{"include":true}}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         uncompressed: true
-        body: "\n         \n{\"id\":\"gen-1758639301-0fTwU9jWsZMToUgKXztP\",\"provider\":\"DeepInfra\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758639301,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Olá!\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":3,\"total_tokens\":23,\"cost\":0.000016,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.00001,\"upstream_inference_completions_cost\":0.000006},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
+        body: "\n         \n{\"id\":\"gen-1758647460-wrf2ZqG1S9eRA7yNGaW2\",\"provider\":\"DeepInfra\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758647460,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Oi!\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":2,\"total_tokens\":22,\"cost\":0.000014,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.00001,\"upstream_inference_completions_cost\":0.000004},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
         headers:
             Content-Type:
-                - application/json
+              - application/json
         status: 200 OK
         code: 200
-        duration: 594.821083ms
+        duration: 716.348875ms

providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_fireworks.yaml 🔗

@@ -1,8 +1,8 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
@@ -11,23 +11,23 @@ interactions:
         body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"provider":{"only":["fireworks"]},"usage":{"include":true}}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         uncompressed: true

providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_moonshotai.yaml 🔗

@@ -1,33 +1,33 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
         content_length: 233
         host: ""
-        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"usage":{"include":true},"provider":{"only":["moonshotai"]}}'
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"provider":{"only":["moonshotai"]},"usage":{"include":true}}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         uncompressed: true
-        body: "\n         \n\n         \n\n         \n\n         \n{\"id\":\"gen-1758639321-VwBlIANQZ6xzs4I5czRO\",\"provider\":\"Moonshot AI\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758639321,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Oi!\",\"refusal\":null,\"reasoning\":null}}],\"system_fingerprint\":\"fpv0_ef28f882\",\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":3,\"total_tokens\":23,\"cost\":0.0000195,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.000012,\"upstream_inference_completions_cost\":0.0000075},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
+        body: "\n         \n\n         \n\n         \n{\"id\":\"gen-1758647473-P5eQrbQmwSfZP4j2qeIt\",\"provider\":\"Moonshot AI\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758647473,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Olá!\",\"refusal\":null,\"reasoning\":null}}],\"system_fingerprint\":\"fpv0_ef28f882\",\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":4,\"total_tokens\":24,\"cost\":0.000022,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.000012,\"upstream_inference_completions_cost\":0.00001},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
         headers:
             Content-Type:
-                - application/json
+              - application/json
         status: 200 OK
         code: 200
-        duration: 1.853341958s
+        duration: 1.669900666s

providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_moonshotai/turbo.yaml 🔗

@@ -1,8 +1,8 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
@@ -11,23 +11,23 @@ interactions:
         body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"provider":{"only":["moonshotai/turbo"]},"usage":{"include":true}}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         uncompressed: true
-        body: "\n         \n\n         \n\n         \n{\"id\":\"gen-1758639334-hxwi7fkQWt0putQK0ABp\",\"provider\":\"Moonshot AI\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758639334,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Olá!\",\"refusal\":null,\"reasoning\":null}}],\"system_fingerprint\":\"fpv0_ec889fbb\",\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":4,\"total_tokens\":24,\"cost\":0.000044,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.000024,\"upstream_inference_completions_cost\":0.00002},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
+        body: "\n         \n\n         \n\n         \n{\"id\":\"gen-1758647499-OCI2hMc7c5sm5oHveywl\",\"provider\":\"Moonshot AI\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758647499,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Olá!\",\"refusal\":null,\"reasoning\":null}}],\"system_fingerprint\":\"fpv0_ec889fbb\",\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":4,\"total_tokens\":24,\"cost\":0.000044,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.000024,\"upstream_inference_completions_cost\":0.00002},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
         headers:
             Content-Type:
-                - application/json
+              - application/json
         status: 200 OK
         code: 200
-        duration: 1.365624167s
+        duration: 1.408145917s

providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_novita.yaml 🔗

@@ -1,8 +1,8 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
@@ -11,23 +11,23 @@ interactions:
         body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"provider":{"only":["novita"]},"usage":{"include":true}}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         uncompressed: true
-        body: "\n         \n\n         \n\n         \n{\"id\":\"gen-1758639324-If4icmPpJg9xF7NBFIL9\",\"provider\":\"Novita\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758639324,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Oi!\",\"refusal\":null,\"reasoning\":null}}],\"system_fingerprint\":\"fpv0_ef28f882\",\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":3,\"total_tokens\":23,\"cost\":0.0000195,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.000012,\"upstream_inference_completions_cost\":0.0000075},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
+        body: "\n         \n\n         \n\n         \n{\"id\":\"gen-1758647476-DVGMjvxMQcU745myOsBe\",\"provider\":\"Novita\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758647476,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Oi!\",\"refusal\":null,\"reasoning\":null}}],\"system_fingerprint\":\"fpv0_ef28f882\",\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":3,\"total_tokens\":23,\"cost\":0.0000195,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.000012,\"upstream_inference_completions_cost\":0.0000075},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
         headers:
             Content-Type:
-                - application/json
+              - application/json
         status: 200 OK
         code: 200
-        duration: 1.467689625s
+        duration: 1.463812375s

providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_siliconflow.yaml 🔗

@@ -1,8 +1,8 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
@@ -11,52 +11,23 @@ interactions:
         body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"provider":{"only":["siliconflow"]},"usage":{"include":true}}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
-        proto: HTTP/2.0
-        proto_major: 2
-        proto_minor: 0
-        content_length: -1
-        body: '{"error":{"message":"Provider returned error","code":429,"metadata":{"raw":"moonshotai/kimi-k2-0905 is temporarily rate-limited upstream. Please retry shortly, or add your own key to accumulate your rate limits: https://openrouter.ai/settings/integrations","provider_name":"SiliconFlow"}},"user_id":"user_2zMGmKqlf4zmAvL9snVImB1Z1ZQ"}'
-        headers:
-            Content-Type:
-                - application/json
-        status: 429 Too Many Requests
-        code: 429
-        duration: 3.401816333s
-    - id: 1
-      request:
-        proto: HTTP/1.1
-        proto_major: 1
-        proto_minor: 1
-        content_length: 234
-        host: ""
-        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"provider":{"only":["siliconflow"]},"usage":{"include":true}}'
-        headers:
-            Accept:
-                - application/json
-            Content-Type:
-                - application/json
-            User-Agent:
-                - OpenAI/Go 2.3.0
-        url: https://openrouter.ai/api/v1/chat/completions
-        method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         uncompressed: true
-        body: "\n         \n\n         \n\n         \n{\"id\":\"gen-1758639306-G4HkxVEjJmlvSXb92TQJ\",\"provider\":\"SiliconFlow\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758639306,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Oi!\",\"refusal\":null,\"reasoning\":null}}],\"system_fingerprint\":\"\",\"usage\":{\"prompt_tokens\":21,\"completion_tokens\":2,\"total_tokens\":23,\"cost\":0.00001676,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.00001218,\"upstream_inference_completions_cost\":0.00000458},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
+        body: "\n         \n\n         \n\n         \n\n         \n\n         \n{\"id\":\"gen-1758647462-juUB6p2FCvLtIIKh46rb\",\"provider\":\"SiliconFlow\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758647462,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Oi!\",\"refusal\":null,\"reasoning\":null}}],\"system_fingerprint\":\"\",\"usage\":{\"prompt_tokens\":21,\"completion_tokens\":2,\"total_tokens\":23,\"cost\":0.00001676,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.00001218,\"upstream_inference_completions_cost\":0.00000458},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
         headers:
             Content-Type:
-                - application/json
+              - application/json
         status: 200 OK
         code: 200
-        duration: 1.323651459s
+        duration: 1.7906885s

providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_together.yaml 🔗

@@ -1,33 +1,33 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
         content_length: 231
         host: ""
-        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"usage":{"include":true},"provider":{"only":["together"]}}'
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"provider":{"only":["together"]},"usage":{"include":true}}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         uncompressed: true
-        body: "\n         \n\n         \n\n         \n{\"id\":\"gen-1758639332-Tug4bmqaH3ANNQGKvKml\",\"provider\":\"Together\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758639332,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Olá!\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":21,\"completion_tokens\":4,\"total_tokens\":25,\"cost\":0.000033,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.000021,\"upstream_inference_completions_cost\":0.000012},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
+        body: "\n         \n\n         \n{\"id\":\"gen-1758647482-RkYXaCO7eBSu4Y0C4gF2\",\"provider\":\"Together\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758647482,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Olá!\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":21,\"completion_tokens\":4,\"total_tokens\":25,\"cost\":0.000033,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.000021,\"upstream_inference_completions_cost\":0.000012},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
         headers:
             Content-Type:
-                - application/json
+              - application/json
         status: 200 OK
         code: 200
-        duration: 1.274655375s
+        duration: 1.212531584s

providertests/testdata/TestOpenRouterCommon/simple_kimi-k2_wandb.yaml 🔗

@@ -1,24 +1,24 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
         content_length: 228
         host: ""
-        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"usage":{"include":true},"provider":{"only":["wandb"]}}'
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"provider":{"only":["wandb"]},"usage":{"include":true}}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
@@ -26,37 +26,153 @@ interactions:
         body: '{"error":{"message":"Provider returned error","code":429,"metadata":{"raw":"moonshotai/kimi-k2-0905 is temporarily rate-limited upstream. Please retry shortly, or add your own key to accumulate your rate limits: https://openrouter.ai/settings/integrations","provider_name":"WandB"}},"user_id":"user_2zMGmKqlf4zmAvL9snVImB1Z1ZQ"}'
         headers:
             Content-Type:
-                - application/json
+              - application/json
         status: 429 Too Many Requests
         code: 429
-        duration: 380.91475ms
-    - id: 1
-      request:
+        duration: 732.354416ms
+  - id: 1
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
         content_length: 228
         host: ""
-        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"usage":{"include":true},"provider":{"only":["wandb"]}}'
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"provider":{"only":["wandb"]},"usage":{"include":true}}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: '{"error":{"message":"Provider returned error","code":429,"metadata":{"raw":"moonshotai/kimi-k2-0905 is temporarily rate-limited upstream. Please retry shortly, or add your own key to accumulate your rate limits: https://openrouter.ai/settings/integrations","provider_name":"WandB"}},"user_id":"user_2zMGmKqlf4zmAvL9snVImB1Z1ZQ"}'
+        headers:
+            Content-Type:
+              - application/json
+        status: 429 Too Many Requests
+        code: 429
+        duration: 632.868ms
+  - id: 2
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 228
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"provider":{"only":["wandb"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: '{"error":{"message":"Provider returned error","code":429,"metadata":{"raw":"moonshotai/kimi-k2-0905 is temporarily rate-limited upstream. Please retry shortly, or add your own key to accumulate your rate limits: https://openrouter.ai/settings/integrations","provider_name":"WandB"}},"user_id":"user_2zMGmKqlf4zmAvL9snVImB1Z1ZQ"}'
+        headers:
+            Content-Type:
+              - application/json
+        status: 429 Too Many Requests
+        code: 429
+        duration: 283.92975ms
+  - id: 3
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 228
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"provider":{"only":["wandb"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: '{"error":{"message":"Provider returned error","code":429,"metadata":{"raw":"moonshotai/kimi-k2-0905 is temporarily rate-limited upstream. Please retry shortly, or add your own key to accumulate your rate limits: https://openrouter.ai/settings/integrations","provider_name":"WandB"}},"user_id":"user_2zMGmKqlf4zmAvL9snVImB1Z1ZQ"}'
+        headers:
+            Content-Type:
+              - application/json
+        status: 429 Too Many Requests
+        code: 429
+        duration: 282.737458ms
+  - id: 4
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 228
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"provider":{"only":["wandb"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: '{"error":{"message":"Provider returned error","code":429,"metadata":{"raw":"moonshotai/kimi-k2-0905 is temporarily rate-limited upstream. Please retry shortly, or add your own key to accumulate your rate limits: https://openrouter.ai/settings/integrations","provider_name":"WandB"}},"user_id":"user_2zMGmKqlf4zmAvL9snVImB1Z1ZQ"}'
+        headers:
+            Content-Type:
+              - application/json
+        status: 429 Too Many Requests
+        code: 429
+        duration: 358.085709ms
+  - id: 5
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 228
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"provider":{"only":["wandb"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         uncompressed: true
-        body: "\n         \n{\"id\":\"gen-1758639338-u2WBkAEXgqR4CVf9CEDs\",\"provider\":\"WandB\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758639338,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"stop\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Olá!\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":20,\"completion_tokens\":4,\"total_tokens\":24,\"cost\":0.000043,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.000027,\"upstream_inference_completions_cost\":0.000016},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
+        body: '{"id":"gen-1758647508-0A0NskGwrejsvlbBseuv","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion","created":1758647508,"choices":[{"logprobs":null,"finish_reason":"stop","native_finish_reason":"stop","index":0,"message":{"role":"assistant","content":"Olá!","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":20,"completion_tokens":4,"total_tokens":24,"cost":0.000043,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000027,"upstream_inference_completions_cost":0.000016},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}'
         headers:
             Content-Type:
-                - application/json
+              - application/json
         status: 200 OK
         code: 200
-        duration: 693.287417ms
+        duration: 309.434959ms

providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_baseten.yaml 🔗

@@ -1,8 +1,8 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
@@ -11,34 +11,34 @@ interactions:
         body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"provider":{"only":["baseten"]},"usage":{"include":true},"stream":true}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         body: |+
-            data: {"id":"gen-1758639331-sFEtjceKZgX1JHdtpEWL","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639331,"choices":[{"index":0,"delta":{"role":"assistant","content":"Ol"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+            data: {"id":"gen-1758647481-aT1H6O6NTNRTing3Ikjh","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647481,"choices":[{"index":0,"delta":{"role":"assistant","content":"Ol"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
 
-            data: {"id":"gen-1758639331-sFEtjceKZgX1JHdtpEWL","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639331,"choices":[{"index":0,"delta":{"role":"assistant","content":"á"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+            data: {"id":"gen-1758647481-aT1H6O6NTNRTing3Ikjh","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647481,"choices":[{"index":0,"delta":{"role":"assistant","content":"á"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
 
-            data: {"id":"gen-1758639331-sFEtjceKZgX1JHdtpEWL","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639331,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+            data: {"id":"gen-1758647481-aT1H6O6NTNRTing3Ikjh","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647481,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
 
-            data: {"id":"gen-1758639331-sFEtjceKZgX1JHdtpEWL","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639331,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":null}
+            data: {"id":"gen-1758647481-aT1H6O6NTNRTing3Ikjh","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647481,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":null}
 
-            data: {"id":"gen-1758639331-sFEtjceKZgX1JHdtpEWL","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639331,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":21,"completion_tokens":4,"total_tokens":25,"cost":0.0000226,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000126,"upstream_inference_completions_cost":0.00001},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+            data: {"id":"gen-1758647481-aT1H6O6NTNRTing3Ikjh","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647481,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":21,"completion_tokens":4,"total_tokens":25,"cost":0.0000226,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000126,"upstream_inference_completions_cost":0.00001},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
             data: [DONE]
 
         headers:
             Content-Type:
-                - text/event-stream
+              - text/event-stream
         status: 200 OK
         code: 200
-        duration: 568.780375ms
+        duration: 532.068458ms

providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_chutes.yaml 🔗

@@ -1,8 +1,8 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
@@ -11,36 +11,36 @@ interactions:
         body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"provider":{"only":["chutes"]},"usage":{"include":true},"stream":true}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         body: |+
-            data: {"id":"gen-1758639300-DbIGuRk5TqxyMyDeicfb","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639300,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647459-jNYMRjvrcVQLHzSRNDbq","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647459,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639300-DbIGuRk5TqxyMyDeicfb","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639300,"choices":[{"index":0,"delta":{"role":"assistant","content":"Ol"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647459-jNYMRjvrcVQLHzSRNDbq","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647459,"choices":[{"index":0,"delta":{"role":"assistant","content":"Ol"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639300-DbIGuRk5TqxyMyDeicfb","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639300,"choices":[{"index":0,"delta":{"role":"assistant","content":"á"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647459-jNYMRjvrcVQLHzSRNDbq","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647459,"choices":[{"index":0,"delta":{"role":"assistant","content":"á"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639300-DbIGuRk5TqxyMyDeicfb","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639300,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647459-jNYMRjvrcVQLHzSRNDbq","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647459,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639300-DbIGuRk5TqxyMyDeicfb","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639300,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+            data: {"id":"gen-1758647459-jNYMRjvrcVQLHzSRNDbq","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647459,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
 
-            data: {"id":"gen-1758639300-DbIGuRk5TqxyMyDeicfb","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639300,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":21,"completion_tokens":4,"total_tokens":25,"cost":0.00001406,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00000798,"upstream_inference_completions_cost":0.00000608},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+            data: {"id":"gen-1758647459-jNYMRjvrcVQLHzSRNDbq","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647459,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":21,"completion_tokens":4,"total_tokens":25,"cost":0.00001406,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00000798,"upstream_inference_completions_cost":0.00000608},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
             data: [DONE]
 
         headers:
             Content-Type:
-                - text/event-stream
+              - text/event-stream
         status: 200 OK
         code: 200
-        duration: 704.728291ms
+        duration: 1.306785333s

providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_deepinfra.yaml 🔗

@@ -1,8 +1,8 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
@@ -11,34 +11,36 @@ interactions:
         body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"provider":{"only":["deepinfra"]},"usage":{"include":true},"stream":true}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         body: |+
-            data: {"id":"gen-1758639301-oQimFucmUUib7SCHhV0q","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639302,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647461-H5CN8BbdPFCBcaENWSeZ","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647461,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639301-oQimFucmUUib7SCHhV0q","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639302,"choices":[{"index":0,"delta":{"role":"assistant","content":"Oi"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647461-H5CN8BbdPFCBcaENWSeZ","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647461,"choices":[{"index":0,"delta":{"role":"assistant","content":"Ol"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639301-oQimFucmUUib7SCHhV0q","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639302,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647461-H5CN8BbdPFCBcaENWSeZ","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647461,"choices":[{"index":0,"delta":{"role":"assistant","content":"á"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639301-oQimFucmUUib7SCHhV0q","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639302,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+            data: {"id":"gen-1758647461-H5CN8BbdPFCBcaENWSeZ","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647461,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639301-oQimFucmUUib7SCHhV0q","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639302,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":20,"completion_tokens":2,"total_tokens":22,"cost":0.000014,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00001,"upstream_inference_completions_cost":0.000004},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+            data: {"id":"gen-1758647461-H5CN8BbdPFCBcaENWSeZ","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647461,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+
+            data: {"id":"gen-1758647461-H5CN8BbdPFCBcaENWSeZ","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647461,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":20,"completion_tokens":3,"total_tokens":23,"cost":0.000016,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00001,"upstream_inference_completions_cost":0.000006},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
             data: [DONE]
 
         headers:
             Content-Type:
-                - text/event-stream
+              - text/event-stream
         status: 200 OK
         code: 200
-        duration: 609.997125ms
+        duration: 575.2165ms

providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_fireworks.yaml 🔗

@@ -1,8 +1,8 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
@@ -11,32 +11,34 @@ interactions:
         body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"provider":{"only":["fireworks"]},"usage":{"include":true},"stream":true}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         body: |+
-            data: {"id":"gen-1758639319-3YvVwuDwqwthyWXlQVFY","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639319,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647469-ldhS0MqmngiaxbWDLudg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647469,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639319-3YvVwuDwqwthyWXlQVFY","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639319,"choices":[{"index":0,"delta":{"role":"assistant","content":"Oi!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647469-ldhS0MqmngiaxbWDLudg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647469,"choices":[{"index":0,"delta":{"role":"assistant","content":"Olá"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639319-3YvVwuDwqwthyWXlQVFY","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639319,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+            data: {"id":"gen-1758647469-ldhS0MqmngiaxbWDLudg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647469,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639319-3YvVwuDwqwthyWXlQVFY","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639319,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":20,"completion_tokens":3,"total_tokens":23,"cost":0.0000195,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000012,"upstream_inference_completions_cost":0.0000075},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+            data: {"id":"gen-1758647469-ldhS0MqmngiaxbWDLudg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647469,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+
+            data: {"id":"gen-1758647469-ldhS0MqmngiaxbWDLudg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647469,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":20,"completion_tokens":4,"total_tokens":24,"cost":0.000022,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000012,"upstream_inference_completions_cost":0.00001},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
             data: [DONE]
 
         headers:
             Content-Type:
-                - text/event-stream
+              - text/event-stream
         status: 200 OK
         code: 200
-        duration: 1.570646291s
+        duration: 4.252091834s

providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_moonshotai.yaml 🔗

@@ -1,46 +1,46 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
         content_length: 287
         host: ""
-        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"usage":{"include":true},"provider":{"only":["moonshotai"]},"stream":true}'
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"provider":{"only":["moonshotai"]},"usage":{"include":true},"stream":true}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         body: |+
-            data: {"id":"gen-1758639323-AYoeSaD2V0lFcYlfea27","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639323,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+            data: {"id":"gen-1758647475-NjRUBXUyhWW7nyGyJvYL","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647475,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
 
-            data: {"id":"gen-1758639323-AYoeSaD2V0lFcYlfea27","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639323,"choices":[{"index":0,"delta":{"role":"assistant","content":"Ol"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+            data: {"id":"gen-1758647475-NjRUBXUyhWW7nyGyJvYL","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647475,"choices":[{"index":0,"delta":{"role":"assistant","content":"Ol"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
 
-            data: {"id":"gen-1758639323-AYoeSaD2V0lFcYlfea27","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639323,"choices":[{"index":0,"delta":{"role":"assistant","content":"á"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+            data: {"id":"gen-1758647475-NjRUBXUyhWW7nyGyJvYL","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647475,"choices":[{"index":0,"delta":{"role":"assistant","content":"á"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
 
-            data: {"id":"gen-1758639323-AYoeSaD2V0lFcYlfea27","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639323,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+            data: {"id":"gen-1758647475-NjRUBXUyhWW7nyGyJvYL","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647475,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
 
-            data: {"id":"gen-1758639323-AYoeSaD2V0lFcYlfea27","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639323,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+            data: {"id":"gen-1758647475-NjRUBXUyhWW7nyGyJvYL","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647475,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
 
-            data: {"id":"gen-1758639323-AYoeSaD2V0lFcYlfea27","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639323,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":20,"completion_tokens":4,"total_tokens":24,"cost":0.000022,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000012,"upstream_inference_completions_cost":0.00001},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+            data: {"id":"gen-1758647475-NjRUBXUyhWW7nyGyJvYL","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647475,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":20,"completion_tokens":4,"total_tokens":24,"cost":0.000022,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000012,"upstream_inference_completions_cost":0.00001},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
             data: [DONE]
 
         headers:
             Content-Type:
-                - text/event-stream
+              - text/event-stream
         status: 200 OK
         code: 200
-        duration: 1.609822667s
+        duration: 1.696996333s

providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_moonshotai/turbo.yaml 🔗

@@ -1,8 +1,8 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
@@ -11,36 +11,34 @@ interactions:
         body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"provider":{"only":["moonshotai/turbo"]},"usage":{"include":true},"stream":true}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         body: |+
-            data: {"id":"gen-1758639335-6tKyMLfjzFV2qR97Acz8","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639335,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+            data: {"id":"gen-1758647500-PUYPB4Y2HuxAFlamEjcR","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647500,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
 
-            data: {"id":"gen-1758639335-6tKyMLfjzFV2qR97Acz8","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639335,"choices":[{"index":0,"delta":{"role":"assistant","content":"Ol"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+            data: {"id":"gen-1758647500-PUYPB4Y2HuxAFlamEjcR","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647500,"choices":[{"index":0,"delta":{"role":"assistant","content":"Oi"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
 
-            data: {"id":"gen-1758639335-6tKyMLfjzFV2qR97Acz8","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639335,"choices":[{"index":0,"delta":{"role":"assistant","content":"á"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+            data: {"id":"gen-1758647500-PUYPB4Y2HuxAFlamEjcR","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647500,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
 
-            data: {"id":"gen-1758639335-6tKyMLfjzFV2qR97Acz8","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639335,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+            data: {"id":"gen-1758647500-PUYPB4Y2HuxAFlamEjcR","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647500,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
 
-            data: {"id":"gen-1758639335-6tKyMLfjzFV2qR97Acz8","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639335,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
-
-            data: {"id":"gen-1758639335-6tKyMLfjzFV2qR97Acz8","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639335,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":20,"completion_tokens":4,"total_tokens":24,"cost":0.000044,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000024,"upstream_inference_completions_cost":0.00002},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+            data: {"id":"gen-1758647500-PUYPB4Y2HuxAFlamEjcR","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647500,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":20,"completion_tokens":3,"total_tokens":23,"cost":0.000039,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000024,"upstream_inference_completions_cost":0.000015},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
             data: [DONE]
 
         headers:
             Content-Type:
-                - text/event-stream
+              - text/event-stream
         status: 200 OK
         code: 200
-        duration: 1.289811792s
+        duration: 1.268958917s

providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_novita.yaml 🔗

@@ -1,8 +1,8 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
@@ -11,34 +11,34 @@ interactions:
         body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"provider":{"only":["novita"]},"usage":{"include":true},"stream":true}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         body: |+
-            data: {"id":"gen-1758639326-mMzrivCI9J10CUf45IMq","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639326,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+            data: {"id":"gen-1758647478-b3wMzkI1dwBw9OtGtAQW","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647478,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
 
-            data: {"id":"gen-1758639326-mMzrivCI9J10CUf45IMq","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639326,"choices":[{"index":0,"delta":{"role":"assistant","content":"Oi"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+            data: {"id":"gen-1758647478-b3wMzkI1dwBw9OtGtAQW","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647478,"choices":[{"index":0,"delta":{"role":"assistant","content":"Oi"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
 
-            data: {"id":"gen-1758639326-mMzrivCI9J10CUf45IMq","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639326,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+            data: {"id":"gen-1758647478-b3wMzkI1dwBw9OtGtAQW","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647478,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
 
-            data: {"id":"gen-1758639326-mMzrivCI9J10CUf45IMq","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639326,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":""}
+            data: {"id":"gen-1758647478-b3wMzkI1dwBw9OtGtAQW","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647478,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
 
-            data: {"id":"gen-1758639326-mMzrivCI9J10CUf45IMq","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639326,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":21,"completion_tokens":2,"total_tokens":23,"cost":0.0000176,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000126,"upstream_inference_completions_cost":0.000005},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+            data: {"id":"gen-1758647478-b3wMzkI1dwBw9OtGtAQW","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647478,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":20,"completion_tokens":3,"total_tokens":23,"cost":0.0000195,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000012,"upstream_inference_completions_cost":0.0000075},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
             data: [DONE]
 
         headers:
             Content-Type:
-                - text/event-stream
+              - text/event-stream
         status: 200 OK
         code: 200
-        duration: 1.952843334s
+        duration: 1.420902542s

providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_siliconflow.yaml 🔗

@@ -1,8 +1,8 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
@@ -11,34 +11,36 @@ interactions:
         body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"provider":{"only":["siliconflow"]},"usage":{"include":true},"stream":true}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         body: |+
-            data: {"id":"gen-1758639308-HFBLo1Zjk56YcERtInn9","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639308,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+            data: {"id":"gen-1758647464-uJS9cAqvR6Iaw25w38e1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647464,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
 
-            data: {"id":"gen-1758639308-HFBLo1Zjk56YcERtInn9","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639308,"choices":[{"index":0,"delta":{"role":"assistant","content":"Oi"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+            data: {"id":"gen-1758647464-uJS9cAqvR6Iaw25w38e1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647464,"choices":[{"index":0,"delta":{"role":"assistant","content":"Ol"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
 
-            data: {"id":"gen-1758639308-HFBLo1Zjk56YcERtInn9","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639308,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+            data: {"id":"gen-1758647464-uJS9cAqvR6Iaw25w38e1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647464,"choices":[{"index":0,"delta":{"role":"assistant","content":"á"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
 
-            data: {"id":"gen-1758639308-HFBLo1Zjk56YcERtInn9","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639308,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":""}
+            data: {"id":"gen-1758647464-uJS9cAqvR6Iaw25w38e1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647464,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
 
-            data: {"id":"gen-1758639308-HFBLo1Zjk56YcERtInn9","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639308,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":21,"completion_tokens":2,"total_tokens":23,"cost":0.00001676,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00001218,"upstream_inference_completions_cost":0.00000458},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+            data: {"id":"gen-1758647464-uJS9cAqvR6Iaw25w38e1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647464,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647464-uJS9cAqvR6Iaw25w38e1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647464,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":21,"completion_tokens":3,"total_tokens":24,"cost":0.00001905,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00001218,"upstream_inference_completions_cost":0.00000687},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
             data: [DONE]
 
         headers:
             Content-Type:
-                - text/event-stream
+              - text/event-stream
         status: 200 OK
         code: 200
-        duration: 1.296429666s
+        duration: 946.506667ms

providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_together.yaml 🔗

@@ -1,8 +1,8 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
@@ -11,36 +11,34 @@ interactions:
         body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"provider":{"only":["together"]},"usage":{"include":true},"stream":true}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         body: |+
-            data: {"id":"gen-1758639333-BByAqWD42pHSJWup3zEp","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639333,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647483-7dVWVeDC30j4TiHGv5st","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647483,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639333-BByAqWD42pHSJWup3zEp","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639333,"choices":[{"index":0,"delta":{"role":"assistant","content":"Ol"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647483-7dVWVeDC30j4TiHGv5st","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647483,"choices":[{"index":0,"delta":{"role":"assistant","content":"Oi"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639333-BByAqWD42pHSJWup3zEp","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639333,"choices":[{"index":0,"delta":{"role":"assistant","content":"á"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647483-7dVWVeDC30j4TiHGv5st","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647483,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639333-BByAqWD42pHSJWup3zEp","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639333,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647483-7dVWVeDC30j4TiHGv5st","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647483,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
 
-            data: {"id":"gen-1758639333-BByAqWD42pHSJWup3zEp","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639333,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
-
-            data: {"id":"gen-1758639333-BByAqWD42pHSJWup3zEp","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639333,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":21,"completion_tokens":4,"total_tokens":25,"cost":0.000033,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000021,"upstream_inference_completions_cost":0.000012},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+            data: {"id":"gen-1758647483-7dVWVeDC30j4TiHGv5st","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647483,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":21,"completion_tokens":3,"total_tokens":24,"cost":0.00003,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000021,"upstream_inference_completions_cost":0.000009},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
             data: [DONE]
 
         headers:
             Content-Type:
-                - text/event-stream
+              - text/event-stream
         status: 200 OK
         code: 200
-        duration: 630.269125ms
+        duration: 658.128708ms

providertests/testdata/TestOpenRouterCommon/simple_streaming_kimi-k2_wandb.yaml 🔗

@@ -1,8 +1,8 @@
 ---
 version: 2
 interactions:
-    - id: 0
-      request:
+  - id: 0
+    request:
         proto: HTTP/1.1
         proto_major: 1
         proto_minor: 1
@@ -11,36 +11,36 @@ interactions:
         body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"stream_options":{"include_usage":true},"provider":{"only":["wandb"]},"usage":{"include":true},"stream":true}'
         headers:
             Accept:
-                - application/json
+              - application/json
             Content-Type:
-                - application/json
+              - application/json
             User-Agent:
-                - OpenAI/Go 2.3.0
+              - OpenAI/Go 2.3.0
         url: https://openrouter.ai/api/v1/chat/completions
         method: POST
-      response:
+    response:
         proto: HTTP/2.0
         proto_major: 2
         proto_minor: 0
         content_length: -1
         body: |+
-            data: {"id":"gen-1758639338-aZHT7rLqW05Vh35xd7ga","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639338,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647509-IQsF8XQuXxC2mfm6tQLT","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647509,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639338-aZHT7rLqW05Vh35xd7ga","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639338,"choices":[{"index":0,"delta":{"role":"assistant","content":"Ol"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647509-IQsF8XQuXxC2mfm6tQLT","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647509,"choices":[{"index":0,"delta":{"role":"assistant","content":"Ol"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639338-aZHT7rLqW05Vh35xd7ga","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639338,"choices":[{"index":0,"delta":{"role":"assistant","content":"á"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647509-IQsF8XQuXxC2mfm6tQLT","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647509,"choices":[{"index":0,"delta":{"role":"assistant","content":"á"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639338-aZHT7rLqW05Vh35xd7ga","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639338,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+            data: {"id":"gen-1758647509-IQsF8XQuXxC2mfm6tQLT","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647509,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
 
-            data: {"id":"gen-1758639338-aZHT7rLqW05Vh35xd7ga","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639338,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+            data: {"id":"gen-1758647509-IQsF8XQuXxC2mfm6tQLT","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647509,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
 
-            data: {"id":"gen-1758639338-aZHT7rLqW05Vh35xd7ga","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758639338,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":20,"completion_tokens":4,"total_tokens":24,"cost":0.000043,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000027,"upstream_inference_completions_cost":0.000016},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+            data: {"id":"gen-1758647509-IQsF8XQuXxC2mfm6tQLT","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647509,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":20,"completion_tokens":4,"total_tokens":24,"cost":0.000043,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000027,"upstream_inference_completions_cost":0.000016},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
 
             data: [DONE]
 
         headers:
             Content-Type:
-                - text/event-stream
+              - text/event-stream
         status: 200 OK
         code: 200
-        duration: 320.202417ms
+        duration: 394.840916ms

providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_baseten.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 522
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["baseten"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_chutes.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 521
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["chutes"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_deepinfra.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 524
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["deepinfra"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true
+        body: "\n         \n\n         \n{\"id\":\"gen-1758647743-WrSLHtJnZuGPrOag9sOz\",\"provider\":\"DeepInfra\",\"model\":\"moonshotai/kimi-k2-0905\",\"object\":\"chat.completion\",\"created\":1758647743,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"tool_calls\",\"native_finish_reason\":\"tool_calls\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"\",\"refusal\":null,\"reasoning\":null,\"tool_calls\":[{\"index\":0,\"id\":\"0\",\"function\":{\"arguments\":\"{\\\"location\\\": \\\"Florence, Italy\\\"}\",\"name\":\"weather\"},\"type\":\"function\"}]}}],\"usage\":{\"prompt_tokens\":90,\"completion_tokens\":10,\"total_tokens\":100,\"cost\":0.000065,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.000045,\"upstream_inference_completions_cost\":0.00002},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}"
+        headers:
+            Content-Type:
+              - application/json
+        status: 200 OK
+        code: 200
+        duration: 700.128417ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 721
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"0","function":{"arguments":"{\"location\": \"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"0","role":"tool"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["deepinfra"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_fireworks.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 524
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["fireworks"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_moonshotai.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 525
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["moonshotai"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_moonshotai/turbo.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 531
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["moonshotai/turbo"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_novita.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 521
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["novita"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_siliconflow.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 526
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["siliconflow"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_together.yaml 🔗

@@ -0,0 +1,63 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 523
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["together"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/tool_kimi-k2_wandb.yaml 🔗

@@ -0,0 +1,353 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 520
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["wandb"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: '{"error":{"message":"Provider returned error","code":429,"metadata":{"raw":"moonshotai/kimi-k2-0905 is temporarily rate-limited upstream. Please retry shortly, or add your own key to accumulate your rate limits: https://openrouter.ai/settings/integrations","provider_name":"WandB"}},"user_id":"user_2zMGmKqlf4zmAvL9snVImB1Z1ZQ"}'
+        headers:
+            Content-Type:
+              - application/json
+        status: 429 Too Many Requests
+        code: 429
+        duration: 342.70525ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 520
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["wandb"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: '{"error":{"message":"Provider returned error","code":429,"metadata":{"raw":"moonshotai/kimi-k2-0905 is temporarily rate-limited upstream. Please retry shortly, or add your own key to accumulate your rate limits: https://openrouter.ai/settings/integrations","provider_name":"WandB"}},"user_id":"user_2zMGmKqlf4zmAvL9snVImB1Z1ZQ"}'
+        headers:
+            Content-Type:
+              - application/json
+        status: 429 Too Many Requests
+        code: 429
+        duration: 350.212084ms
+  - id: 2
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 520
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["wandb"]},"usage":{"include":true}}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        uncompressed: true

providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_baseten.yaml 🔗

@@ -0,0 +1,201 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 576
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["baseten"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":" check"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":" weather"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":" Florence"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":" Italy"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":" you"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.weather:0","type":"function","function":{"name":"weather","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.weather:0","type":"function","function":{"name":"","arguments":"{\"location"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.weather:0","type":"function","function":{"name":"","arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.weather:0","type":"function","function":{"name":"","arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.weather:0","type":"function","function":{"name":"","arguments":"Fl"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.weather:0","type":"function","function":{"name":"","arguments":"ore"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.weather:0","type":"function","function":{"name":"","arguments":"nce"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.weather:0","type":"function","function":{"name":"","arguments":","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.weather:0","type":"function","function":{"name":"","arguments":"Italy"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.weather:0","type":"function","function":{"name":"","arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647853-06Z3JGC7ksT7p63wf5RQ","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647853,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":104,"completion_tokens":32,"total_tokens":136,"cost":0.0001424,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000624,"upstream_inference_completions_cost":0.00008},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 457.580083ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 871
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"content":"I''ll check the weather in Florence, Italy for you.","tool_calls":[{"id":"functions.weather:0","function":{"arguments":"{\"location\": \"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"functions.weather:0","role":"tool"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["baseten"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":"The"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" current"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" weather"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" Florence"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" Italy"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" is"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" quite"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" hot"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" -"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" it's"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":"40"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":"°C"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" ("},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":"104"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":"°F"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":")."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" That's"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" very"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" warm"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" summer"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" weather"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" so"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" if"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" you're"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" planning"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" be"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" outdoors"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" make"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" sure"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" stay"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" hydrated"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" wear"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" sun"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":" protection"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":null}
+
+            data: {"id":"gen-1758647854-8zZPOFTdxrzjiTbUglxm","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647854,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":156,"completion_tokens":44,"total_tokens":200,"cost":0.0002036,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000936,"upstream_inference_completions_cost":0.00011},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 522.1905ms

providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_chutes.yaml 🔗

@@ -0,0 +1,143 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 575
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["chutes"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":" check"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":" weather"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":" Florence"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":" Italy"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":" you"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.weather:0","index":0,"type":"function","function":{"name":"weather","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"{\"location"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"Fl"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"ore"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"nce"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"Italy"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]}
+
+            data: {"id":"gen-1758647730-E5ilemyx87hNWyviDeGG","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647730,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":94,"completion_tokens":32,"total_tokens":126,"cost":0.00008436,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00003572,"upstream_inference_completions_cost":0.00004864},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 658.299792ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 870
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"content":"I''ll check the weather in Florence, Italy for you.","tool_calls":[{"id":"functions.weather:0","function":{"arguments":"{\"location\": \"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"functions.weather:0","role":"tool"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["chutes"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647731-c9hC8Lo2wEvK7VRxBQ3q","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647731,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647731-c9hC8Lo2wEvK7VRxBQ3q","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647731,"choices":[{"index":0,"delta":{"role":"assistant","content":"The"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647731-c9hC8Lo2wEvK7VRxBQ3q","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647731,"choices":[{"index":0,"delta":{"role":"assistant","content":" weather"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647731-c9hC8Lo2wEvK7VRxBQ3q","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647731,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647731-c9hC8Lo2wEvK7VRxBQ3q","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647731,"choices":[{"index":0,"delta":{"role":"assistant","content":" Florence"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647731-c9hC8Lo2wEvK7VRxBQ3q","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647731,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647731-c9hC8Lo2wEvK7VRxBQ3q","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647731,"choices":[{"index":0,"delta":{"role":"assistant","content":" Italy"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647731-c9hC8Lo2wEvK7VRxBQ3q","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647731,"choices":[{"index":0,"delta":{"role":"assistant","content":" is"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647731-c9hC8Lo2wEvK7VRxBQ3q","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647731,"choices":[{"index":0,"delta":{"role":"assistant","content":" currently"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647731-c9hC8Lo2wEvK7VRxBQ3q","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647731,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647731-c9hC8Lo2wEvK7VRxBQ3q","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647731,"choices":[{"index":0,"delta":{"role":"assistant","content":"40"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647731-c9hC8Lo2wEvK7VRxBQ3q","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647731,"choices":[{"index":0,"delta":{"role":"assistant","content":"°C"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647731-c9hC8Lo2wEvK7VRxBQ3q","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647731,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647731-c9hC8Lo2wEvK7VRxBQ3q","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647731,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+
+            data: {"id":"gen-1758647731-c9hC8Lo2wEvK7VRxBQ3q","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647731,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":147,"completion_tokens":13,"total_tokens":160,"cost":0.00007562,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00005586,"upstream_inference_completions_cost":0.00001976},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 1.492680459s

providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_deepinfra.yaml 🔗

@@ -0,0 +1,77 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 578
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["deepinfra"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647747-D3hShTgVSXbAvHVPpqhd","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647747,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647747-D3hShTgVSXbAvHVPpqhd","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647747,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"0","function":{"arguments":"{\"location\": \"Florence,Italy\"}","name":"weather"},"type":"function"}]},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]}
+
+            data: {"id":"gen-1758647747-D3hShTgVSXbAvHVPpqhd","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647747,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":90,"completion_tokens":10,"total_tokens":100,"cost":0.000065,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000045,"upstream_inference_completions_cost":0.00002},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 693.966125ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 774
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"0","function":{"arguments":"{\"location\": \"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"0","role":"tool"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["deepinfra"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647748-mmXjjHdbaAlP5QHWYJ75","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647748,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647748-mmXjjHdbaAlP5QHWYJ75","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647748,"choices":[{"index":0,"delta":{"role":"assistant","content":"Florence is quite hot right now—about 40 °C (104 °F)."},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+
+            data: {"id":"gen-1758647748-mmXjjHdbaAlP5QHWYJ75","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647748,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":124,"completion_tokens":19,"total_tokens":143,"cost":0.0001,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000062,"upstream_inference_completions_cost":0.000038},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 595.7005ms

providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_fireworks.yaml 🔗

@@ -0,0 +1,143 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 578
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["fireworks"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll check"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":" weather"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":" Florence"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":" Italy"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":" you"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.weather:0","type":"function","function":{"name":"weather"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"location"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Fl"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"ore"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"nce"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Italy"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]}
+
+            data: {"id":"gen-1758647789-kfEbmZIirxBGNQbGejxE","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647789,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":97,"completion_tokens":32,"total_tokens":129,"cost":0.0001382,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000582,"upstream_inference_completions_cost":0.00008},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 832.092417ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 874
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"content":"I''ll check the weather for Florence, Italy for you.","tool_calls":[{"id":"functions.weather:0","function":{"arguments":"{\"location\": \"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"functions.weather:0","role":"tool"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["fireworks"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647790-O2rtZN9DMkRBX7vGIIzQ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647790,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647790-O2rtZN9DMkRBX7vGIIzQ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647790,"choices":[{"index":0,"delta":{"role":"assistant","content":"The current"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647790-O2rtZN9DMkRBX7vGIIzQ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647790,"choices":[{"index":0,"delta":{"role":"assistant","content":" temperature"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647790-O2rtZN9DMkRBX7vGIIzQ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647790,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647790-O2rtZN9DMkRBX7vGIIzQ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647790,"choices":[{"index":0,"delta":{"role":"assistant","content":" Florence"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647790-O2rtZN9DMkRBX7vGIIzQ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647790,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647790-O2rtZN9DMkRBX7vGIIzQ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647790,"choices":[{"index":0,"delta":{"role":"assistant","content":" Italy"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647790-O2rtZN9DMkRBX7vGIIzQ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647790,"choices":[{"index":0,"delta":{"role":"assistant","content":" is"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647790-O2rtZN9DMkRBX7vGIIzQ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647790,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647790-O2rtZN9DMkRBX7vGIIzQ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647790,"choices":[{"index":0,"delta":{"role":"assistant","content":"40"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647790-O2rtZN9DMkRBX7vGIIzQ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647790,"choices":[{"index":0,"delta":{"role":"assistant","content":"°C"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647790-O2rtZN9DMkRBX7vGIIzQ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647790,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647790-O2rtZN9DMkRBX7vGIIzQ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647790,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+
+            data: {"id":"gen-1758647790-O2rtZN9DMkRBX7vGIIzQ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647790,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":143,"completion_tokens":13,"total_tokens":156,"cost":0.0001183,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000858,"upstream_inference_completions_cost":0.0000325},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 2.139159834s

providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_moonshotai.yaml 🔗

@@ -0,0 +1,203 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 579
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["moonshotai"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":" check"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":" current"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":" weather"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":" Florence"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":" Italy"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":" you"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"weather:0","type":"function","function":{"name":"weather","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"location"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Fl"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"ore"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"nce"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":","},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Italy"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647805-Pt4ssQdHpHjviwMbC6vu","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647805,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":76,"completion_tokens":32,"total_tokens":108,"cost":0.0002512,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000912,"upstream_inference_completions_cost":0.00016},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 1.425382084s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 862
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"content":"I''ll check the current weather in Florence, Italy for you.","tool_calls":[{"id":"weather:0","function":{"arguments":"{\"location\": \"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"weather:0","role":"tool"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["moonshotai"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":"The"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" current"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" temperature"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" Florence"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" Italy"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" is"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":"40"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":"°C"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" ("},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":"which"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" equals"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":"104"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":"°F"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":")."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" It's"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" quite"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" hot"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" there"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" right"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" now"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" -"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" make"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" sure"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" stay"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" hydrated"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" wear"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" sunscreen"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" if"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" you're"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" going"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" be"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":" outdoors"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647807-YxvJkSx4b8QKOLd9muc6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647807,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":127,"completion_tokens":41,"total_tokens":168,"cost":0.0003574,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0001524,"upstream_inference_completions_cost":0.000205},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 1.188149417s

providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_moonshotai/turbo.yaml 🔗

@@ -0,0 +1,173 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 585
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["moonshotai/turbo"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":" check"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":" weather"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":" Florence"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":" Italy"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":" you"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"weather:0","type":"function","function":{"name":"weather","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"location"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Fl"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"ore"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"nce"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":","},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" Italy"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647914-p5OUoNTtZTDXM0Yc45g3","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647914,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":76,"completion_tokens":31,"total_tokens":107,"cost":0.0002462,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000912,"upstream_inference_completions_cost":0.000155},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 1.339924583s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 862
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"content":"I''ll check the weather for Florence, Italy for you.","tool_calls":[{"id":"weather:0","function":{"arguments":"{\"location\": \"Florence, Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"weather:0","role":"tool"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["moonshotai/turbo"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":"The"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" weather"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" Florence"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" Italy"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" is"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" currently"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" quite"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" hot"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" at"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":"40"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":"°C"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" ("},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":"104"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":"°F"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":")."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" It's"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" a"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" very"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" warm"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" summer"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" day"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":" there"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fpv0_ec889fbb"}
+
+            data: {"id":"gen-1758647916-ARXAYp7SV4kPKA0sGQA6","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647916,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":126,"completion_tokens":27,"total_tokens":153,"cost":0.0002862,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0001512,"upstream_inference_completions_cost":0.000135},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 974.065042ms

providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_novita.yaml 🔗

@@ -0,0 +1,127 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 575
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["novita"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647824-zsNFyzvAllxRlZwE7Ic2","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647824,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647824-zsNFyzvAllxRlZwE7Ic2","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647824,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"weather:0","type":"function","function":{"name":"weather"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647824-zsNFyzvAllxRlZwE7Ic2","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647824,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647824-zsNFyzvAllxRlZwE7Ic2","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647824,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"location"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647824-zsNFyzvAllxRlZwE7Ic2","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647824,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647824-zsNFyzvAllxRlZwE7Ic2","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647824,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647824-zsNFyzvAllxRlZwE7Ic2","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647824,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Fl"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647824-zsNFyzvAllxRlZwE7Ic2","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647824,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"ore"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647824-zsNFyzvAllxRlZwE7Ic2","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647824,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"nce"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647824-zsNFyzvAllxRlZwE7Ic2","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647824,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":","},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647824-zsNFyzvAllxRlZwE7Ic2","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647824,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Italy"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647824-zsNFyzvAllxRlZwE7Ic2","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647824,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647824-zsNFyzvAllxRlZwE7Ic2","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647824,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647824-zsNFyzvAllxRlZwE7Ic2","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647824,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":76,"completion_tokens":20,"total_tokens":96,"cost":0.0000956,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000456,"upstream_inference_completions_cost":0.00005},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 2.760369292s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 787
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"weather:0","function":{"arguments":"{\"location\": \"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"weather:0","role":"tool"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["novita"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":"It's"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":" currently"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":"40"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":" °"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":"C"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":" Florence"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":" Italy"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":"—"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":"quite"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":" hot"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"}
+
+            data: {"id":"gen-1758647827-0f0P0wXEzQyNaGOW960O","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647827,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":115,"completion_tokens":15,"total_tokens":130,"cost":0.0001065,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000069,"upstream_inference_completions_cost":0.0000375},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 2.164437167s

providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_siliconflow.yaml 🔗

@@ -0,0 +1,197 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 580
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["siliconflow"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":" check"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":" weather"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":" Florence"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":" Italy"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":" you"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.weather:0","type":"function","function":{"name":"weather","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"location"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Fl"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"ore"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"nce"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Italy"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647762-KghUIUodL1L59UJSyEo8","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647762,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":104,"completion_tokens":31,"total_tokens":135,"cost":0.00013131,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00006032,"upstream_inference_completions_cost":0.00007099},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 1.276751334s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 875
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"content":"I''ll check the weather in Florence, Italy for you.","tool_calls":[{"id":"functions.weather:0","function":{"arguments":"{\"location\": \"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"functions.weather:0","role":"tool"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["siliconflow"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":"It"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" appears"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" be"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" quite"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" hot"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" Florence"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" Italy"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" right"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" now"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" a"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" temperature"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" of"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":"40"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":"°C"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" ("},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":"104"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":"°F"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":")."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" Make"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" sure"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" stay"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" hydrated"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" seek"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" shade"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" if"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" you're"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" planning"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" be"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":" outdoors"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":""}
+
+            data: {"id":"gen-1758647765-u1AXxNss8Cq9wkMDOE9R","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647765,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":157,"completion_tokens":38,"total_tokens":195,"cost":0.00017808,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00009106,"upstream_inference_completions_cost":0.00008702},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 2.030076209s

providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_together.yaml 🔗

@@ -0,0 +1,151 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 577
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["together"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647862-PGPJOAJiZy002PbCeSPO","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647862,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647862-PGPJOAJiZy002PbCeSPO","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647862,"choices":[{"index":0,"delta":{"role":"assistant","content":" check"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647862-PGPJOAJiZy002PbCeSPO","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647862,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647862-PGPJOAJiZy002PbCeSPO","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647862,"choices":[{"index":0,"delta":{"role":"assistant","content":" weather"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647862-PGPJOAJiZy002PbCeSPO","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647862,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647862-PGPJOAJiZy002PbCeSPO","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647862,"choices":[{"index":0,"delta":{"role":"assistant","content":" Florence"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647862-PGPJOAJiZy002PbCeSPO","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647862,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647862-PGPJOAJiZy002PbCeSPO","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647862,"choices":[{"index":0,"delta":{"role":"assistant","content":" Italy"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647862-PGPJOAJiZy002PbCeSPO","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647862,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647862-PGPJOAJiZy002PbCeSPO","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647862,"choices":[{"index":0,"delta":{"role":"assistant","content":" you"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647862-PGPJOAJiZy002PbCeSPO","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647862,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647862-PGPJOAJiZy002PbCeSPO","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647862,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647862-PGPJOAJiZy002PbCeSPO","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647862,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_q1y90rxt8v3ujv75tz56kd9u","type":"function","function":{"name":"weather","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647862-PGPJOAJiZy002PbCeSPO","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647862,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\"location\":\"Florence,Italy\"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647862-PGPJOAJiZy002PbCeSPO","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647862,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]}
+
+            data: {"id":"gen-1758647862-PGPJOAJiZy002PbCeSPO","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647862,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":105,"completion_tokens":32,"total_tokens":137,"cost":0.000201,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000105,"upstream_inference_completions_cost":0.000096},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 1.08302075s
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 891
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"content":"I''ll check the weather in Florence, Italy for you.","tool_calls":[{"id":"call_q1y90rxt8v3ujv75tz56kd9u","function":{"arguments":"{\"location\":\"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"call_q1y90rxt8v3ujv75tz56kd9u","role":"tool"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["together"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":"Right"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":" now"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":" Florence"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":" it"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":" is"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":"40"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":"°C"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":" ("},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":"104"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":"°F"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":")"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":" almost"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":" certainly"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":" sunny"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":"—"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":"classic"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":" mids"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":"ummer"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":" Tus"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":"can"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":" heat"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+
+            data: {"id":"gen-1758647864-oiwAyzzmoAJGhSvlrMcM","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647864,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":207,"completion_tokens":26,"total_tokens":233,"cost":0.000285,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000207,"upstream_inference_completions_cost":0.000078},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 4.530234333s

providertests/testdata/TestOpenRouterCommon/tool_streaming_kimi-k2_wandb.yaml 🔗

@@ -0,0 +1,220 @@
+---
+version: 2
+interactions:
+  - id: 0
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 574
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["wandb"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":" check"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":" weather"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":" Florence"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":" Italy"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":" right"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":" now"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.weather:0","type":"function","index":0,"function":{"name":"weather"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"location"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Fl"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"ore"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"nce"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]}
+
+            data: {"id":"gen-1758647943-3Y7XIA4Pet8LczpLpaDZ","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647943,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":97,"completion_tokens":30,"total_tokens":127,"cost":0.00025095,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00013095,"upstream_inference_completions_cost":0.00012},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 496.2315ms
+  - id: 1
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 866
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"content":"I''ll check the weather for Florence, Italy right now.","tool_calls":[{"id":"functions.weather:0","function":{"arguments":"{\"location\": \"Florence\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"functions.weather:0","role":"tool"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["wandb"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: '{"error":{"message":"Provider returned error","code":429,"metadata":{"raw":"moonshotai/kimi-k2-0905 is temporarily rate-limited upstream. Please retry shortly, or add your own key to accumulate your rate limits: https://openrouter.ai/settings/integrations","provider_name":"WandB"}},"user_id":"user_2zMGmKqlf4zmAvL9snVImB1Z1ZQ"}'
+        headers:
+            Content-Type:
+              - application/json
+        status: 429 Too Many Requests
+        code: 429
+        duration: 280.707583ms
+  - id: 2
+    request:
+        proto: HTTP/1.1
+        proto_major: 1
+        proto_minor: 1
+        content_length: 866
+        host: ""
+        body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"content":"I''ll check the weather for Florence, Italy right now.","tool_calls":[{"id":"functions.weather:0","function":{"arguments":"{\"location\": \"Florence\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"functions.weather:0","role":"tool"}],"model":"moonshotai/kimi-k2-0905","max_tokens":4000,"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"}],"provider":{"only":["wandb"]},"usage":{"include":true},"stream":true}'
+        headers:
+            Accept:
+              - application/json
+            Content-Type:
+              - application/json
+            User-Agent:
+              - OpenAI/Go 2.3.0
+        url: https://openrouter.ai/api/v1/chat/completions
+        method: POST
+    response:
+        proto: HTTP/2.0
+        proto_major: 2
+        proto_minor: 0
+        content_length: -1
+        body: |+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":"Fl"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":"ore"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":"nce"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" is"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" quite"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" warm"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" right"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" now"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":"—"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":"temperature"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":"s"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" are"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" around"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" **"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":"40"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" °"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":"C"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":"**."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" If"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" you're"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" heading"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" out"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" be"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" sure"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" stay"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" hydrated"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" use"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" plenty"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" of"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" sun"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":" protection"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+
+            data: {"id":"gen-1758647944-5EeZ51jkbqPRveFpOa0F","provider":"WandB","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1758647944,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":170,"completion_tokens":36,"total_tokens":206,"cost":0.0003735,"is_byok":false,"prompt_tokens_details":{"cached_tokens":64,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0002295,"upstream_inference_completions_cost":0.000144},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+
+            data: [DONE]
+
+        headers:
+            Content-Type:
+              - text/event-stream
+        status: 200 OK
+        code: 200
+        duration: 302.790792ms

providertests/thinking_test.go 🔗

@@ -1,90 +0,0 @@
-package providertests
-
-import (
-	"fmt"
-	"testing"
-
-	"github.com/charmbracelet/fantasy/ai"
-	"github.com/charmbracelet/fantasy/anthropic"
-	"github.com/charmbracelet/fantasy/google"
-	"github.com/charmbracelet/fantasy/openrouter"
-	"github.com/stretchr/testify/require"
-)
-
-func testThinking(t *testing.T, providerName string, steps []ai.StepResult) {
-	switch providerName {
-	case anthropic.Name:
-		testAnthropicThinking(t, steps)
-	case google.Name:
-		testGoogleThinking(t, steps)
-	case openrouter.Name:
-		testOpenrouterThinking(t, steps)
-	}
-}
-
-func testGoogleThinking(t *testing.T, steps []ai.StepResult) {
-	reasoningContentCount := 0
-	// Test if we got the signature
-	for _, step := range steps {
-		for _, msg := range step.Messages {
-			for _, content := range msg.Content {
-				if content.GetType() == ai.ContentTypeReasoning {
-					reasoningContentCount += 1
-				}
-			}
-		}
-	}
-	require.Greater(t, reasoningContentCount, 0)
-}
-
-func testOpenrouterThinking(t *testing.T, steps []ai.StepResult) {
-	reasoningContentCount := 0
-	// Test if we got the signature
-	for _, step := range steps {
-		for _, msg := range step.Messages {
-			for _, content := range msg.Content {
-				if content.GetType() == ai.ContentTypeReasoning {
-					reasoningContentCount += 1
-				}
-			}
-		}
-	}
-	fmt.Println(reasoningContentCount)
-	require.Greater(t, reasoningContentCount, 0)
-}
-
-func testAnthropicThinking(t *testing.T, steps []ai.StepResult) {
-	reasoningContentCount := 0
-	signaturesCount := 0
-	// Test if we got the signature
-	for _, step := range steps {
-		for _, msg := range step.Messages {
-			for _, content := range msg.Content {
-				if content.GetType() == ai.ContentTypeReasoning {
-					reasoningContentCount += 1
-					reasoningContent, ok := ai.AsContentType[ai.ReasoningPart](content)
-					if !ok {
-						continue
-					}
-					if len(reasoningContent.ProviderOptions) == 0 {
-						continue
-					}
-
-					anthropicReasoningMetadata, ok := reasoningContent.ProviderOptions[anthropic.Name]
-					if !ok {
-						continue
-					}
-					if reasoningContent.Text != "" {
-						if typed, ok := anthropicReasoningMetadata.(*anthropic.ReasoningOptionMetadata); ok {
-							require.NotEmpty(t, typed.Signature)
-							signaturesCount += 1
-						}
-					}
-				}
-			}
-		}
-	}
-	require.Greater(t, reasoningContentCount, 0)
-	require.Greater(t, signaturesCount, 0)
-	require.Equal(t, reasoningContentCount, signaturesCount)
-}