SPB Git forge

spb/doc-api

Public
2commits 1branches 0releases
15.7 MBsize
maindefault branch
14 days agolast push
Python 88.3% TypeScript 7.6% Shell 4.1%
1.1 KB · 12 lines shellscript
Raw Blame History
1#!/usr/bin/env bash2# computer_use_preview tool + computer-use-preview model with a 1x1 PNG screenshot. STATUS: ACCOUNT_RESTRICTED 2026-09-18 (404 model_not_found with our key).3# Run: bash examples/openai/tools/computer-use/computer_use.sh4set -eo pipefail  # no -u: oai() runs in $(...) subshells, so OAI_STATUS may be unset in the parent5source "$(dirname "$0")/../../../../scripts/lib.sh"6PNG1="iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP4//8/AwAFAAIKLC0+hQAAAABJRU5ErkJggg=="7R=$(oai POST /v1/responses -d "{\"model\":\"computer-use-preview\",\"truncation\":\"auto\",\"max_output_tokens\":32,8 \"tools\":[{\"type\":\"computer_use_preview\",\"display_width\":1,\"display_height\":1,\"environment\":\"browser\"}],9 \"input\":[{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Do nothing. Reply with OK.\"},{\"type\":\"input_image\",\"image_url\":\"data:image/png;base64,$PNG1\"}]}]}")10log_request openai POST /v1/responses "${OAI_STATUS:-200}" 0 "computer_use.sh"11echo "$R" | jq -c '.error // [.output[] | {type, call_id, action, pending_safety_checks}]'   # our key: error.code == "model_not_found"12