#!/bin/bash
export LC_ALL=C
U=https://opencode.ai/zen/v1/chat/completions
for m in beam-free longcat-2.5-preview-free nemotron-3.5-lightning-free minimax-m3.1-flash-free mimo-v2.6-flash-free; do
  printf '  %-34s ' "$m"
  for i in 1 2; do
    c=$(curl -s -o /tmp/b -w '%{http_code}' --max-time 35 -x http://172.19.0.1:20808 -X POST "$U" \
      -H 'content-type: application/json' -H 'accept: text/event-stream' \
      -H 'x-opencode-client: desktop' \
      -d "{\"model\":\"$m\",\"messages\":[{\"role\":\"user\",\"content\":\"hi\"}],\"stream\":true}" 2>/dev/null)
    printf '%s ' "$c"
  done
  printf ' %s\n' "$(head -c 90 /tmp/b | tr -d '\n')"
done
