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%
724 B · 13 lines shellscript
Raw Blame History
1#!/usr/bin/env bash2# STATUS: LIVE_VERIFIED — executed 2026-09-18 (exit 0 in 1.5s)3# Legacy POST /v1/completions (gpt-3.5-turbo-instruct, prompt string, max_tokens). Object = text_completion, choices[].text.4set -euo pipefail5cd "$(dirname "$0")/../../.."6source scripts/lib.sh7T=$(mktemp); trap 'rm -f "$T"' EXIT89oai POST /v1/completions -d '{"model":"gpt-3.5-turbo-instruct","prompt":"Say OK.","max_tokens":5}' > "$T"10log_request openai POST /v1/completions "$OAI_STATUS" 0.00001 "example chat/legacy_completions.sh"11mask < "$T" | python3 -c 'import json,sys; r=json.load(sys.stdin); print(r["object"], r["model"], repr(r["choices"][0]["text"]), r["choices"][0]["finish_reason"], r["usage"])'12[ "$OAI_STATUS" = "200" ]13