SPB Git forge

spb/doc-api

Public
2commits 1branches 0releases
15.7 MBsize
maindefault branch
13 days agolast push
Python 88.3% TypeScript 7.6% Shell 4.1%
802 B · 13 lines shellscript
Raw Blame History
1#!/usr/bin/env bash2# STATUS: LIVE_VERIFIED — executed 2026-09-18 (exit 0 in 0.7s)3# Minimal POST /v1/chat/completions (gpt-4.1-nano). Equivalent of responses/minimal.sh: messages[] instead of input, choices[0].message.content instead of output_text.4set -euo pipefail5cd "$(dirname "$0")/../../.."6source scripts/lib.sh7T=$(mktemp); trap 'rm -f "$T"' EXIT89oai POST /v1/chat/completions -d '{"model":"gpt-4.1-nano","messages":[{"role":"user","content":"Reply with OK."}],"max_completion_tokens":32}' > "$T"10log_request openai POST /v1/chat/completions "$OAI_STATUS" 0.000002 "example chat/minimal.sh"11mask < "$T" | python3 -c 'import json,sys; r=json.load(sys.stdin); print(r["object"], r["choices"][0]["message"]["content"], r["choices"][0]["finish_reason"], r["usage"])'12[ "$OAI_STATUS" = "200" ]13