OpenAI Releases First Official API CLI — Go-Built, Brew-Installable
OpenAI has shipped an official CLI for its REST API at github.com/openai/openai-cli. It landed on Hacker News’ front page today.
The tool is written in Go and requires Go 1.26 or later. Homebrew users can install via the official tap:
brew install openai/tools/openai
Go users get a binary placed in the Go bin directory:
go install 'github.com/openai/openai-cli/cmd/openai@latest'
Command Structure
The CLI follows a resource-based layout: openai <resource> [subresource...] <command> [flags...]. Standard API endpoints authenticate with OPENAI_API_KEY; admin endpoints require a separate OPENAI_ADMIN_KEY. The distinction matters — admin keys unlock organisation-level usage data and billing breakdowns that aren’t available through regular API credentials.
A sample standard invocation:
openai responses create --input "Say this is a test" --model gpt-5.5
Admin usage reporting:
openai admin organization usage completions \
--start-time 1735689600 \
--end-time 1735776000 \
--bucket-width 1d
Legacy colon-style syntax (openai admin:organization:usage) still works.
Image Picker
The CLI includes an interactive image picker for openai images generate. The first eligible interactive run quietly installs Tab shortcuts for Bash, zsh, and fish sessions; PowerShell uses Enter to launch the picker instead. Shell shortcut setup is documented at docs/image-picker-shell-setup.md and can be opted out.
Update Checks
Bare openai checks for newer stable releases at most once every seven days, using public GitHub release metadata — no credentials needed, waits at most 200ms. Homebrew installations surface brew upgrade --cask openai/tools/openai as the update command. The CLI never installs updates automatically. Set OPENAI_CLI_NO_UPDATE_CHECK=1 to disable entirely.
Why It Matters
OpenAI has had an unofficial Python-based CLI floating in various community packages for years, but this is the first version under the official openai GitHub organisation with a formal release channel. The Go choice signals an intent for static, portable binaries that work across CI and production environments without requiring a Python runtime — a practical consideration as API calls get embedded deeper into engineering workflows and agent pipelines.
The admin key separation is a meaningful addition. Organisations running multi-team API setups can now script usage audits without distributing full API credentials.