Agents & Coding

OpenAI's Official API CLI Arrives, With Codex Confusion Attached

OpenAI's official CLI turns REST API calls into shell commands, but its overlap with Codex and a terse README leave developers unsure when to use it.

82 points51 comments

OpenAI has published an official command-line tool for its REST API, letting developers generate images, upload files, submit batches and inspect results from a terminal or shell script. The CLI is positioned separately from Codex CLI: openai is for calling specific API operations or scripting them, while codex is for agentic coding work.

It supports macOS, Linux and Windows, authenticates with API keys, and offers structured output for scripts. Output can be text, JSON, JSONL, raw or YAML, with GJSON transforms and stderr error summaries.

Key takeaways

  • Installation can use prebuilt binaries for macOS, Linux and Windows, Homebrew, or go install, which requires Go 1.26 or later.
  • Standard calls use OPENAI_API_KEY; admin endpoints use OPENAI_ADMIN_KEY. Interactive runs check for updates but never install them, and OPENAI_CLI_NO_UPDATE_CHECK=1 disables checks.
  • Errors go to stderr as readable summaries; --format-error json exposes API error details, and --transform-error extracts fields. API error details and --debug logs can contain sensitive data.
  • File input flags accept @path, and OPENAI_UNTRUSTED_STDIN=1 prevents piped JSON or YAML from triggering local file reads; upload paths must then be explicit flags.
  • Bug reports and feature requests go through GitHub issues, but pull requests are limited to repository collaborators; the project is Apache-2.0 licensed.

What people think

Codex, curl and bespoke alternatives

The release forces a comparison with Codex CLI, which one argument describes as an agent harness while openai is an API wrapper. Another calls the wrapper little more than curl, and a third questions the value of a generalist tool when a bespoke version can be generated in 25 minutes. Product-name confusion, including whether Codex already was the OpenAI CLI, compounds the positioning problem.

README lacks plain-language framing

Criticism focuses on the README's jargon-heavy presentation: a $2 trillion company should say what the tool is, why it is useful and who it is for. A counterargument says a REST API CLI needs no marketing because its purpose is obvious to API users. The harsher response calls the omission evidence of absent product management.

Deprecation churn and platform risk

OpenAI's history of deprecating tools within two years, sometimes without formal notice, makes long-term reliance risky. One argument says the problem is not unique to AI-generated code, pointing to Google's product shutdowns and Anthropic's retirement of Claude design. Another says developers should accept constant migration as the new standard.

Vibe-coded quality and review gaps

Several arguments assume the CLI is largely AI-generated and question whether it received adequate review or functional testing. They cite avoidable bugs, blocked issue reporters and a general lack of conscientious product management. A counterpoint challenges the causal link, noting that buggy software does not obviously drive revenue and that a successful company still makes mistakes. Trust in a dependency built in an afternoon remains the central worry.

Provider outages and token quotas

One argument raises operational dependence on hosted model providers: when the provider goes down, a developer cannot fix the incident by waiting for a token quota to reset. A thin API wrapper inherits the availability and billing constraints of the service behind it.