---
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":"grok-code-fast-1","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.7.1
    url: https://api.x.ai/v1/chat/completions
    method: POST
  response:
    proto: HTTP/2.0
    proto_major: 2
    proto_minor: 0
    content_length: -1
    body: |+
      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":"The","role":"assistant"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":" user"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":" asked"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":":"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":" \""}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":"What's"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":" the"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":" weather"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":" in"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":" Florence"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":","}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":"Italy"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":"?\"\n"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854963,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"tool_calls":[{"id":"call_64629939","function":{"name":"weather","arguments":"{\"location\":\"Florence,Italy\"}"},"index":0,"type":"function"}]}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"ba8d6fcb-acbd-9d88-c17c-8ddef4027734","object":"chat.completion.chunk","created":1762854964,"model":"grok-code-fast-1","choices":[],"usage":{"prompt_tokens":390,"completion_tokens":26,"total_tokens":495,"prompt_tokens_details":{"text_tokens":390,"audio_tokens":0,"image_tokens":0,"cached_tokens":384},"completion_tokens_details":{"reasoning_tokens":79,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0},"num_sources_used":0},"system_fingerprint":"fp_10f00c862d"}

      data: [DONE]

    headers:
      Content-Type:
      - text/event-stream
    status: 200 OK
    code: 200
    duration: 226.151666ms
- id: 1
  request:
    proto: HTTP/1.1
    proto_major: 1
    proto_minor: 1
    content_length: 813
    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_64629939","function":{"arguments":"{\"location\":\"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant","reasoning_content":"The user asked: \"What''s the weather in Florence,Italy?\"\n"},{"content":"40 C","tool_call_id":"call_64629939","role":"tool"}],"model":"grok-code-fast-1","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.7.1
    url: https://api.x.ai/v1/chat/completions
    method: POST
  response:
    proto: HTTP/2.0
    proto_major: 2
    proto_minor: 0
    content_length: -1
    body: |+
      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":"The","role":"assistant"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":" tool"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":" returned"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":" \""}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":"40"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":" C"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":"\","}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":" which"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":" means"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":" "}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":"40"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":" degrees"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":" Celsius"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"reasoning_content":".\n"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"content":"The"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"content":" current"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"content":" weather"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"content":" in"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"content":" Florence"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"content":","}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"content":" Italy"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"content":" is"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"content":" "}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"content":"40"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"content":"°C"}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{"content":"."}}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"system_fingerprint":"fp_10f00c862d"}

      data: {"id":"438e92b5-a71d-8052-6667-f9db15f43cbe","object":"chat.completion.chunk","created":1762854965,"model":"grok-code-fast-1","choices":[],"usage":{"prompt_tokens":508,"completion_tokens":12,"total_tokens":588,"prompt_tokens_details":{"text_tokens":508,"audio_tokens":0,"image_tokens":0,"cached_tokens":448},"completion_tokens_details":{"reasoning_tokens":68,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0},"num_sources_used":0},"system_fingerprint":"fp_10f00c862d"}

      data: [DONE]

    headers:
      Content-Type:
      - text/event-stream
    status: 200 OK
    code: 200
    duration: 431.66775ms
