Skip to content
AI Technology News

AI news2 min read

OpenAI ships an official CLI for calling its API from the terminal

OpenAI has released openai, a command-line tool for its REST API: images, files, batches, and usage data, all from a shell or script. It is separate from Codex CLI.

By Ola-obaado Oluwadara · Updated Oct 24, 2026, 3:28 PM UTC

On this page

OpenAI has published an official command-line tool, openai, on GitHub. It calls the OpenAI REST API from your terminal or shell scripts, so you can generate images, upload files, submit batches and inspect API results without writing an app.

Commands follow the API's resources, in the form openai <resource> <command> [flags]. The README shows image generation (saved to a local folder), file upload and download, and batch jobs, where you upload a JSONL file, create the batch, then batches wait and download the results. Output is readable text by default, but you can ask for JSON or JSONL and pipe it into jq, or pull out fields with --transform. There is also an admin key route for things like organization usage.

It installs as a prebuilt binary for macOS, Linux and Windows, through Homebrew, or with go install (Go 1.26 or later). It is Apache 2.0 licensed. The README is clear that this is not Codex CLI: openai calls specific APIs, while codex is the coding agent.

My take

If you automate things, this is useful. I like running small jobs from a cron task or a script, and a batch workflow where one command waits and downloads results is exactly that kind of thing. Being able to pull usage data with one command and email it to yourself is the first thing I'd try.

Be careful with two details. First, the tool can auto-update itself during eligible interactive runs for self-managed installs. The README gives environment variables to turn that off, and on a production server I'd set OPENAI_CLI_NO_AUTO_UPDATE=1 before anything else. Second, the README warns that a failed request can leave an incomplete output file, so check the exit status before using redirected results. That is the kind of mistake that bites quietly in a script.

The OPENAI_UNTRUSTED_STDIN setting is also worth knowing: the @path syntax can read local files, so piping in JSON from an untrusted source without it is risky.

The README says nothing about availability or pricing beyond needing an API key, so I can't say anything about access for builders outside the US and Europe. Payment for the API itself is still the real hurdle for many of us. Still, a Go binary that installs in one line is a lower barrier than setting up a Python environment just to test an endpoint.

Sources

Drafted with AI assistance from the sources above, and reviewed before publishing.

Written by

Ola-obaado OluwadaraSoftware Engineer

Fullstack software engineer skilled in building scalable web applications, implementing secure systems, and deploying solutions to the cloud. Experienced in both frontend and backend development, with a strong focus on performance, reliability, and clean code.

GitHubLinkedInX

Get the weekly AI roundup

The tools worth your time, tested by a developer. One email a week.

One email a week, no spam. Unsubscribe any time. See the privacy policy.

Need AI features built for your business?

I build practical AI into products: assistants, search, automation.

Contact me

Comments

What do you think? Drop your thoughts below.

Be kind and stay on topic. Comments with links are checked before they appear.

Loading comments…