when:
  path: /api/v1/chat/completions
  method: POST
  query_param: []
  header:
  - name: accept
    value: text/event-stream
  - name: content-type
    value: application/json
  body: '{"messages":[{"content":[{"text":"You must call the requested tool before writing any normal text. After the tool result is available, do not call any more tools and answer in one short sentence that includes the exact tool output.","type":"text"}],"role":"system"},{"content":"Call `lookup_harbor_label` exactly once before answering. After the tool result is available, answer in one short sentence that includes the exact tool output.","role":"user"}],"model":"openai/gpt-4o","stream":true,"tools":[{"function":{"description":"Return the alpha signal marker.","name":"lookup_harbor_label","parameters":{"properties":{},"required":[],"type":"object"}},"type":"function"}]}'
then:
  status: 200
  header:
  - name: content-type
    value: text/event-stream
  body: |+
    : OPENROUTER PROCESSING

    data: {"choices":[{"delta":{"content":null,"role":"assistant","tool_calls":[{"function":{"arguments":"","name":"lookup_harbor_label"},"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/gpt-4o","object":"chat.completion.chunk","provider":"Azure","system_fingerprint":"fp_REDACTED_1"}

    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/gpt-4o","object":"chat.completion.chunk","provider":"Azure","system_fingerprint":"fp_REDACTED_1"}

    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/gpt-4o","object":"chat.completion.chunk","provider":"Azure","system_fingerprint":"fp_REDACTED_1"}

    data: {"choices":[{"delta":{"content":"","role":"assistant"},"finish_reason":"tool_calls","index":0,"native_finish_reason":"tool_calls"}],"created":0,"id":"chatcmpl-REDACTED_1","model":"openai/gpt-4o","object":"chat.completion.chunk","provider":"Azure","system_fingerprint":"fp_REDACTED_1"}

    data: {"choices":[{"delta":{"content":"","role":"assistant"},"finish_reason":"tool_calls","index":0,"native_finish_reason":"tool_calls"}],"created":0,"id":"chatcmpl-REDACTED_1","model":"openai/gpt-4o","object":"chat.completion.chunk","provider":"Azure","service_tier":null,"system_fingerprint":"fp_REDACTED_1","usage":{"completion_tokens":14,"completion_tokens_details":{"audio_tokens":0,"image_tokens":0,"reasoning_tokens":0},"cost":0.000415,"cost_details":{"upstream_inference_completions_cost":0.00014,"upstream_inference_cost":0.000415,"upstream_inference_prompt_cost":0.000275},"is_byok":false,"prompt_tokens":110,"prompt_tokens_details":{"audio_tokens":0,"cache_write_tokens":0,"cached_tokens":0,"video_tokens":0},"total_tokens":124}}

    data: [DONE]

---
when:
  path: /api/v1/chat/completions
  method: POST
  query_param: []
  header:
  - name: accept
    value: text/event-stream
  - name: content-type
    value: application/json
  body: '{"messages":[{"content":[{"text":"Use the provided tool result and answer directly.","type":"text"}],"role":"system"},{"role":"assistant","tool_calls":[{"function":{"arguments":"{}","name":"lookup_harbor_label"},"id":"call_REDACTED_1","type":"function"}]},{"content":"crimson-harbor","role":"tool","tool_call_id":"call_REDACTED_1"},{"content":"Now reply in one short sentence using the provided tool result. Do not call any tools.","role":"user"}],"model":"openai/gpt-4o","stream":true}'
then:
  status: 200
  header:
  - name: content-type
    value: text/event-stream
  body: |+
    : OPENROUTER PROCESSING

    data: {"choices":[{"delta":{"content":"Cr","role":"assistant"},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_2","model":"openai/gpt-4o","object":"chat.completion.chunk","provider":"Azure","system_fingerprint":"fp_REDACTED_1"}

    data: {"choices":[{"delta":{"content":"imson","role":"assistant"},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_2","model":"openai/gpt-4o","object":"chat.completion.chunk","provider":"Azure","system_fingerprint":"fp_REDACTED_1"}

    data: {"choices":[{"delta":{"content":" Harbor","role":"assistant"},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_2","model":"openai/gpt-4o","object":"chat.completion.chunk","provider":"Azure","system_fingerprint":"fp_REDACTED_1"}

    data: {"choices":[{"delta":{"content":" is","role":"assistant"},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_2","model":"openai/gpt-4o","object":"chat.completion.chunk","provider":"Azure","system_fingerprint":"fp_REDACTED_1"}

    data: {"choices":[{"delta":{"content":" the","role":"assistant"},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_2","model":"openai/gpt-4o","object":"chat.completion.chunk","provider":"Azure","system_fingerprint":"fp_REDACTED_1"}

    data: {"choices":[{"delta":{"content":" name","role":"assistant"},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_2","model":"openai/gpt-4o","object":"chat.completion.chunk","provider":"Azure","system_fingerprint":"fp_REDACTED_1"}

    data: {"choices":[{"delta":{"content":" you're","role":"assistant"},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_2","model":"openai/gpt-4o","object":"chat.completion.chunk","provider":"Azure","system_fingerprint":"fp_REDACTED_1"}

    data: {"choices":[{"delta":{"content":" looking","role":"assistant"},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_2","model":"openai/gpt-4o","object":"chat.completion.chunk","provider":"Azure","system_fingerprint":"fp_REDACTED_1"}

    data: {"choices":[{"delta":{"content":" for","role":"assistant"},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_2","model":"openai/gpt-4o","object":"chat.completion.chunk","provider":"Azure","system_fingerprint":"fp_REDACTED_1"}

    data: {"choices":[{"delta":{"content":".","role":"assistant"},"finish_reason":null,"index":0,"native_finish_reason":null}],"created":0,"id":"chatcmpl-REDACTED_2","model":"openai/gpt-4o","object":"chat.completion.chunk","provider":"Azure","system_fingerprint":"fp_REDACTED_1"}

    data: {"choices":[{"delta":{"content":"","role":"assistant"},"finish_reason":"stop","index":0,"native_finish_reason":"stop"}],"created":0,"id":"chatcmpl-REDACTED_2","model":"openai/gpt-4o","object":"chat.completion.chunk","provider":"Azure","system_fingerprint":"fp_REDACTED_1"}

    data: {"choices":[{"delta":{"content":"","role":"assistant"},"finish_reason":"stop","index":0,"native_finish_reason":"stop"}],"created":0,"id":"chatcmpl-REDACTED_2","model":"openai/gpt-4o","object":"chat.completion.chunk","provider":"Azure","service_tier":null,"system_fingerprint":"fp_REDACTED_1","usage":{"completion_tokens":11,"completion_tokens_details":{"audio_tokens":0,"image_tokens":0,"reasoning_tokens":0},"cost":0.0002775,"cost_details":{"upstream_inference_completions_cost":0.00011,"upstream_inference_cost":0.0002775,"upstream_inference_prompt_cost":0.0001675},"is_byok":false,"prompt_tokens":67,"prompt_tokens_details":{"audio_tokens":0,"cache_write_tokens":0,"cached_tokens":0,"video_tokens":0},"total_tokens":78}}

    data: [DONE]

