when:
  path: /api/v1/chat/completions
  method: POST
  query_param: []
  header:
  - name: accept
    value: text/event-stream
  - name: content-type
    value: application/json
  body: '{"include_reasoning":true,"messages":[{"content":[{"text":"You are a weather assistant. You have access to a get_weather tool. You must call the get_weather tool for any weather question and never guess weather data. After receiving the tool result, provide a concise summary of the weather.","type":"text"}],"role":"system"},{"content":"I''m planning a trip. What is the current weather in Tokyo, Japan? Based on the weather conditions, should I pack an umbrella or sunscreen? Use the get_weather tool to check before answering.","role":"user"}],"model":"openai/o4-mini","reasoning":{"effort":"high"},"stream":true,"tools":[{"function":{"description":"Get the current weather for a city. Must be called for weather questions.","name":"get_weather","parameters":{"properties":{"city":{"description":"City name to get weather for","type":"string"}},"required":["city"],"type":"object"}},"type":"function"}]}'
then:
  status: 200
  header:
  - name: content-type
    value: text/event-stream
  body: |+
    : OPENROUTER PROCESSING

    : OPENROUTER PROCESSING

    : OPENROUTER PROCESSING

    data: {"choices":[{"delta":{"content":"","reasoning":null,"reasoning_details":[{"data":"encrypted_reasoning_REDACTED_1","format":"openai-responses-v1","id":"rs_REDACTED_1","index":0,"type":"reasoning.encrypted"}],"role":"assistant"},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_1","model":"openai/o4-mini-2025-04-16","object":"chat.completion.chunk","provider":"OpenAI"}

    data: {"choices":[{"delta":{"content":null,"role":"assistant","tool_calls":[{"function":{"arguments":"","name":"get_weather"},"id":"call_REDACTED_1","index":0,"type":"function"}]},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_1","model":"openai/o4-mini-2025-04-16","object":"chat.completion.chunk","provider":"OpenAI"}

    data: {"choices":[{"delta":{"content":null,"role":"assistant","tool_calls":[{"function":{"arguments":""},"index":0}]},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_1","model":"openai/o4-mini-2025-04-16","object":"chat.completion.chunk","provider":"OpenAI"}

    data: {"choices":[{"delta":{"content":null,"role":"assistant","tool_calls":[{"function":{"arguments":"{\""},"index":0}]},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_1","model":"openai/o4-mini-2025-04-16","object":"chat.completion.chunk","provider":"OpenAI"}

    data: {"choices":[{"delta":{"content":null,"role":"assistant","tool_calls":[{"function":{"arguments":"city"},"index":0}]},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_1","model":"openai/o4-mini-2025-04-16","object":"chat.completion.chunk","provider":"OpenAI"}

    data: {"choices":[{"delta":{"content":null,"role":"assistant","tool_calls":[{"function":{"arguments":"\":\""},"index":0}]},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_1","model":"openai/o4-mini-2025-04-16","object":"chat.completion.chunk","provider":"OpenAI"}

    data: {"choices":[{"delta":{"content":null,"role":"assistant","tool_calls":[{"function":{"arguments":"Tokyo"},"index":0}]},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_1","model":"openai/o4-mini-2025-04-16","object":"chat.completion.chunk","provider":"OpenAI"}

    data: {"choices":[{"delta":{"content":null,"role":"assistant","tool_calls":[{"function":{"arguments":","},"index":0}]},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_1","model":"openai/o4-mini-2025-04-16","object":"chat.completion.chunk","provider":"OpenAI"}

    data: {"choices":[{"delta":{"content":null,"role":"assistant","tool_calls":[{"function":{"arguments":" Japan"},"index":0}]},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_1","model":"openai/o4-mini-2025-04-16","object":"chat.completion.chunk","provider":"OpenAI"}

    data: {"choices":[{"delta":{"content":null,"role":"assistant","tool_calls":[{"function":{"arguments":"\"}"},"index":0}]},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_1","model":"openai/o4-mini-2025-04-16","object":"chat.completion.chunk","provider":"OpenAI"}

    data: {"choices":[{"delta":{"content":"","reasoning":null,"role":"assistant"},"finish_reason":"tool_calls","index":0,"native_finish_reason":"completed"}],"created":0,"id":"chatcmpl-REDACTED_1","model":"openai/o4-mini-2025-04-16","object":"chat.completion.chunk","provider":"OpenAI"}

    data: {"choices":[{"delta":{"content":"","role":"assistant"},"finish_reason":"tool_calls","index":0,"native_finish_reason":"completed"}],"created":0,"id":"chatcmpl-REDACTED_1","model":"openai/o4-mini-2025-04-16","object":"chat.completion.chunk","provider":"OpenAI","service_tier":"default","usage":{"completion_tokens":148,"completion_tokens_details":{"audio_tokens":0,"image_tokens":0,"reasoning_tokens":64},"cost":0.0008107,"cost_details":{"upstream_inference_completions_cost":0.0006512,"upstream_inference_cost":0.0008107,"upstream_inference_prompt_cost":0.0001595},"is_byok":false,"prompt_tokens":145,"prompt_tokens_details":{"audio_tokens":0,"cache_write_tokens":0,"cached_tokens":0,"video_tokens":0},"total_tokens":293}}

    data: [DONE]

