simple_streaming.yaml

 1---
 2version: 2
 3interactions:
 4- id: 0
 5  request:
 6    proto: HTTP/1.1
 7    proto_major: 1
 8    proto_minor: 1
 9    content_length: 227
10    host: ""
11    body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"openai/gpt-5","max_completion_tokens":4000,"stream_options":{"include_usage":true},"stream":true}'
12    headers:
13      Accept:
14      - application/json
15      Content-Type:
16      - application/json
17      User-Agent:
18      - Charm-Fantasy/0.12.2 (https://charm.land/fantasy)
19    url: https://ai-gateway.vercel.sh/v1/chat/completions
20    method: POST
21  response:
22    proto: HTTP/2.0
23    proto_major: 2
24    proto_minor: 0
25    content_length: -1
26    body: |+
27      data: {"id":"gen_01KKHTPVSAYPGBCBH3AE1FZJSQ","object":"chat.completion.chunk","created":1773346189,"model":"openai/gpt-5","choices":[{"index":0,"delta":{"role":"assistant"},"logprobs":null,"finish_reason":null}],"system_fingerprint":"fp_d3cprdwpgu"}
28
29      data: {"id":"gen_01KKHTPVSAYPGBCBH3AE1FZJSQ","object":"chat.completion.chunk","created":1773346189,"model":"openai/gpt-5","choices":[{"index":0,"delta":{"reasoning_details":[{"type":"reasoning.encrypted","data":"gAAAAABpsx2NIyHMLvvhqDMglxGBZRK_M3CQWUX25R8u1hgnNEpn_LQlNHVzoLzz9ie3osFWaeC3Ir2KFj3FrAK7_Sunu_OKmNHGNJ9ZVdmI0rxYMld6yntzAGDuX78y4CepMxETrO66xcIcFdNuaWKwkBnPbf7Re7ZJRWfUAtLDZlluXjsJ3yYX1Ltng35Vl4oeNBjbjpy5wCQ6C7r3HD0IiJqtTCaiP5OtrLHeO3J9OiX032erzstj5bY5_U58GMjVxs1hjDnfGtUlhdI-gqOj_MerXPajZB2zQnktn50b2zydf_17p2lMXyK9G6tXLkGD-6zch2k81pWoiTt6Dn1jg6XaZUxX-FrjMpq9YP8pg6tXOnhjH8TOpxJfk8AzLVPnnV6hXr_QcLd3q2IMXfPrSnLUhEq0DumAa1PiLAoSZMwPt3GlDfFYLEenQ1UwAbdnoH1kUdyvVqK8E7-99vAX2A05lE8aZIK24g8X4WmZpUn7-13yfSh0qkj1fqIbuE_xf5BcKg84rUD9ZoF-o0X7gJg1VyT4wHuSn4mlMuCnb37HYMbqNYYVaJXyUpODppqZedaA4h6TGbOkfBOfB1UeFI37aiDWlFh-vN7bU9P8at4CJN8HU_2tgIdsoa7WoYG34dmgy3s6ti1EO2AIqZfyL85UpDRwIE1Gj92PPu3c1-GiNi_MLiVTtUq8c1I6DU_RKLKzv7C9II_rHRhFig0fxhITMFC5wxKt-tcMDUmokLYJInoPJqdinbtI18fxKDCxcVU8162Qn0Env_jazBoM9mqWEad7veHPvhnLtYi9ckppA3hROp0HVUwErRCPgMgOwKe4n4nq","id":"rs_0123852b10b5a0f70169b31d8da47c8196837a722f3072fd78","format":"openai-responses-v1","index":0}]},"logprobs":null,"finish_reason":null}],"system_fingerprint":"fp_d3cprdwpgu"}
30
31      data: {"id":"gen_01KKHTPVSAYPGBCBH3AE1FZJSQ","object":"chat.completion.chunk","created":1773346189,"model":"openai/gpt-5","choices":[{"index":0,"delta":{"content":"Olรก"},"logprobs":null,"finish_reason":null}],"system_fingerprint":"fp_d3cprdwpgu"}
32
33      data: {"id":"gen_01KKHTPVSAYPGBCBH3AE1FZJSQ","object":"chat.completion.chunk","created":1773346189,"model":"openai/gpt-5","choices":[{"index":0,"delta":{"content":"!"},"logprobs":null,"finish_reason":null}],"system_fingerprint":"fp_d3cprdwpgu"}
34
35      data: {"id":"gen_01KKHTPVSAYPGBCBH3AE1FZJSQ","object":"chat.completion.chunk","created":1773346189,"model":"openai/gpt-5","choices":[{"index":0,"delta":{"provider_metadata":{"openai":{"responseId":"resp_0123852b10b5a0f70169b31d8d26dc8196acfcef1f6661971c","serviceTier":"default"},"gateway":{"routing":{"originalModelId":"openai/gpt-5","resolvedProvider":"openai","resolvedProviderApiModelId":"gpt-5-2025-08-07","internalResolvedModelId":"openai:gpt-5-2025-08-07","fallbacksAvailable":["azure"],"internalReasoning":"Selected openai as preferred provider for gpt-5. 1 fallback(s) available: azure","planningReasoning":"System credentials planned for: openai, azure. Total execution order: openai(system) โ†’ azure(system)","canonicalSlug":"openai/gpt-5","finalProvider":"openai","attempts":[{"provider":"openai","internalModelId":"openai:gpt-5-2025-08-07","providerApiModelId":"gpt-5-2025-08-07","credentialType":"system","success":true,"startTime":339172.831454,"endTime":343701.441793,"providerRequestId":"req_a95d4a6ae87f43039a41e071547bd85f","statusCode":200,"providerResponseId":"resp_0123852b10b5a0f70169b31d8d26dc8196acfcef1f6661971c"}],"modelAttemptCount":1,"modelAttempts":[{"modelId":"openai:gpt-5-2025-08-07","canonicalSlug":"openai/gpt-5","success":true,"providerAttemptCount":1,"providerAttempts":[{"provider":"openai","internalModelId":"openai:gpt-5-2025-08-07","providerApiModelId":"gpt-5-2025-08-07","credentialType":"system","success":true,"startTime":339172.831454,"endTime":343701.441793,"providerRequestId":"req_a95d4a6ae87f43039a41e071547bd85f","statusCode":200,"providerResponseId":"resp_0123852b10b5a0f70169b31d8d26dc8196acfcef1f6661971c"}]}],"totalProviderAttemptCount":1},"cost":"0.00159375","marketCost":"0.00159375","generationId":"gen_01KKHTPVSAYPGBCBH3AE1FZJSQ","billableWebSearchCalls":0}}},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":19,"completion_tokens":93,"total_tokens":112,"cost":0.00159375,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0,"upstream_inference_completions_cost":0},"completion_tokens_details":{"reasoning_tokens":64,"image_tokens":0},"cache_creation_input_tokens":0,"market_cost":0.00159375},"system_fingerprint":"fp_d3cprdwpgu","service_tier":"default","generationId":"gen_01KKHTPVSAYPGBCBH3AE1FZJSQ"}
36
37      data: [DONE]
38
39    headers:
40      Content-Type:
41      - text/event-stream
42    status: 200 OK
43    code: 200
44    duration: 505.86125ms