when:
  path: /v1/responses
  method: POST
  query_param: []
  header:
  - name: accept
    value: text/event-stream
  - name: content-type
    value: application/json
  body: '{"input":[{"content":[{"text":"You are a calculator here to help the user perform arithmetic operations. Use the tools provided to answer the user''s question and answer in a full sentence.","type":"input_text"}],"role":"system","type":"message"},{"content":[{"text":"Calculate 2 - 5","type":"input_text"}],"role":"user","type":"message"}],"max_output_tokens":1024,"model":"gpt-4o","stream":true,"tools":[{"description":"Add x and y together","name":"add","parameters":{"additionalProperties":false,"properties":{"x":{"description":"The first number to add","type":"number"},"y":{"description":"The second number to add","type":"number"}},"required":["x","y"],"type":"object"},"strict":true,"type":"function"},{"description":"Subtract y from x (i.e.: x - y)","name":"subtract","parameters":{"additionalProperties":false,"properties":{"x":{"description":"The number to subtract from","type":"number"},"y":{"description":"The number to subtract","type":"number"}},"required":["x","y"],"type":"object"},"strict":true,"type":"function"}]}'
then:
  status: 200
  header:
  - name: content-type
    value: text/event-stream; charset=utf-8
  body: |+
    event: response.created
    data: {"response":{"background":false,"completed_at":null,"created_at":0,"error":null,"frequency_penalty":0.0,"id":"resp_REDACTED_1","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"gpt-4o-2024-08-06","moderation":null,"object":"response","output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","status":"in_progress","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"description":"Add x and y together","name":"add","parameters":{"additionalProperties":false,"properties":{"x":{"description":"The first number to add","type":"number"},"y":{"description":"The second number to add","type":"number"}},"required":["x","y"],"type":"object"},"strict":true,"type":"function"},{"description":"Subtract y from x (i.e.: x - y)","name":"subtract","parameters":{"additionalProperties":false,"properties":{"x":{"description":"The number to subtract from","type":"number"},"y":{"description":"The number to subtract","type":"number"}},"required":["x","y"],"type":"object"},"strict":true,"type":"function"}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null},"sequence_number":0,"type":"response.created"}

    event: response.in_progress
    data: {"response":{"background":false,"completed_at":null,"created_at":0,"error":null,"frequency_penalty":0.0,"id":"resp_REDACTED_1","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"gpt-4o-2024-08-06","moderation":null,"object":"response","output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","status":"in_progress","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"description":"Add x and y together","name":"add","parameters":{"additionalProperties":false,"properties":{"x":{"description":"The first number to add","type":"number"},"y":{"description":"The second number to add","type":"number"}},"required":["x","y"],"type":"object"},"strict":true,"type":"function"},{"description":"Subtract y from x (i.e.: x - y)","name":"subtract","parameters":{"additionalProperties":false,"properties":{"x":{"description":"The number to subtract from","type":"number"},"y":{"description":"The number to subtract","type":"number"}},"required":["x","y"],"type":"object"},"strict":true,"type":"function"}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null},"sequence_number":1,"type":"response.in_progress"}

    event: response.output_item.added
    data: {"item":{"arguments":"","call_id":"call_REDACTED_1","id":"fc_REDACTED_1","name":"subtract","status":"in_progress","type":"function_call"},"output_index":0,"sequence_number":2,"type":"response.output_item.added"}

    event: response.function_call_arguments.delta
    data: {"delta":"{\"","item_id":"fc_REDACTED_1","obfuscation":"obfuscation_REDACTED_1","output_index":0,"sequence_number":3,"type":"response.function_call_arguments.delta"}

    event: response.function_call_arguments.delta
    data: {"delta":"x","item_id":"fc_REDACTED_1","obfuscation":"obfuscation_REDACTED_2","output_index":0,"sequence_number":4,"type":"response.function_call_arguments.delta"}

    event: response.function_call_arguments.delta
    data: {"delta":"\":","item_id":"fc_REDACTED_1","obfuscation":"obfuscation_REDACTED_3","output_index":0,"sequence_number":5,"type":"response.function_call_arguments.delta"}

    event: response.function_call_arguments.delta
    data: {"delta":"2","item_id":"fc_REDACTED_1","obfuscation":"obfuscation_REDACTED_4","output_index":0,"sequence_number":6,"type":"response.function_call_arguments.delta"}

    event: response.function_call_arguments.delta
    data: {"delta":",\"","item_id":"fc_REDACTED_1","obfuscation":"obfuscation_REDACTED_5","output_index":0,"sequence_number":7,"type":"response.function_call_arguments.delta"}

    event: response.function_call_arguments.delta
    data: {"delta":"y","item_id":"fc_REDACTED_1","obfuscation":"obfuscation_REDACTED_6","output_index":0,"sequence_number":8,"type":"response.function_call_arguments.delta"}

    event: response.function_call_arguments.delta
    data: {"delta":"\":","item_id":"fc_REDACTED_1","obfuscation":"obfuscation_REDACTED_7","output_index":0,"sequence_number":9,"type":"response.function_call_arguments.delta"}

    event: response.function_call_arguments.delta
    data: {"delta":"5","item_id":"fc_REDACTED_1","obfuscation":"obfuscation_REDACTED_8","output_index":0,"sequence_number":10,"type":"response.function_call_arguments.delta"}

    event: response.function_call_arguments.delta
    data: {"delta":"}","item_id":"fc_REDACTED_1","obfuscation":"obfuscation_REDACTED_9","output_index":0,"sequence_number":11,"type":"response.function_call_arguments.delta"}

    event: response.function_call_arguments.done
    data: {"arguments":"{\"x\":2,\"y\":5}","item_id":"fc_REDACTED_1","output_index":0,"sequence_number":12,"type":"response.function_call_arguments.done"}

    event: response.output_item.done
    data: {"item":{"arguments":"{\"x\":2,\"y\":5}","call_id":"call_REDACTED_1","id":"fc_REDACTED_1","name":"subtract","status":"completed","type":"function_call"},"output_index":0,"sequence_number":13,"type":"response.output_item.done"}

    event: response.completed
    data: {"response":{"background":false,"completed_at":0,"created_at":0,"error":null,"frequency_penalty":0.0,"id":"resp_REDACTED_1","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"gpt-4o-2024-08-06","moderation":null,"object":"response","output":[{"arguments":"{\"x\":2,\"y\":5}","call_id":"call_REDACTED_1","id":"fc_REDACTED_1","name":"subtract","status":"completed","type":"function_call"}],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"default","status":"completed","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"description":"Add x and y together","name":"add","parameters":{"additionalProperties":false,"properties":{"x":{"description":"The first number to add","type":"number"},"y":{"description":"The second number to add","type":"number"}},"required":["x","y"],"type":"object"},"strict":true,"type":"function"},{"description":"Subtract y from x (i.e.: x - y)","name":"subtract","parameters":{"additionalProperties":false,"properties":{"x":{"description":"The number to subtract from","type":"number"},"y":{"description":"The number to subtract","type":"number"}},"required":["x","y"],"type":"object"},"strict":true,"type":"function"}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":134,"input_tokens_details":{"cached_tokens":0},"output_tokens":18,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":152},"user":null},"sequence_number":14,"type":"response.completed"}

---
when:
  path: /v1/responses
  method: POST
  query_param: []
  header:
  - name: accept
    value: text/event-stream
  - name: content-type
    value: application/json
  body: '{"input":[{"content":[{"text":"You are a calculator here to help the user perform arithmetic operations. Use the tools provided to answer the user''s question and answer in a full sentence.","type":"input_text"}],"role":"system","type":"message"},{"content":[{"text":"Calculate 2 - 5","type":"input_text"}],"role":"user","type":"message"},{"arguments":"{\"x\":2,\"y\":5}","call_id":"call_REDACTED_1","id":"fc_REDACTED_1","name":"subtract","status":"completed","type":"function_call"},{"call_id":"call_REDACTED_1","output":"-3","status":"completed","type":"function_call_output"}],"max_output_tokens":1024,"model":"gpt-4o","stream":true,"tools":[{"description":"Add x and y together","name":"add","parameters":{"additionalProperties":false,"properties":{"x":{"description":"The first number to add","type":"number"},"y":{"description":"The second number to add","type":"number"}},"required":["x","y"],"type":"object"},"strict":true,"type":"function"},{"description":"Subtract y from x (i.e.: x - y)","name":"subtract","parameters":{"additionalProperties":false,"properties":{"x":{"description":"The number to subtract from","type":"number"},"y":{"description":"The number to subtract","type":"number"}},"required":["x","y"],"type":"object"},"strict":true,"type":"function"}]}'
then:
  status: 200
  header:
  - name: content-type
    value: text/event-stream; charset=utf-8
  body: |+
    event: response.created
    data: {"response":{"background":false,"completed_at":null,"created_at":0,"error":null,"frequency_penalty":0.0,"id":"resp_REDACTED_2","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"gpt-4o-2024-08-06","moderation":null,"object":"response","output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","status":"in_progress","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"description":"Add x and y together","name":"add","parameters":{"additionalProperties":false,"properties":{"x":{"description":"The first number to add","type":"number"},"y":{"description":"The second number to add","type":"number"}},"required":["x","y"],"type":"object"},"strict":true,"type":"function"},{"description":"Subtract y from x (i.e.: x - y)","name":"subtract","parameters":{"additionalProperties":false,"properties":{"x":{"description":"The number to subtract from","type":"number"},"y":{"description":"The number to subtract","type":"number"}},"required":["x","y"],"type":"object"},"strict":true,"type":"function"}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null},"sequence_number":0,"type":"response.created"}

    event: response.in_progress
    data: {"response":{"background":false,"completed_at":null,"created_at":0,"error":null,"frequency_penalty":0.0,"id":"resp_REDACTED_2","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"gpt-4o-2024-08-06","moderation":null,"object":"response","output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"auto","status":"in_progress","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"description":"Add x and y together","name":"add","parameters":{"additionalProperties":false,"properties":{"x":{"description":"The first number to add","type":"number"},"y":{"description":"The second number to add","type":"number"}},"required":["x","y"],"type":"object"},"strict":true,"type":"function"},{"description":"Subtract y from x (i.e.: x - y)","name":"subtract","parameters":{"additionalProperties":false,"properties":{"x":{"description":"The number to subtract from","type":"number"},"y":{"description":"The number to subtract","type":"number"}},"required":["x","y"],"type":"object"},"strict":true,"type":"function"}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":null,"user":null},"sequence_number":1,"type":"response.in_progress"}

    event: response.output_item.added
    data: {"item":{"content":[],"id":"msg_REDACTED_1","role":"assistant","status":"in_progress","type":"message"},"output_index":0,"sequence_number":2,"type":"response.output_item.added"}

    event: response.content_part.added
    data: {"content_index":0,"item_id":"msg_REDACTED_1","output_index":0,"part":{"annotations":[],"logprobs":[],"text":"","type":"output_text"},"sequence_number":3,"type":"response.content_part.added"}

    event: response.output_text.delta
    data: {"content_index":0,"delta":"The","item_id":"msg_REDACTED_1","logprobs":[],"obfuscation":"obfuscation_REDACTED_10","output_index":0,"sequence_number":4,"type":"response.output_text.delta"}

    event: response.output_text.delta
    data: {"content_index":0,"delta":" result","item_id":"msg_REDACTED_1","logprobs":[],"obfuscation":"obfuscation_REDACTED_11","output_index":0,"sequence_number":5,"type":"response.output_text.delta"}

    event: response.output_text.delta
    data: {"content_index":0,"delta":" of","item_id":"msg_REDACTED_1","logprobs":[],"obfuscation":"obfuscation_REDACTED_12","output_index":0,"sequence_number":6,"type":"response.output_text.delta"}

    event: response.output_text.delta
    data: {"content_index":0,"delta":" \\(","item_id":"msg_REDACTED_1","logprobs":[],"obfuscation":"obfuscation_REDACTED_13","output_index":0,"sequence_number":7,"type":"response.output_text.delta"}

    event: response.output_text.delta
    data: {"content_index":0,"delta":"2","item_id":"msg_REDACTED_1","logprobs":[],"obfuscation":"obfuscation_REDACTED_14","output_index":0,"sequence_number":8,"type":"response.output_text.delta"}

    event: response.output_text.delta
    data: {"content_index":0,"delta":" -","item_id":"msg_REDACTED_1","logprobs":[],"obfuscation":"obfuscation_REDACTED_15","output_index":0,"sequence_number":9,"type":"response.output_text.delta"}

    event: response.output_text.delta
    data: {"content_index":0,"delta":" ","item_id":"msg_REDACTED_1","logprobs":[],"obfuscation":"obfuscation_REDACTED_16","output_index":0,"sequence_number":10,"type":"response.output_text.delta"}

    event: response.output_text.delta
    data: {"content_index":0,"delta":"5","item_id":"msg_REDACTED_1","logprobs":[],"obfuscation":"obfuscation_REDACTED_17","output_index":0,"sequence_number":11,"type":"response.output_text.delta"}

    event: response.output_text.delta
    data: {"content_index":0,"delta":"\\","item_id":"msg_REDACTED_1","logprobs":[],"obfuscation":"obfuscation_REDACTED_18","output_index":0,"sequence_number":12,"type":"response.output_text.delta"}

    event: response.output_text.delta
    data: {"content_index":0,"delta":")","item_id":"msg_REDACTED_1","logprobs":[],"obfuscation":"obfuscation_REDACTED_19","output_index":0,"sequence_number":13,"type":"response.output_text.delta"}

    event: response.output_text.delta
    data: {"content_index":0,"delta":" is","item_id":"msg_REDACTED_1","logprobs":[],"obfuscation":"obfuscation_REDACTED_20","output_index":0,"sequence_number":14,"type":"response.output_text.delta"}

    event: response.output_text.delta
    data: {"content_index":0,"delta":" \\","item_id":"msg_REDACTED_1","logprobs":[],"obfuscation":"obfuscation_REDACTED_21","output_index":0,"sequence_number":15,"type":"response.output_text.delta"}

    event: response.output_text.delta
    data: {"content_index":0,"delta":"(-","item_id":"msg_REDACTED_1","logprobs":[],"obfuscation":"obfuscation_REDACTED_22","output_index":0,"sequence_number":16,"type":"response.output_text.delta"}

    event: response.output_text.delta
    data: {"content_index":0,"delta":"3","item_id":"msg_REDACTED_1","logprobs":[],"obfuscation":"obfuscation_REDACTED_23","output_index":0,"sequence_number":17,"type":"response.output_text.delta"}

    event: response.output_text.delta
    data: {"content_index":0,"delta":"\\","item_id":"msg_REDACTED_1","logprobs":[],"obfuscation":"obfuscation_REDACTED_24","output_index":0,"sequence_number":18,"type":"response.output_text.delta"}

    event: response.output_text.delta
    data: {"content_index":0,"delta":").","item_id":"msg_REDACTED_1","logprobs":[],"obfuscation":"obfuscation_REDACTED_25","output_index":0,"sequence_number":19,"type":"response.output_text.delta"}

    event: response.output_text.done
    data: {"content_index":0,"item_id":"msg_REDACTED_1","logprobs":[],"output_index":0,"sequence_number":20,"text":"The result of \\(2 - 5\\) is \\(-3\\).","type":"response.output_text.done"}

    event: response.content_part.done
    data: {"content_index":0,"item_id":"msg_REDACTED_1","output_index":0,"part":{"annotations":[],"logprobs":[],"text":"The result of \\(2 - 5\\) is \\(-3\\).","type":"output_text"},"sequence_number":21,"type":"response.content_part.done"}

    event: response.output_item.done
    data: {"item":{"content":[{"annotations":[],"logprobs":[],"text":"The result of \\(2 - 5\\) is \\(-3\\).","type":"output_text"}],"id":"msg_REDACTED_1","role":"assistant","status":"completed","type":"message"},"output_index":0,"sequence_number":22,"type":"response.output_item.done"}

    event: response.completed
    data: {"response":{"background":false,"completed_at":0,"created_at":0,"error":null,"frequency_penalty":0.0,"id":"resp_REDACTED_2","incomplete_details":null,"instructions":null,"max_output_tokens":1024,"max_tool_calls":null,"metadata":{},"model":"gpt-4o-2024-08-06","moderation":null,"object":"response","output":[{"content":[{"annotations":[],"logprobs":[],"text":"The result of \\(2 - 5\\) is \\(-3\\).","type":"output_text"}],"id":"msg_REDACTED_1","role":"assistant","status":"completed","type":"message"}],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"in_memory","reasoning":{"effort":null,"summary":null},"safety_identifier":null,"service_tier":"default","status":"completed","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"description":"Add x and y together","name":"add","parameters":{"additionalProperties":false,"properties":{"x":{"description":"The first number to add","type":"number"},"y":{"description":"The second number to add","type":"number"}},"required":["x","y"],"type":"object"},"strict":true,"type":"function"},{"description":"Subtract y from x (i.e.: x - y)","name":"subtract","parameters":{"additionalProperties":false,"properties":{"x":{"description":"The number to subtract from","type":"number"},"y":{"description":"The number to subtract","type":"number"}},"required":["x","y"],"type":"object"},"strict":true,"type":"function"}],"top_logprobs":0,"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":161,"input_tokens_details":{"cached_tokens":0},"output_tokens":18,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":179},"user":null},"sequence_number":23,"type":"response.completed"}

